Cassandra container, Google Cloud and Kubernetes

I want to run Cassandra container in GCP and want to orchestrate the containers using Kubernetes.

I have a Cassandra image in my Docker Registry. Following the steps from the following tutorial, I have created a cluster and have Cassandra running on it. https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app#step_4_create_a_cluster

These are the steps I executed

  • get cassandra image – docker pull manuchadha25/codingjedi:3.11.4

  • check that the images exists locally- docker images. Also check that the image runs – docker run manuchadha25/cassandra:3.11.4

  • run on GCP console – export PROJECT_ID=project-id of google project

  • run on GCP console – gcloud auth configure-docker – maybe not required as I want to skip putting the image in container registry.

  • gcloud config set project $PROJECT_ID

  • gcloud config set

  • compute/zone compute-zone –num-nodes 2

  • gcloud container clusters

  • create codingjedi-cassandra-cluster –num-nodes=2

  • check cluster is up – gcloud compute instances list

  • kubectl create deployment my-cassandra-app –image=docker.io/manuchadha25/cassandra:3.11.4 • kubectl scale deployment codingjedi-cassandra-app –replicas=3

  • kubectl autoscale deployment my-cassandra-app –cpu-percent=80 –min=3 –max=5

  • check all is fine- kubectl get pods

  • kubectl expose deployment my-cassandra-app –name=codingjedi-cassandra-app-service
    –type=LoadBalancer –port 9042 –target-port 9042

  • check service is running – kubectl get service

  • copy external ip address and from laptop run cqlsh external-ip 9042. This should start cqlsh. I am able to connect with the cluster

My concern is that I have not provided any configuration anywhere which would make the different Cassandra nodes work together. So while I have created a Kubernetes cluster, I have not created a Cassandra cluster. Am I correct? I suppose I need to do more to make the nodes work as Cassandra cluster. How do I do that? I mean specify SEED_ADDRESS, LISTENING address, set an external data volume so that the data persists etc.?

Source: StackOverflow

LEAVE A COMMENT