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

Force pod restarts on config map changes #1094

Merged
merged 0 commits into from Nov 8, 2023
Merged

Force pod restarts on config map changes #1094

merged 0 commits into from Nov 8, 2023

Conversation

snoshy
Copy link
Contributor

@snoshy snoshy commented Nov 8, 2023

currently, pods in the sematic server deployment don't restart when the configmap associated with them changes. on every helm upgrade, helm does rerun the migration pod with the updated configmap values, but the deployment pods themselves stick around unchanged. this is a known issue in k8s: kubernetes/kubernetes#22368

to remove any confusion here, we take a checksum of all of the values in the helm chart and apply the checksum as an annotation on the pods. with this, k8s will forcibly refresh the pods on any change to the helm values. while that is a bit of overkill (not all changes technically require the pods to restart), it is far less error-prone than the status quo.

also documented as a helm tip here: https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments

@snoshy snoshy requested a review from a team November 8, 2023 21:14
Copy link
Contributor

@tscurtu tscurtu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :shipit:

Copy link
Member

@augray augray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool trick!

@snoshy snoshy added this pull request to the merge queue Nov 8, 2023
Merged via the queue into main with commit 5d081c9 Nov 8, 2023
8 checks passed
@snoshy snoshy deleted the sash/cmsum branch November 8, 2023 22:09
@pwais
Copy link

pwais commented Nov 8, 2023

thank you so much @snoshy i ran into this as well!

neutralino1 pushed a commit that referenced this pull request Apr 3, 2024
currently, pods in the sematic server deployment don't restart when the
configmap associated with them changes. on every helm upgrade, helm
_does_ rerun the migration pod with the updated configmap values, but
the deployment pods themselves stick around unchanged. this is a known
issue in k8s: kubernetes/kubernetes#22368

to remove any confusion here, we take a checksum of all of the values in
the helm chart and apply the checksum as an annotation on the pods. with
this, k8s will forcibly refresh the pods on _any_ change to the helm
values. while that is a bit of overkill (not all changes technically
require the pods to restart), it is far less error-prone than the status
quo.

also documented as a helm tip here:
https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments
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.

None yet

4 participants