bookkeeper-operator

module
v0.1.1-rc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2020 License: Apache-2.0

README

Bookkeeper Operator

License GoDoc Build Status Go Report Version

Project status: alpha

The project is currently alpha. While no breaking API changes are currently planned, we reserve the right to address bugs and change the API before the project is declared stable.

Table of Contents

Overview

Bookkeeper A scalable, fault-tolerant, and low-latency storage service optimized for real-time workloads.

The Bookkeeper Operator manages Bookkeeper clusters deployed to Kubernetes and automates tasks related to operating a Bookkeeper cluster.

  • Create and destroy a Bookkeeper cluster
  • Resize cluster
  • Rolling upgrades

Requirements

  • Kubernetes 1.9+
  • Helm 2.10+
  • An existing Apache Zookeeper 3.5 cluster. This can be easily deployed using our Zookeeper operator

Quickstart

Install the Operator

Note: If you are running on Google Kubernetes Engine (GKE), please check this first.

Use Helm to quickly deploy a Bookkeeper operator with the release name pravega-bk.

$ helm install charts/bookkeeper-operator --name pr

Verify that the Bookkeeper Operator is running.

$ kubectl get deploy
NAME                          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE     AGE
pr-bookkeeper-operator           1         1         1            1          17s
Install a sample Bookkeeper cluster

If the BookKeeper cluster is expected to work with Pravega, we need to create a ConfigMap which needs to have the following values

KEY VALUE
PRAVEGA_CLUSTER_NAME Name of Pravega Cluster using this BookKeeper Cluster
WAIT_FOR Zookeeper URL

The name of this ConfigMap needs to be mentioned in the field envVars present in the BookKeeper Spec. For more details about this ConfigMap refer to this.

Helm can be used to install a sample Bookkeeper cluster.

$ helm install charts/bookkeeper --name pravega-bk --set zookeeperUri=[ZOOKEEPER_HOST]

where:

  • [ZOOKEEPER_HOST] is the host or IP address of your Zookeeper deployment (e.g. zookeeper-client:2181). Multiple Zookeeper URIs can be specified, use a comma-separated list and DO NOT leave any spaces in between (e.g. zookeeper-0:2181,zookeeper-1:2181,zookeeper-2:2181).

Check out the Bookkeeper Helm Chart for more a complete list of installation parameters.

Verify that the cluster instances and its components are being created.

$ kubectl get bk
NAME                   VERSION   DESIRED MEMBERS   READY MEMBERS      AGE
pravega-bk             0.7.0     3                 1                  25s

After a couple of minutes, all cluster members should become ready.

$ kubectl get bk
NAME                   VERSION   DESIRED MEMBERS   READY MEMBERS     AGE
pravega-bk             0.7.0     3                 3                 2m
$ kubectl get all -l bookkeeper_cluster=pravega-bk
NAME                                              READY   STATUS    RESTARTS   AGE
pod/pravega-bk-bookie-0                           1/1     Running   0          2m
pod/pravega-bk-bookie-1                           1/1     Running   0          2m
pod/pravega-bk-bookie-2                           1/1     Running   0          2m

NAME                                            TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)              AGE
service/pravega-bk-bookie-headless              ClusterIP   None          <none>        3181/TCP             2m

NAME                                            DESIRED   CURRENT     AGE
statefulset.apps/pravega-bk-bookie              3         3           2m

By default, a BookkeeperCluster is reachable using this kind of headless service URL for each pod:

http://pravega-bk-bookie-0.pravega-bk-bookie-headless.pravega-bk-bookie:3181
Scale a Bookkeeper cluster

You can scale Bookkeeper cluster by updating the replicas field in the BookkeeperCluster Spec.

Example of patching the Bookkeeper Cluster resource to scale the server instances to 4.

kubectl patch bk pravega-bk --type='json' -p='[{"op": "replace", "path": "/spec/replicas", "value": 4}]'
Upgrade a Bookkeeper cluster

Check out the upgrade guide.

Uninstall the Bookkeeper cluster
$ helm delete pravega-bk --purge
Uninstall the Operator

Note that the Bookkeeper clusters managed by the Bookkeeper operator will NOT be deleted even if the operator is uninstalled.

$ helm delete pr --purge

If you want to delete the Bookkeeper cluster, make sure to do it before uninstalling the operator. Also, once the Bookkeeper cluster has been deleted, make sure to check that the zookeeper metadata has been cleaned up before proceeding with the deletion of the operator. This can be confirmed with the presence of the following log message in the operator logs.

zookeeper metadata deleted
Manual installation

You can also manually install/uninstall the operator and Bookkeeper with kubectl commands. Check out the manual installation document for instructions.

Configuration

Check out the configuration document.

Development

Check out the development guide.

Releases

The latest Bookkeeper releases can be found on the Github Release project page.

Upgrade the Bookkeeper-Operator

Bookkeeper operator can be upgraded by modifying the image tag using

$ kubectl edit <operator deployment name>

Directories

Path Synopsis
cmd
pkg
apis/bookkeeper/v1alpha1
Package v1alpha1 contains API Schema definitions for the pravega v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=pravega.pravega.io Package v1alpha1 contains API Schema definitions for the pravega v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=pravega.pravega.io
Package v1alpha1 contains API Schema definitions for the pravega v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=pravega.pravega.io Package v1alpha1 contains API Schema definitions for the pravega v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=pravega.pravega.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL