Skip to content

[stable/redis-ha] Switch to standard labels - #400

Open
chernetskyi wants to merge 4 commits into
DandyDeveloper:masterfrom
chernetskyi:standard-labels
Open

chernetskyi wants to merge 4 commits into
DandyDeveloper:masterfrom
chernetskyi:standard-labels

Conversation

@chernetskyi

@chernetskyi chernetskyi commented May 4, 2026 •

Copy link
Copy Markdown

What this PR does / why we need it:

Adds standard Kubernetes and Helm labels alongside the existing labels in redis-ha.

grafana-agent, for example, already follows those.

Legacy labels and selectors remain unchanged, preserving compatibility with existing installations and rolling upgrades.

Special notes for your reviewer:

Label maps are merged before rendering to avoid duplicate YAML keys. Custom values override standard label defaults, while labels required by existing selectors retain their chart values.

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [stable/mychartname])

chernetskyi and others added 2 commits May 4, 2026 17:23
Signed-off-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
@DandyDeveloper

DandyDeveloper commented Jun 15, 2026 •

Copy link
Copy Markdown
Owner

@chernetskyi This is great, but this will break upgrades from users:

level=INFO msg="warning: skipped value for redis-ha.affinity: Not a table."
level=WARN msg="upgrade failed" name=redis error="server-side apply failed for object default/redis-redis-ha-haproxy apps/v1, Kind=Deployment: Deployment.apps \"redis-redis-ha-haproxy\" is invalid: spec.selector: Invalid value: {\"matchLabels\":{\"app.kubernetes.io/component\":\"haproxy\",\"app.kubernetes.io/instance\":\"redis\",\"app.kubernetes.io/name\":\"redis-ha-haproxy\"}}: field is immutable && server-side apply failed for object default/redis-redis-ha-server apps/v1, Kind=StatefulSet: StatefulSet.apps \"redis-redis-ha-server\" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'revisionHistoryLimit', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden"
Error: UPGRADE FAILED: server-side apply failed for object default/redis-redis-ha-haproxy apps/v1, Kind=Deployment: Deployment.apps "redis-redis-ha-haproxy" is invalid: spec.selector: Invalid value: {"matchLabels":{"app.kubernetes.io/component":"haproxy","app.kubernetes.io/instance":"redis","app.kubernetes.io/name":"redis-ha-haproxy"}}: field is immutable && server-side apply failed for object default/redis-redis-ha-server apps/v1, Kind=StatefulSet: StatefulSet.apps "redis-redis-ha-server" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'revisionHistoryLimit', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

It's a pretty significant break as people have to delete the STS and recreate which will bring down the clusters.

@chernetskyi

Copy link
Copy Markdown
Author

@DandyDeveloper Indeed! I see two solutions:

  1. Keep old labels, use them for selectors. Add new labels unconditionally. Just like the current solution in the PR, this will cause issues in case the new labels were added by any other means.
  2. Add variables to enable/disable old/new labels. Prefer old labels for selectors when enabled.

WDYT?

Signed-off-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
@chernetskyi

Copy link
Copy Markdown
Author

@DandyDeveloper I've added the new labels alongside the old ones, please take a look.

This branch has not been deployed

No 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.

2 participants