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

   ## Description
   
   In Helm chart version 1.16.0, it's impossible to add custom 
`volumeClaimTemplates` to workers (e.g., for a `/data` volume) due to the 
template logic.
   
   ## Current Behavior
   
   The worker resource type and volumeClaimTemplates depend on 
`workers.persistence.enabled`:
   
   | `persistence.enabled` | Resource Type | Custom volumeClaimTemplates |
   |----------------------|---------------|----------------------------|
   | `true` (default) | StatefulSet | ❌ Only renders default `logs` PVC |
   | `false` | Deployment | ❌ Deployments don't support volumeClaimTemplates |
   
   **Result:** There's no configuration that allows adding custom persistent 
volumes to workers.
   
   ## Expected Behavior
   
   Users should be able to add custom `volumeClaimTemplates` (e.g., for 
`/data`) alongside the default `logs` volume when using a StatefulSet.
   
   ## Steps to Reproduce
   
   ```yaml
   workers:
     persistence:
       enabled: true
     volumeClaimTemplates:
       - metadata:
           name: data
         spec:
           storageClassName: longhorn
           accessModes: ["ReadWriteOnce"]
           resources:
             requests:
               storage: 10Gi
     extraVolumeMounts:
       - name: data
         mountPath: /data
   ```
   
   **Result:** Pod fails with `volumeMounts[0].name: Not found: "data"`
   
   Setting `persistence.enabled: false` creates a Deployment instead, which 
doesn't support volumeClaimTemplates at all.
   
   ## Root Cause
   
   In `templates/workers/worker-deployment.yaml`, the volumeClaimTemplates 
block with custom templates is only rendered in the `{{- else if not 
$persistence }}` branch, but that branch creates a Deployment, not a 
StatefulSet.
   
   ## Suggested Fix
   
   When `persistence.enabled: true`, append custom `volumeClaimTemplates` to 
the StatefulSet:
   
   ```yaml
   volumeClaimTemplates:
     - apiVersion: v1
       kind: PersistentVolumeClaim
       metadata:
         name: logs
       spec:
         ...
     {{- with .Values.workers.volumeClaimTemplates }}
       {{- toYaml . | nindent 4 }}
     {{- end }}
   ```
   
   ## Environment
   
   - Helm Chart Version: 1.16.0
   - Kubernetes: 1.28+
   - Helm: 3.x


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