jamrobi2 opened a new issue, #64491:
URL: https://github.com/apache/airflow/issues/64491

   ## 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:
   
   ```json
   "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:
   
   ```yaml
   {{- 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:
   
   ```yaml
   triggerer:
     enabled: true
     replicas: 2
     podDisruptionBudget:
       enabled: true
       config:
         maxUnavailable: 1   # only this field set — minAvailable should be 
absent
   ```
   
   Rendered output (incorrect):
   
   ```yaml
   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:
   
   ```bash
   helm install airflow apache-airflow/airflow \
     --set triggerer.podDisruptionBudget.enabled=true \
     --set triggerer.podDisruptionBudget.config.maxUnavailable=1
   ```
   
   2. Observe `helm template` output — both `minAvailable: 1` and 
`maxUnavailable: 1` appear in the PDB spec.
   
   3. 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](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to