Skip to content

Conversation

t-persson
Copy link
Collaborator

Applicable Issues

Description of the Change

By adding or updating an annotation to the spec Kubernetes will automatically recreate the deployments and statefulsets causing the pods to restart and get the new configurations. This way of doing it is the same way as kubectl rollout restart.

I've not been able to test this yet since my local environment is busted at the moment so this change may not work yet

Alternate Designs

None that I could think of.

Possible Drawbacks

The one thing I thought of (and am going to test) is that we might get stuck in a reconcile loop. I don't know how or why but we've had these loops before and we need to verify that this change does not cause any.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Tobias Persson tobias.persson@axis.com

By adding or updating an annotation to the spec Kubernetes
will automatically recreate the deployments and statefulsets
causing the pods to restart and get the new configurations.
This way of doing it is the same way as kubectl rollout restart.
@t-persson t-persson requested a review from a team as a code owner April 8, 2025 07:25
@t-persson t-persson requested review from fredjn and andmat900 and removed request for a team April 8, 2025 07:25
Setting the annotation on the deployment/statefulset did not
automatically re-deploy the pods. Setting it on the podspec
does.
@t-persson t-persson merged commit 724e6d3 into eiffel-community:main Apr 9, 2025
@t-persson t-persson deleted the restart-on-config-changes branch April 9, 2025 06:11
fredjn pushed a commit to fredjn/etos that referenced this pull request Aug 5, 2025
…iffel-community#398)

* Restart deployments and statefulsets if configurations have changed

By adding or updating an annotation to the spec Kubernetes
will automatically recreate the deployments and statefulsets
causing the pods to restart and get the new configurations.
This way of doing it is the same way as kubectl rollout restart.

* Set the annotation on the pod instead

Setting the annotation on the deployment/statefulset did not
automatically re-deploy the pods. Setting it on the podspec
does.
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.

2 participants