-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix: disable reconciliation before scaling in SaaS #476
Conversation
8c2487f
to
366d41a
Compare
Hm can we add a test for this? |
@Zelldon
|
Hey @deepthidevaki did you checked already the pods tests? Like this https://github.com/zeebe-io/zeebe-chaos/blob/main/go-chaos/internal/pods_test.go#L68-L70 |
Yes. I'm already using the available helper methods.
|
Do you have your changes somewhere that I can take a look? |
There are no new changes. You can add the following test in
|
@deepthidevaki are we sure that we use the right API here? For me it looks like the GetScale returns some Scale object related to autoscaling https://github.com/kubernetes/api/blob/master/core/v1/types.go#L4774 |
I think so. It has worked fine during our manual chaos tests. And it is also running fine with our daily automated tests (because reconciliation is already paused by a previous experiment). |
Ok then I guess the only problem is that we have to setup the fake statefulset correctly |
@deepthidevaki I played a bit with it and did my changes here https://github.com/zeebe-io/zeebe-chaos/tree/ck-scaling-test Basically what we have to do is to use the update API if we want to test it properly. GetScale is not supported by the FakeClient. Furthermore, we have to update the statefulset which we create to set a correct replica value. The awaiting of the available replicas I moved out, since this makes it harder to test, the status is not updated with the fake clients. Likely we need to call this separate in the other places. I also saw in the backup commands that we call the disabling of reconcile separately from the scale (so before), we could also do this in our scale command. |
go-chaos/internal/statefulset.go
Outdated
@@ -55,6 +56,14 @@ func (c K8Client) ScaleZeebeCluster(replicas int) (int, error) { | |||
if err != nil { | |||
return 0, err | |||
} | |||
|
|||
if c.SaaSEnv { | |||
pauseError := c.PauseReconciliation() |
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.
I realized that we do this always for backups in the command already, I would be fine if we do this in the scale command as well and not here.
https://github.com/zeebe-io/zeebe-chaos/blob/main/go-chaos/cmd/backup.go#L95-L98
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.
Makes sense. But then I wouldn't test anything specific for this PR, as testing the whole command will be cumbersome.
366d41a
to
7deb437
Compare
Thanks @Zelldon for looking into it further. But I think, I will leave the testing out because not pausing is done in the command. So writing a unit test is more difficult. |
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.
Thanks @deepthidevaki 🚀 👍🏼
While testing E2E test with scaling, noticed that the current
zbchaos cluster scale
command do not work in SaaS because reconciliation is not disabled.