Dear Christopher

I tried the answer and it works (at least the stopping bit). I still need to 
test persistence bit which to be honest might take time considering that I am 
more rubbish in K8S than Cassandra.  I had created an question on SO. Please 
feel free to provide your answer there.

https://stackoverflow.com/questions/64253051/temporarily-stopping-k8s-and-cassandra-cluster?noredirect=1#comment113633984_64253051

thanks
Manu

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

From: Christopher Bradford<mailto:bradfor...@gmail.com>
Sent: 08 October 2020 05:47
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Reducing no. of nodes to 0 without losing data

cass-operator has a parameter spec.stopped (
https://github.com/datastax/cass-operator/blob/master/operator/example-cassdc-yaml/cassandra-3.11.x/example-cassdc-full.yaml#L65)
 when set to true the underlying stateful sets are scaled down to 0 while 
keeping the persistent volumes. This allows you to reduce your k8s cluster size 
while not losing data. When you want to bring the cluster back up change the 
parameter back to false.

On Thu, Oct 8, 2020 at 12:40 AM Oleksandr Shulgin 
<oleksandr.shul...@zalando.de<mailto:oleksandr.shul...@zalando.de>> wrote:
On Thu, Oct 8, 2020 at 12:21 AM Manu Chadha 
<manu.cha...@hotmail.com<mailto:manu.cha...@hotmail.com>> wrote:
Hi

I have created a Cassandra cluster on Kubernetes using cass-operator on gcp. It 
is for my personal experimentation. To avoid incurring cost, I want to stop the 
cluster when I am not using it and start it when I need it without losing data. 
Is there a way to do so? Would setting number of size to 0 in 
example-cassdc-minimal.yaml stop the compute resources without losing data? If 
I change the size to 3 again later, would the existing data be picked?

Depending if the operator is going to accept the size as 0 at all, but most 
probably not with the following policy in your storage class, as in the 
example[1]:

reclaimPolicy: Delete

You need some persistent storage and a suitable reclaim policy.

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

Regards,
--
Alex
--

Christopher Bradford


Reply via email to