You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Manu Chadha <ma...@hotmail.com> on 2020/06/24 06:17:35 UTC

Cassandra container, Google Cloud and Kubernetes

Hi

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 codingjedi-cassandra-app --image=docker.io/manuchadha25/cassandra:3.11.4
  *   kubectl scale deployment codingjedi-cassandra-app --replicas=3
  *   kubectl autoscale deployment codingjedi-cassandra-app --cpu-percent=80 --min=3 --max=5
  *   check all is fine- kubectl get pods
  *   kubectl expose deployment codingjedi-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 from my laptop using the external IP. – cqlsh external-ip 9042

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.?

Regards
Manu


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


Re: Cassandra container, Google Cloud and Kubernetes

Posted by Erick Ramirez <er...@datastax.com>.
>
> I have started looking at Cass. Referring to the release notes, does Cass
> support 3.11.4?
>

The cass-operator only supports C* 3.11.6 [1].

C* 3.11.4 is over a year old now and there are some important fixes in
3.11.5 and 3.11.6 that I think should be sufficient motivation to use
3.11.6. If it helps, I'll single these 2 out:
- CASSANDRA-14096 Repair merkle tree size causes OOM [2]
- CASSANDRA-15035 Fix bad UDT sstable metadata serialization headers
written by C* 3.0 on upgrade and in sstablescrub [3]

Cheers!

[1]
https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorFaqs.html

[2] https://issues.apache.org/jira/browse/CASSANDRA-14096
[3] https://issues.apache.org/jira/browse/CASSANDRA-15035

RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
Hi Erick

It might be useful if the answer from Willrof is added to your Wiki. It solved my problem and could be very useful to people wanting to run Cass-Operator. Please check - https://stackoverflow.com/questions/62651374/how-do-i-access-my-cassandra-kubernetes-cluster-from-outside-the-cluster

Thanks
manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 30 June 2020 01:29
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It's really a Kubernetes question but the TL;DR is you need to expose the services of your k8s cluster to the outside world.

Have a look at this blog post to get you started -- http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/. Cheers!


Re: Cassandra container, Google Cloud and Kubernetes

Posted by Erick Ramirez <er...@datastax.com>.
It's really a Kubernetes question but the TL;DR is you need to expose the
services of your k8s cluster to the outside world.

Have a look at this blog post to get you started --
http://alesnosek.com/blog/2017/02/14/accessing-kubernetes-pods-from-outside-of-the-cluster/.
Cheers!

>

RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
In continuation to my previous message, I can see the nodes are up on the GCP dashboard. I can ping the external IP from my laptop but when I run `cqlsh external_ip 9042` then the connection fails.

How do I go about connecting the K8s/Cassandra cluster to outside work so that my web application can access it.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<ma...@hotmail.com>
Sent: 29 June 2020 22:02
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: christopher.bradford@datastax.com<ma...@datastax.com>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Hi

I have started using Cass-Operator and the setup worked like a charm! https://github.com/datastax/cass-operator

I have an issue though. My cluster is up and running on GCP. But how do I access it from my laptop? Sorry, new to Kubernetes so do not know how to access the cluster from outside?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<ma...@hotmail.com>
Sent: 25 June 2020 07:48
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: christopher.bradford@datastax.com<ma...@datastax.com>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Thanks Chris. This is useful.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<ma...@gmail.com>
Sent: 25 June 2020 07:46
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: christopher.bradford@datastax.com<ma...@datastax.com>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as there is no integrated solution for repairs or backup / restore functionality at this time. If you are comfortable managing these operational tasks either manually or through other complementary tools (Reaper and Medusa come to mind) then there should not be anything blocking you from using this operator. As Erick mentioned there are other operators available that may or may not handle these tasks for you and should be considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha <ma...@hotmail.com>> wrote:
Thanks. One more concern popped up. It seems Cass is not recommended for production. However, I need this specifically for production. What is your take on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology Preview only. Using Cass Operator with Cassandra is not recommended at this time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 3.11.6 so you don't need to rewrite your code. Cheers!





RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
Hi

I have started using Cass-Operator and the setup worked like a charm! https://github.com/datastax/cass-operator

I have an issue though. My cluster is up and running on GCP. But how do I access it from my laptop? Sorry, new to Kubernetes so do not know how to access the cluster from outside?

Thanks
Manu

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Manu Chadha<ma...@hotmail.com>
Sent: 25 June 2020 07:48
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: christopher.bradford@datastax.com<ma...@datastax.com>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Thanks Chris. This is useful.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<ma...@gmail.com>
Sent: 25 June 2020 07:46
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: christopher.bradford@datastax.com<ma...@datastax.com>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as there is no integrated solution for repairs or backup / restore functionality at this time. If you are comfortable managing these operational tasks either manually or through other complementary tools (Reaper and Medusa come to mind) then there should not be anything blocking you from using this operator. As Erick mentioned there are other operators available that may or may not handle these tasks for you and should be considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha <ma...@hotmail.com>> wrote:
Thanks. One more concern popped up. It seems Cass is not recommended for production. However, I need this specifically for production. What is your take on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology Preview only. Using Cass Operator with Cassandra is not recommended at this time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 3.11.6 so you don't need to rewrite your code. Cheers!




RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
Thanks Chris. This is useful.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Christopher Bradford<ma...@gmail.com>
Sent: 25 June 2020 07:46
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Cc: christopher.bradford@datastax.com<ma...@datastax.com>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as there is no integrated solution for repairs or backup / restore functionality at this time. If you are comfortable managing these operational tasks either manually or through other complementary tools (Reaper and Medusa come to mind) then there should not be anything blocking you from using this operator. As Erick mentioned there are other operators available that may or may not handle these tasks for you and should be considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha <ma...@hotmail.com>> wrote:
Thanks. One more concern popped up. It seems Cass is not recommended for production. However, I need this specifically for production. What is your take on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology Preview only. Using Cass Operator with Cassandra is not recommended at this time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 3.11.6 so you don't need to rewrite your code. Cheers!



Re: Cassandra container, Google Cloud and Kubernetes

Posted by Christopher Bradford <br...@gmail.com>.
Hi Manu,

OSS Cassandra support in cass-operator is marked as a Technology Preview as
there is no integrated solution for repairs or backup / restore
functionality at this time. If you are comfortable managing these
operational tasks either manually or through other complementary tools
(Reaper and Medusa come to mind) then there should not be anything blocking
you from using this operator. As Erick mentioned there are other operators
available that may or may not handle these tasks for you and should be
considered.

~Chris

Christopher Bradford



On Thu, Jun 25, 2020 at 2:39 AM Manu Chadha <ma...@hotmail.com> wrote:

> Thanks. One more concern popped up. It seems Cass is not recommended for
> production. However, I need this specifically for production. What is your
> take on this?
>
>
>
> “
>
> The use of Cass Operator with Cassandra 3.11.6 is intended as a *Technology
> Preview* only. Using Cass Operator with Cassandra is not recommended at
> this time for production environments.
>
> “
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Erick Ramirez <er...@datastax.com>
> *Sent: *25 June 2020 07:25
> *To: *user@cassandra.apache.org
> *Subject: *Re: Cassandra container, Google Cloud and Kubernetes
>
>
>
> It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but
> is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my
> driver code in the application.
>
>
>
> There isn't a breaking change from a driver perspective between 3.11.4 and
> 3.11.6 so you don't need to rewrite your code. Cheers!
>
>
>

RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
Thanks. One more concern popped up. It seems Cass is not recommended for production. However, I need this specifically for production. What is your take on this?

“
The use of Cass Operator with Cassandra 3.11.6 is intended as a Technology Preview only. Using Cass Operator with Cassandra is not recommended at this time for production environments.
“

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 25 June 2020 07:25
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver code in the application.

There isn't a breaking change from a driver perspective between 3.11.4 and 3.11.6 so you don't need to rewrite your code. Cheers!


Re: Cassandra container, Google Cloud and Kubernetes

