Difficulty: Intermediate
Estimated Time: 20 minutes

Simplify your ops-life by using the Cassandra Kubernetes Operator to run your cluster!

In this scenario, we'll learn how to:

  • Create a Kubernetes cluster
  • Install the Cassandra Kubernetes operator
  • Create a single node cluster
  • Create a keyspace and table with data in the cluster
  • Scale up the Cassandra cluster to two nodes using Kubernetes

With Kubernetes and this operator, your Cassandra life just got a lot easier!

ver 0.007

In this scenario, we learned how to:

  • Create a Kubernetes cluster
  • Install the Cassandra Kubernetes operator
  • Create a single node cluster
  • Create a keyspace and table with data in the cluster
  • Scale up the Cassandra cluster to two nodes using Kubernetes

We've only scratched the surface or the Cassandra Kubernetes operator in this scenario. You can use the operator for so many other things.

Check out the docs here for more info.

Deploying and maintaining a Cassandra cluster never looked easier!

DataStax Kubernetes Operator for Apache Cassandra™

Step 1 of 5

Create a Kubernetes Cluster

In this step we'll create a Kubernetes cluster consisting of the master node and some worker nodes. We'll use KinD to create the Kubernetes cluster named cassandra-kub-cluster.

What is KinD? KinD is Kubernetes running inside a Docker container. As you know, most people use Kubernetes to manage systems of Docker containers. So, KinD is a Docker container that runs Kubernetes to manage other Docker containers - it's a bit recursive.

We use KinD so we can create a many-node Kubernetes cluster on a single machine. KinD is great because it's relatively light-weight, easy to install and easy to use.

We've already installed KinD for you. For your reference, here are the commands we used to install KinD.
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64 chmod +x ./kind mv ./kind /usr/local/bin/kind
kind create cluster --name cassandra-kub-cluster --config kind-config.yaml

You can check out the KinD yaml file we used to create the Kubernetes cluster:

Open kind-config.yaml

Let's verify we created the Kubernetes cluster.

kind get clusters

Notice that when reporting the clusters, KinD reports the name we used to create the cluster. But, when you reference the cluster from kubectl, you need to prepended kind- to the front of our cluster name (e.g., kind-cassandra-kub-cluster).

Finally, let's connect kubectl to our newly created Kubernetes cluster.

kubectl cluster-info --context kind-cassandra-kub-cluster

Woot! Now we have a Kubernetes cluster and we can talk to it using kubectl.