Skip to content

K8s: Hash only the config data in checksum/* pod annotations - #3237

Open
DrFaust92 wants to merge 1 commit into
SeleniumHQ:trunkfrom
DrFaust92:fix/chart-checksum-churn
Open

K8s: Hash only the config data in checksum/* pod annotations#3237
DrFaust92 wants to merge 1 commit into
SeleniumHQ:trunkfrom
DrFaust92:fix/chart-checksum-churn

Conversation

@DrFaust92

Copy link
Copy Markdown
Contributor

Description

Adds a seleniumGrid.configMapOrSecretContentHash helper that hashes only the data/stringData of a rendered ConfigMap or Secret, and switches all 31 checksum/* pod annotations to it — hub, router, distributor, session-map, session-queue, event-bus and the node pod template.

Motivation and Context

The annotations hashed the whole rendered manifest, and metadata.labels carry the chart labels, which change on every chart version bump. Every component pod therefore restarted on helm upgrade even when no configuration had changed — for the nodes that means dropping live sessions for nothing.

After this change a chart-version-only upgrade leaves the checksums untouched, while a real config change (for example global.seleniumGrid.logLevel) still changes them and restarts the pods. Upgrading to the release containing this change restarts the pods once, as the annotation values change.

The same fix was recently made in the argo-cd chart (argoproj/argo-helm#4044), and the loki chart uses the same data-only hashing.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

The checksum/* annotations hashed the entire rendered ConfigMap or Secret,
whose metadata.labels include the chart labels. Those change on every chart
version bump, so every Grid component was restarted on upgrade even when no
configuration had changed.

Add a seleniumGrid.configMapOrSecretContentHash helper that hashes only the
data and stringData sections, and use it for all 31 checksum/* annotations.

Signed-off-by: Ilia Lazebnik <ilia.lazebnik@gmail.com>
@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

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.

1 participant