-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi rack support #192
Multi rack support #192
Conversation
Signed-off-by: Alex Lourie <djay.il@gmail.com>
* Change proj structure to follow the same pattern for CDC/Backup controllers * Refactor code for better naming and convenience * Add StatefulSet handling * Add stub backup code * Add backupType field to BackupOperation on java/golang sidecar. Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
* Support multi-racks * Probably doesn't support scaling down properly Signed-off-by: Alex Lourie <djay.il@gmail.com>
I'll squash this when merging, don't worry |
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
…assandra-operator into multiRack
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Should be ok now for deploying and scaling, as well as some basic e2e testing. |
Some general comments:
|
} | ||
|
||
// fine, so we have a mismatch. Will seek to reconcile. | ||
rackSpec, err := getRackSpec(rctx, request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into this more -- we only reconcile one Rack per reconcile? What triggers the additional reconciles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we now only reconcile one rack per reconcile. You are correct that at the moment it doesn't support config changes/upgrades, but scaling up/down will work because k8 will reconcile until the total number of pods matches the spec.
Thanks @zegelin.
Also, at the moment all this wouldn't support upgrades or conf changes (such as different image url/version or hardware changes or whatever), as if there is no change in replica numbers, nothing will be done. I will remove that check and will see how much work needed for taking care of that (considering that for some of those changes we would need rolling restarts of the C* containers). Should we support it for the "first cut"? |
Signed-off-by: Alex Lourie <djay.il@gmail.com>
@@ -12,4 +12,7 @@ do | |||
done | |||
) | |||
|
|||
# Update the rack settings from env | |||
sed -i'' "s/rack=.*$/rack=${CASSANDRA_RACK}/g" /etc/cassandra/cassandra-rackdc.properties | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just one possible solution, to see if it works. It does.
@@ -46,6 +46,9 @@ spec: | |||
type: integer | |||
prometheusSupport: | |||
type: boolean | |||
racks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we know which racks the c* cluster is using? We need to make sure we can assign to the correct user defined fault domains in Kubernetes. See https://kubernetes.io/docs/setup/best-practices/multiple-zones/
Each stateful set should apply labels via the pod template to assign which failure domain the stateful set is applied to. See https://kubernetes.io/docs/reference/kubernetes-api/labels-annotations-taints/#failure-domainbetakubernetesiozone
In terms of the CRD definition, the user should at a minimum be able to specify which failure domains are available to the cluster. This way we can create the right number of statefulsets and ensure the correct labels are applied to them.
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
@z @benbromhead the last version seems to be a working model with 1 configmap and stateful set per rack. The rack selection is performed based on user input and used as label selectors on the nodes, distribution is calculated automatically and applied separately. The rack scaleup/decommission is performed in a round-robin algorithm. |
after merge conflict resolved, ready to merge. |
…assandra-operator into multiRack
Signed-off-by: Alex Lourie <djay.il@gmail.com>
Signed-off-by: Alex Lourie <djay.il@gmail.com>
…assandra-operator into multiRack
Signed-off-by: Alex Lourie <djay.il@gmail.com>
merge conflicts resolved again, can squash and merge. |
@alourie can you rebase and I'll merge |
Due to PR for secrets etc |
…assandra-operator into multiRack
Signed-off-by: Alex Lourie <djay.il@gmail.com>
first mvp
Seems to be working ok for creating clusters, should be ok for scaling up, but probably not for scaling down