-
Notifications
You must be signed in to change notification settings - Fork 16.8k
Helm Chart: podDisruptionBudget.config schema defaults cause both minAvailable and maxUnavailable to render, breaking PDB creation #64491
Description
Helm Chart Bug Report
Official Helm Chart version: 1.19.0 (also present in 1.20.0 — schema unchanged)
Apache Airflow version: 3.0.0
Kubernetes version: 1.33
What happened
When enabling podDisruptionBudget on any of the following sub-components — apiServer, scheduler, triggerer, dagProcessor, pgbouncer — and setting only one of minAvailable or maxUnavailable in podDisruptionBudget.config, both fields are rendered in the final PDB manifest. Kubernetes rejects this with:
The PodDisruptionBudget is invalid:
spec: Invalid value: ...: minAvailable and maxUnavailable cannot be both set
Root cause
values.schema.json defines both fields with "default": 1 for every affected sub-component:
"minAvailable": { "type": ["integer", "string"], "default": 1 },
"maxUnavailable": { "type": ["integer", "string"], "default": 1 }Helm applies schema defaults at value-merge time. The PDB template then uses:
{{- toYaml .Values.triggerer.podDisruptionBudget.config | nindent 2 }}This dumps the entire config map. Because both fields received a default value of 1, both render — even when the user only set one of them.
Helm Chart configuration
Minimal reproduction — any sub-component with PDB enabled and only one field set:
triggerer:
enabled: true
replicas: 2
podDisruptionBudget:
enabled: true
config:
maxUnavailable: 1 # only this field set — minAvailable should be absentRendered output (incorrect):
apiVersion: policy/v1
kind: PodDisruptionBudget
spec:
maxUnavailable: 1
minAvailable: 1 # ← injected by schema default, never set by user
selector: ...Kubernetes error:
spec: Invalid value: ...: minAvailable and maxUnavailable cannot be both set
What you think should happen instead
Setting only maxUnavailable: 1 in podDisruptionBudget.config should produce a PDB spec with only maxUnavailable: 1. The unset field should not appear.
Either:
- The schema
"default": 1should be removed from bothminAvailableandmaxUnavailable(the user should have to explicitly set one), or - The PDB template should conditionally render each field (e.g.
{{- if hasKey .Values.triggerer.podDisruptionBudget.config "minAvailable" }}) rather than using a rawtoYamldump.
How to reproduce
- Install chart v1.19.0 or v1.20.0 with any sub-component PDB enabled and only one field set:
helm install airflow apache-airflow/airflow \
--set triggerer.podDisruptionBudget.enabled=true \
--set triggerer.podDisruptionBudget.config.maxUnavailable=1-
Observe
helm templateoutput — bothminAvailable: 1andmaxUnavailable: 1appear in the PDB spec. -
Apply to a cluster — Kubernetes rejects the PDB immediately.
Affected sub-components: apiServer, scheduler, triggerer, dagProcessor, pgbouncer
Workaround
Patch values.schema.json inside the vendored chart tgz to add "null" to the type array for both fields on all affected sub-components, then set the unused field to ~ (YAML null) in values.yaml. toYaml omits null values, producing a valid single-field PDB.
This is a fragile workaround that must be reapplied on every chart upgrade.
Are you willing to submit a PR?
Yes — happy to submit a PR fixing the schema defaults and/or the template conditional rendering.
I agree to follow this project's Code of Conduct