Skip to content

Helm Chart: podDisruptionBudget.config schema defaults cause both minAvailable and maxUnavailable to render, breaking PDB creation #64491

@jamrobi2

Description

@jamrobi2

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 absent

Rendered 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:

  1. The schema "default": 1 should be removed from both minAvailable and maxUnavailable (the user should have to explicitly set one), or
  2. The PDB template should conditionally render each field (e.g. {{- if hasKey .Values.triggerer.podDisruptionBudget.config "minAvailable" }}) rather than using a raw toYaml dump.

How to reproduce

  1. 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
  1. Observe helm template output — both minAvailable: 1 and maxUnavailable: 1 appear in the PDB spec.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions