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

k8s: Restart redpanda after configmap changes #3262

Merged
merged 3 commits into from
Dec 20, 2021

Conversation

alenkacz
Copy link
Contributor

@alenkacz alenkacz commented Dec 14, 2021

Cover letter

After a user changes config in Cluster CR, the configmap is updated but we don't trigger restart of the redpanda pods so the new configuration does not get loaded until the pods are not restarted for some other reason. This adds an immediate restart to all redpanda nodes after the configmap changes. We achieve that by adding annotation with configmap hash to redpanda pods.

Fixes #2619

[ch-6518]

Release notes

Improvements

k8s: After cluster config is changed in CR, the redpanda pods will get restarted for the config to get used.

Beware that updating to this version of operator will always trigger one restart of your managed redpanda clusters after it's updated.

@alenkacz alenkacz force-pushed the av/configmap-hash-restart branch 6 times, most recently from 9ff4b75 to 36b6545 Compare December 16, 2021 15:18
@alenkacz alenkacz force-pushed the av/configmap-hash-restart branch 4 times, most recently from 0a40923 to 0c5eaf6 Compare December 17, 2021 14:38
@alenkacz alenkacz changed the title Av/configmap hash restart k8s: Restart redpanda after configmap changes Dec 17, 2021
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #6518: Restart node after configmap change.

@alenkacz alenkacz marked this pull request as ready for review December 17, 2021 15:45
@alenkacz alenkacz requested a review from a team as a code owner December 17, 2021 15:45
0x5d
0x5d previously approved these changes Dec 17, 2021
src/go/k8s/pkg/resources/statefulset.go Outdated Show resolved Hide resolved
Comment on lines 175 to 177
configMapHashGetter := func() (string, error) {
return configMapResource.GetConfigHash(ctx)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why Getter does not takes context as an input? Couldn't we pass configMapResource.GetConfigHash to statefulset resource?

RafalKorepta
RafalKorepta previously approved these changes Dec 20, 2021
Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGTM. One nit

0x5d
0x5d previously approved these changes Dec 20, 2021
Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGTM

@alenkacz alenkacz merged commit 3f933c2 into redpanda-data:dev Dec 20, 2021
@dotnwat dotnwat mentioned this pull request Feb 3, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing additionalConfiguration in CR does not restart redpanda and apply config
3 participants