Closed srteam2020 closed 3 years ago
@srteam2020 i wonder if it doesn't make more sense to update the helper to create Cassandra cluster to add a uid on the object if it's not there by default. Wdyt ? That would need we don't need the uid at all in our deployment files like we will do on a real k8s cluster. In the meantime integration tests are running
@srteam2020 i wonder if it doesn't make more sense to update the helper to create Cassandra cluster to add a uid on the object if it's not there by default. Wdyt ? That would need we don't need the uid at all in our deployment files like we will do on a real k8s cluster. In the meantime integration tests are running
Yes, that definitely makes more sense to me, I'll revise that accordingly.
@srteam2020 I'll soon make a new release. It would be great if you can finish that one in order to include it. Thanks ! Lmk if you need some help
@cscetbon Hi, I've removed the empty UID checking accordingly, I think now it is ready to go.
Thank you @srteam2020 for your first contribution ! đź‘Ź
@srteam2020 we discovered that this PR causes issues for users upgrading from 1.1.3-release to 1.1.4-release because of that label that is missing. We need to come up with the right way to do the upgrade. A big issue is that statefulsets can't be updated because of
...
# * spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and
'updateStrategy' are forbidden
It's needed to add the new label you've added and it's a problem...
From the error msg, it seems that the label (cassandracluster-uid
) we added was updated into some field of Spec
, but normally, we only suppose it to be updated to ObjectMeta.Labels
.
Looking into the code which constructs statefulset, I found the label was also set into spec.selector
which I believe cause the problem.
I think to add some filter here to the labels to only set cassandracluster-uid
to statefulset’s ObjectMeta.Labels
can fix the issue. What do you think @cscetbon .
That might work. I was going to rollback the change but that could be the answer. It still means a rolling restart during an upgrade but that should be ok. Can you test such a change and check an upgrade from 1.1.3 ?
What's in this PR?
Label the cassandracluster uid to the PVC and checks the uid before deleting PVC.
Checklist