-
Notifications
You must be signed in to change notification settings - Fork 296
Support scale to zero rabbitMQ #1899
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
Support scale to zero rabbitMQ #1899
Conversation
Thanks for the PR. Just FYI, I will certainly test this soon, but need to finish some other things first |
Some initial feedback:
I think it should be set to False when scaled to 0.
(it is not expected to work as we discussed, but the stacktrace shouldn't be there, unless there's a good reason for it)
|
Hello @mkuratczyk,
Thank you for the feedback |
|
Hello @mkuratczyk ! I did some change. 1- Now the ALLREPLICASREADY is false when is scaled to Kind regards |
Thanks. My only additional feedback is that the error message is a bit cryptic ("Cluster Scale from zero to other replicas than before configured not supported; tried to scale cluster from 3 nodes to 5 nodes"). Perhaps "unsupported operation: when scaling from zero, you can only restore the previous number of replicas (3)"? @Zerpet @ansd @MirahImage any thoughts about this PR? |
Hello, i changed the logger. |
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.
Thank you for contributing this PR! I left some comments with feedback that I would like to be addressed before merging.
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 looking good 👍 I'm going to do some manual QA and I will merge afterwards. Thank you!
Thanks! |
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.
Nothing to report from the QA. It all worked as expected. Perhaps some may find surprising that AllReplicasReady
condition is set to false when scaled to zero, but I'm not against this behaviour.
This closes #1876
As talked with @Zerpet and @mkuratczyk in the issue we add some logic to allow scale to zero the rabbitMQ.
Also we add some logic to prevent the scale down when opt-out from zero.
We add new annotation
rabbitmq.com/before-zero-replicas-configured
to save the replicas configured before put rabbitMQ to zero.With this annotation we verify if the desired replicas after zero state are equals or greater than replicas before zero state.
If the replicas don't pass the verification it will works like
scaleDown
.Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed
Summary Of Changes
Additional Context
Local Testing
Please ensure you run the unit, integration and system tests before approving the PR.
To run the unit and integration tests:
You will need to target a k8s cluster and have the operator deployed for running the system tests.
For example, for a Kubernetes context named
dev-bunny
: