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

[ISSUE] global.labels Used in Both matchLabels and metadata.labels #2699

Open
drodriguez-305 opened this issue Dec 17, 2024 · 2 comments
Open
Labels
kind/issue Unidentified issue, it could be a bug, misconfig, or anything in between platform/aws Issues related to AWS platform/gcp Issues related to GCP support Marks an issue as related to a customer support request (don't edit the lable)

Comments

@drodriguez-305
Copy link
Contributor

Describe the issue:

related to: https://jira.camunda.com/browse/SUPPORT-24909

The global.labels field in the Camunda Platform Helm chart is being applied to both metadata.labels and matchLabels (selectors). This behavior is problematic because matchLabels are immutable, and dynamic or environment-specific labels cannot be safely updated in subsequent deployments.

Actual behavior:

When labels are defined in global.labels, they are applied to:

  • metadata.labels (which is expected and allowed to change).
  • matchLabels (used for Kubernetes selectors, which are immutable).

Expected behavior:

How to reproduce:

Logs:

Environment:

Please note: Without the following info, it's hard to resolve the issue and probably it will be closed.

  • Platform:
  • Helm CLI version:
  • Chart version:
  • Values file:
@drodriguez-305 drodriguez-305 added kind/issue Unidentified issue, it could be a bug, misconfig, or anything in between support Marks an issue as related to a customer support request (don't edit the lable) labels Dec 17, 2024
@github-actions github-actions bot added platform/aws Issues related to AWS platform/gcp Issues related to GCP labels Dec 17, 2024
@drodriguez-305
Copy link
Contributor Author

@hamza-m-masood adding your comment here.
I can reproduce this.
Helm upgrading with a changed global.labels produces an error saying that matchLabels can't be changed in each component.

I'm fine with you opening a bug report on this. We could probably just take out this section in the function:
https://github.com/camunda/camunda-platform-helm/blob/36fc7f60e4aa2dc00288e91ad222[…]55b8/charts/camunda-platform-8.6/templates/camunda/_helpers.tpl

I'm fine with that part being taken out because the other labels still exist in the function.
I checked other bitnami charts hoping to see something along the lines of global.matchLabels but most charts only provide matchLabels for either ingress or networkPolicies. I did find a common function which seems useful: https://github.com/bitnami/charts/blob/b41a51d1bd04841fc108b78d3b8357a5292771c8/bitnami/common/templates/_labels.tpl#L34
This is used by the grafana chart which can be seen here:
https://github.com/bitnami/charts/blob/b41a51d1bd04841fc108b78d3b8357a5292771c8/bitnami/grafana/templates/deployment.yaml#L16C1-L21C43
it would be better to implement what the grafana chart does already. It keeps the matchLabels immutable

@larszi
Copy link

larszi commented Dec 19, 2024

We are also facing this issue.

@aabouzaid aabouzaid added this to the 8.8 Release Cycle milestone Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/issue Unidentified issue, it could be a bug, misconfig, or anything in between platform/aws Issues related to AWS platform/gcp Issues related to GCP support Marks an issue as related to a customer support request (don't edit the lable)
Projects
None yet
Development

No branches or pull requests

3 participants