Posted by Erick Ramirez <er...@datastax.com>.
>
> It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but
> is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my
> driver code in the application.
>

There isn't a breaking change from a driver perspective between 3.11.4 and
3.11.6 so you don't need to rewrite your code. Cheers!

RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
Hi Erick

It seems that 3.11.4 is not supported. I am happy to move up to 3.11.6 but is 3.11.6 backward compatible with 3.11.4? I don’t want start changing my driver code in the application.

“
Cass Operator release 1.2.0 is compatible with Apache Cassandra 3.11.6 and DSE 6.8.0+. Cass Operator is not supported and will not function with prior releases of Cassandra or DSE. Furthermore, this release of Cass Operator is compatible only with specific Cassandra and DSE docker images that are hosted in the DataStax Docker Hub repository. Prior (pre-release) DataStax Labs releases of DSE 6.8.0 will not function with the current Cass Operator.”

Thanks
Manu


From: Manu Chadha<ma...@hotmail.com>
Sent: 25 June 2020 07:12
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: RE: Cassandra container, Google Cloud and Kubernetes

Dear Erick

I have started looking at Cass. Referring to the release notes, does Cass support 3.11.4?

https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorReleaseNotes.html

regards
Manu



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 24 June 2020 12:37
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

This isn't a direct answer to your questions but you might be interested in the Kubernetes operator for Apache Cassandra [1] from DataStax. You can use the cass-operator to deploy a C* 3.11.6 image to your Kubernetes cluster. The docs are available here [2].

FWIW there are several other published operators from the likes of Orange [3] and Instaclustr [4]. The authors have come together in the community to contribute their work and "combine" them into an "official" operator for Cassandra. (I'm sure someone will correct me if I've made any misrepresentation). Cheers!

[1] https://github.com/datastax/cass-operator
[2] https://docs.datastax.com/en/cass-operator/doc/
[3] https://github.com/Orange-OpenSource/casskop
[4] https://github.com/instaclustr/cassandra-operator



RE: Cassandra container, Google Cloud and Kubernetes

Posted by Manu Chadha <ma...@hotmail.com>.
Dear Erick

I have started looking at Cass. Referring to the release notes, does Cass support 3.11.4?

https://docs.datastax.com/en/cass-operator/doc/cass-operator/cassOperatorReleaseNotes.html

regards
Manu



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Erick Ramirez<ma...@datastax.com>
Sent: 24 June 2020 12:37
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Cassandra container, Google Cloud and Kubernetes

This isn't a direct answer to your questions but you might be interested in the Kubernetes operator for Apache Cassandra [1] from DataStax. You can use the cass-operator to deploy a C* 3.11.6 image to your Kubernetes cluster. The docs are available here [2].

FWIW there are several other published operators from the likes of Orange [3] and Instaclustr [4]. The authors have come together in the community to contribute their work and "combine" them into an "official" operator for Cassandra. (I'm sure someone will correct me if I've made any misrepresentation). Cheers!

[1] https://github.com/datastax/cass-operator
[2] https://docs.datastax.com/en/cass-operator/doc/
[3] https://github.com/Orange-OpenSource/casskop
[4] https://github.com/instaclustr/cassandra-operator


Re: Cassandra container, Google Cloud and Kubernetes

Posted by Erick Ramirez <er...@datastax.com>.
This isn't a direct answer to your questions but you might be interested in
the Kubernetes operator for Apache Cassandra [1] from DataStax. You can use
the cass-operator to deploy a C* 3.11.6 image to your Kubernetes cluster.
The docs are available here [2].

FWIW there are several other published operators from the likes of Orange
[3] and Instaclustr [4]. The authors have come together in the community to
contribute their work and "combine" them into an "official" operator for
Cassandra. (I'm sure someone will correct me if I've made any
misrepresentation). Cheers!

[1] https://github.com/datastax/cass-operator
[2] https://docs.datastax.com/en/cass-operator/doc/
[3] https://github.com/Orange-OpenSource/casskop
[4] https://github.com/instaclustr/cassandra-operator

>