Skip to content

Apache Bookkeeper Kubernetes Operator built with Kubebuilder

Notifications You must be signed in to change notification settings

monimesl/bookkeeper-operator

Repository files navigation

Language Go Report Card Actions Status

Apache Bookkeeper Operator

Status: alpha

Simplify Bookkeeper installation and management in kubernetes using CRDs

Overview

The Bookkeeper Operator enable native Kubernetes deployment and management of Apache Bookkeeper cluster. View versions to see the Bookkeeper versions we provide support for. For now, release 4.11.1 is used as the installed version.

Prerequisites

The operator needs a kubernetes cluster with a version >= v1.16.0 . If you're using Helm to install the operator, your helm version must be >= 3.0.0 .

Also, Apache Bookkeeper needs Zookeeper for metadata storage; if you've not installed that already, you can use our Zookeeper Operator to set up an cluster.

Installation

The operator can be installed and upgrade by using our helm chart or directly using the manifest file. We however do recommend using the helm chart .

Via Helm

First you need to add the chart's repository to your repo list:

helm repo add monimesl https://monimesl.github.io/helm-charts
helm repo update

Create the operator namespace; we're doing this because Helm 3 no longer automatically create namespace.

kubectl create namespace bookkeeper-operator

Now install the chart in the created namespace:

helm install bookkeeper-operator monimesl/bookkeeper-operator -n bookkeeper-operator

If you don't have Helm or its required version, or you just want to try the operator quickly, this option is then ideal. We provide a manifest file per operator version. The below command will install the latest version.

Install the latest tag version:

 kubectl apply -f https://raw.githubusercontent.com/monimesl/bookkeeper-operator/main/deployments/manifest.yaml

Or install the other tagged version you want by using the url below; replace <tag-here> with the tag.

 kubectl apply -f https://raw.githubusercontent.com/monimesl/bookkeeper-operator/<tag-here>/deployments/manifest.yaml

Mind you, the command above will install a CRD and create a ClusterRole; so the user issuing the command must have cluster-admin privileges.

Confirm Installation

Before continuing, ensure the operator pod is ready

kubectl wait --for=condition=ready --timeout=60s pod -l app.kubernetes.io/name=bookkeeper-operator -n bookkeeper-operator

When it gets ready, you will see something like this:

pod/bookkeeper-operator-7975d7d66b-nh2tw condition met

If your wait timedout, try another wait.

Usage

Replace the below zookeeperUrl with your own.

Creating the simplest Bookkeeper cluster

Apply the following yaml to create the cluster with 3 bookies.

apiVersion: bookkeeper.monime.sl/v1alpha1
kind: BookkeeperCluster
metadata:
  name: cluster-1
  namespace: bookkeeper
spec:
  zkServers: "cluster-1-zk-headless.zookeeper.svc.cluster.local:2181"
  size: 3

Scale up the cluster from 3 to 5 bookies:

Apply the following yaml to update the cluster-1 cluster.

apiVersion: bookkeeper.monime.sl/v1alpha1
kind: BookkeeperCluster
metadata:
  name: cluster-1
  namespace: bookkeeper
spec:
  zkServers: "cluster-1-zk-headless.zookeeper.svc.cluster.local:2181"
  size: 5 # scale out