Skip to content

Add Kubernetes-recommended labels to Helm chart - #71987

Open
mihirduvedi wants to merge 4 commits into
apache:mainfrom
mihirduvedi:feature-34048-kubernetes-labels
Open

mihirduvedi wants to merge 4 commits into
apache:mainfrom
mihirduvedi:feature-34048-kubernetes-labels

Conversation

@mihirduvedi

@mihirduvedi mihirduvedi commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Replace the legacy tier, component, release, chart, and heritage labels from chart 2.0 with the Kubernetes-recommended application labels requested in #34048. Chart-managed resources now use app.kubernetes.io/name, app.kubernetes.io/instance, app.kubernetes.io/version, app.kubernetes.io/component where relevant, app.kubernetes.io/part-of, and app.kubernetes.io/managed-by, plus helm.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)
  • focused label tests (22 passed) and affected regression tests (70 passed)
  • rendered audit across 79 resources and all enabled pod templates/selectors
  • prek run --from-ref upstream/main --stage pre-commit
  • Helm lint, kubeconform, schema validation, mypy, ruff, formatting, codespell, and documentation source checks through prek
  • breeze ci selective-check --commit-ref HEAD

Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-5)

Generated-by: Codex (GPT-5) following the guidelines


Drafted-by: Codex (GPT-5) (no human review before posting)

@Miretpl Miretpl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Most of the changes in this file seem unrelated.

Comment on lines +53 to +55
"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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread chart/newsfragments/71987.feature.rst Outdated
@@ -0,0 +1 @@
Add Kubernetes-recommended labels to chart-managed resources and pods

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is rather unnecessary. We could delete it.

@Miretpl Miretpl added this to the Airflow Helm Chart 2.0.0 milestone Sep 9, 2026
@mihirduvedi
mihirduvedi force-pushed the feature-34048-kubernetes-labels branch from 7e562ae to 90b904b Compare September 9, 2026 21:54

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Kubernetes-recommended labels for airflow helm chart

2 participants