Add Kubernetes-recommended labels to Helm chart - #71987
mihirduvedi wants to merge 4 commits into
Conversation
Miretpl
left a comment
There was a problem hiding this comment.
With using recommended k8s labels, we could delete old once (we are on chart 2.0 on main) and leave only necessery onces. We don't need to have all of these labels with duplicated values when there is Kubernetes standard for them.
| @@ -0,0 +1,286 @@ | |||
| # Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
This file is totally not aligned with how tests are written in the Helm Chart area. Could you adjust it?
| (f"{release_name}-airflow-redis", "ServiceAccount", "redis"), | ||
| (f"{release_name}-airflow-scheduler", "ServiceAccount", "scheduler"), | ||
| (f"{release_name}-airflow-statsd", "ServiceAccount", "statsd"), | ||
| (f"{release_name}-airflow-worker", "ServiceAccount", "worker"), |
There was a problem hiding this comment.
Most of the changes in this file seem unrelated.
| "app.kubernetes.io/instance" (include "airflow.labelValue" $root.Release.Name) | ||
| "app.kubernetes.io/managed-by" (include "airflow.labelValue" $root.Release.Service) | ||
| "app.kubernetes.io/part-of" "airflow" |
There was a problem hiding this comment.
Kubernetes has a couple more recommended labels like app.kubernetes.io/version, app.kubernetes.io/instance and app.kubernetes.io/name which we could use too.
| @@ -0,0 +1 @@ | |||
| Add Kubernetes-recommended labels to chart-managed resources and pods | |||
There was a problem hiding this comment.
It is rather unnecessary. We could delete it.
7e562ae to
90b904b
Compare
Replace the legacy
tier,component,release,chart, andheritagelabels from chart 2.0 with the Kubernetes-recommended application labels requested in #34048. Chart-managed resources now useapp.kubernetes.io/name,app.kubernetes.io/instance,app.kubernetes.io/version,app.kubernetes.io/componentwhere relevant,app.kubernetes.io/part-of, andapp.kubernetes.io/managed-by, plushelm.sh/chart; pod templates use the stable pod-relevant subset.Update workload, service, policy, and autoscaling selectors to the corresponding recommended keys. Centralize label generation and Kubernetes label-value normalization, preserve user-label precedence, and update the existing Helm tests, executor pod template, values examples, and documentation.
closes: #34048
Testing:
breeze testing helm-tests --use-xdist --kubernetes-version 1.30.13(2,150 passed)prek run --from-ref upstream/main --stage pre-commitbreeze ci selective-check --commit-ref HEADWas generative AI tooling used to co-author this PR?
Generated-by: Codex (GPT-5) following the guidelines
Drafted-by: Codex (GPT-5) (no human review before posting)