Skip to content

feat: simplified content digest for restart controller - #481

Open
sweb wants to merge 8 commits into
mainfrom
feat/keyed-hash-for-restart-v2
Open

sweb wants to merge 8 commits into
mainfrom
feat/keyed-hash-for-restart-v2

Conversation

@sweb

@sweb sweb commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Description

Adds a keyed digest of the configmap / secret's content to use for detecting required restarts instead of using resourceVersion which gets bumped by e.g. metadata changes.

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • Code contains useful logging statements
  • (Integration-)Test cases added
  • Documentation added or updated. Follows the style guide.
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

@sweb
sweb force-pushed the feat/keyed-hash-for-restart-v2 branch 2 times, most recently from bf49a84 to 9efe76a Compare November 25, 2026 12:54
@sbernauer

Copy link
Copy Markdown
Member

A small feature idea:
The restarter could also write the uid/resourceVersion it last checked for each referenced ConfigMap/Secret into an observed.{configmap,secret}.restarter.stackable.tech/<name> annotation on the StatefulSet itself (not its Pod template). That would make "is my Pod up to date?" checkable again: If the observed annotation matches the object's current uid/resourceVersion and the Pod's annotation matches the template's, the Pod has the latest content. Yes, one can also shell into the Pod to check, but it's nice to get this info from k8s alone.

@sbernauer sbernauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Basically LGTM, I only recommend to remove the UID prefix

@sweb
sweb force-pushed the feat/keyed-hash-for-restart-v2 branch from 9efe76a to f2db3a4 Compare November 30, 2026 09:21
sweb and others added 4 commits November 30, 2026 10:23
@sweb
sweb marked this pull request as ready for review November 30, 2026 12:48
@sweb sweb moved this to Development: In Review in Stackable Engineering Nov 30, 2026

@sbernauer sbernauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Behavior, docs and tests LGTM now (I only didn't look at the code so far) 👍

Comment thread CHANGELOG.md
Comment on lines +13 to +14
the key of the content digests in the operator namespace. The permission is part of the
ClusterRole so that OLM installs receive it as well ([#481]).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the olm-thing is an implementation detail.

Suggested change
the key of the content digests in the operator namespace. The permission is part of the
ClusterRole so that OLM installs receive it as well ([#481]).
the key of the content digests in the operator namespace ([#481]).


Only a change of the content (`data` and `binaryData` of a ConfigMap, `data` of a Secret) counts as a change.
Writes that leave the content as it is, for example writes by third parties that only touch the labels, annotations or managed fields of the object, do not restart the Pods.
If you want to restart the Pods without changing any content, use `kubectl rollout restart statefulset \{name\}`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As we also have Deployments I think I would just omit this information.

Suggested change
If you want to restart the Pods without changing any content, use `kubectl rollout restart statefulset \{name\}`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

2 participants