Skip to content
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

Set the DeploymentStrategy to Recreate #64

Closed
wants to merge 1 commit into from

Conversation

jsanda
Copy link
Contributor

@jsanda jsanda commented Aug 18, 2021

Fixes #63

@sonarcloud
Copy link

sonarcloud bot commented Aug 18, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jsanda
Copy link
Contributor Author

jsanda commented Aug 18, 2021

On a new install this gives the desired behavior. I updated the podTemplateSpec of the Deployment and the current replica was deleted before a new one was created.

I also tested by installed k8ssandra 1.0 and then upgrading with changes in k8ssandra/k8ssandra#1044. The update was rolled out and then the operator changed the deployment strategy. We build the desired deployment, compare its resource hash against the actual deployment, and if they differ we copy several properties from the desired deployment into the actual deployment. In the case of the upgrade both the podTemplateSpec and deploymentStrategy are updated at the same time, and based on my testing it appears that the deployment controller first rolls out the update and then updates the deploymentStrategy.

I suppose we could first check to see what the deployment strategy is. If it is RollingUpdate (the default) then we change it to Recreate, and then apply a patch. If the patch is successful we then proceed with the rest of the updates.

@burmanm what do you think about the approach? I'd like a second set of eyes on this.

@burmanm
Copy link
Contributor

burmanm commented Aug 18, 2021

In Reaper's case this workaround will probably work just fine as long as there's a single instance limitation.

@jsanda jsanda closed this Oct 5, 2021
@jsanda jsanda deleted the update-strategy branch October 5, 2021 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reaper upgrade can cause schema migration exception
2 participants