This Kubernetes operator automates the Cassandra operations such as deploying a new rack aware cluster, adding/removing nodes, configuring the C* and JVM parameters, upgrading JVM and C* versions, and many more...
What did you do?
Update casskop operator from v0.5.3 to latest version.
Since v1.0.0. statefulset for CassandraCluster has two containers "cassandra" and "backrest-sidecar".
What did you expect to see?
In the setup there are 2 cassandraclusters in one kubernetes cluster with same structure, it is was expected that both got updated.
What did you see instead? Under which circumstances?
One of the cassandraclusters got updated - structure changed 2 containers come up. Update for second didn't start.
Error observed in casskop logs:
time="2021-09-14T12:53:54Z" level=info msg="Template is different, the number of containers are not the same: len(sts1.Spec.Template.Spec.Containers) = 1, len(sts2.Sp
ec.Template.Spec.Containers) = 2" namespace=tf statefulset=tf-cassandra-config-dc1-rack1
time="2021-09-14T12:53:54Z" level=error msg="ensureCassandraStatefulSet Error: failed to create cassandra statefulset: statefulset already exists: &{{{%c(string=)} {%!c(string=) %!c(string=) %!c(string=) %!c(*int64=<nil>)} %!c(string=Failure) %!c(string=StatefulSet.apps \"tf-cassandra-config-dc1-rack1\" is invalid: s
pec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden) %!c(v1.StatusReason=Invalid) %!c(*v1.Sta
tusDetails=&{tf-cassandra-config-dc1-rack1 apps StatefulSet [{FieldValueForbidden Forbidden: updates to statefulset spec for fields other than 'replicas', 'template'
, and 'updateStrategy' are forbidden spec}] 0}) Ʀ}}c" cluster=tf-cassandra-config dc-rack=dc1-rack1
I did more debugging of this issue today, the error is not on casskop side. ResourceVersion of cassandracluster(which cannot be updated later) was updated externally.
Bug Report
What did you do? Update casskop operator from v0.5.3 to latest version. Since v1.0.0. statefulset for CassandraCluster has two containers "cassandra" and "backrest-sidecar".
What did you expect to see? In the setup there are 2 cassandraclusters in one kubernetes cluster with same structure, it is was expected that both got updated.
What did you see instead? Under which circumstances? One of the cassandraclusters got updated - structure changed 2 containers come up. Update for second didn't start. Error observed in casskop logs:
Environment
casskop version: 9c605183474830a2d921fde0923080fe4ba4038b
go version: 1.16
Cassandra version: docker.io/cassandra:3.11.6
Possible Solution Update BackRestSidecar struct with enabled field to allow disable of it.
Additional context As one of clusters got properly updated, this could be some limitation in logic, that second cluster was not processed as expected.