首页 » Andorid » 临时分类 » 正文

cassandra-operator

Cassandra operator

Build CircleCI

Project status: alpha

Major planned features have yet to be completed and API changes are currently planned, we reserve the right to address bugs and API changes in a backwards incompatible way before the project is declared stable. See upgrade guide for safe upgrade process.

Currently user facing Cassandra cluster objects are created as Kubernetes Custom Resources, however, taking advantage of User Aggregated API Servers to improve reliability, validation and versioning may be undertaken. The use of Aggregated API should be minimally disruptive to existing users but may change what Kubernetes objects are created or how users deploy the operator.

We expect to consider the Cassandra operator stable soon; backwards incompatible changes will not be made once the project reaches stability.

Overview

The Cassandra operator manages Cassandra clusters deployed to Kubernetes and automates tasks related to operating an Cassandra cluster.

There are more spec examples on setting up clusters with backup, restore, and other configurations.

Read Best Practices for more information on how to better use Cassandra operator.

Read RBAC docs for how to setup RBAC rules for Cassandra operator if RBAC is in place.

Read Developer Guide for setting up development environment if you want to contribute.

Read Backup and Restore Guide for backing up and restoring Cassandra clusters managed by the operator.

See the Resources and Labels doc for an overview of the resources created by the Cassandra-operator.

Requirements

  • Kubernetes 1.8+
  • Cassandra 3.11+

Deploy Cassandra operator

See instructions on how to install/uninstall Cassandra operator .

Create and destroy an Cassandra cluster

$ kubectl create -f example/common/test.yaml

A 3 member Cassandra cluster will be created.

$ kubectl get pods
NAME                                    READY     STATUS    RESTARTS   AGE
cassandra-operator7-5d58bc7874-t85dt    1/1       Running   0          18h
test-dc-0                               1/1       Running   0          1m
test-dc-1                               1/1       Running   0          1m
test-dc-2                               1/1       Running   0          1m

See client service for how to access Cassandra clusters created by operator.

Destroy Cassandra cluster:

$ kubectl delete -f example/common/test.yaml

Resize an Cassandra cluster

Create an Cassandra cluster, if you haven't already:

$ kubectl apply -f example/common/test.yaml

In example/common/test.yaml the initial cluster size is 3. Modify the file and change replicas from 3 to 5.

apiVersion: stable.instaclustr.com/v1
kind: CassandraDataCenter
metadata:
  name: test-dc
spec:
  replicas: 5
  image: "gcr.io/cassandra-operator/cassandra:latest"

Apply the size change to the cluster CR:

$ kubectl apply -f example/common/test.yaml

The Cassandra cluster will scale to 5 members (5 pods):

$ kubectl get pods
NAME                            READY     STATUS    RESTARTS   AGE
test-dc-0                       1/1       Running   0          1m
test-dc-1                       1/1       Running   0          1m
test-dc-2                       1/1       Running   0          1m
test-dc-3                       1/1       Running   0          1m
test-dc-4                       1/1       Running   0          1m

Similarly we can decrease the size of cluster from 5 back to 3 by changing the size field again and reapplying the change.

apiVersion: stable.instaclustr.com/v1
kind: CassandraDataCenter
metadata:
  name: test-dc
spec:
  replicas: 3
  image: "gcr.io/cassandra-operator/cassandra:latest"

Then apply the changes

$ kubectl apply -f example/common/test.yaml

Limitations

  • This operator is currently a work in progress and breaking changes are landing in master all the time until we reach our initial release. Here be dragons!
  • Do not use this in production... yet
  • Please see the Instaclustr supported projects page for the Enterprise support status of the Cassandra Operator.
下载 (0)

发表评论