You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "azadabbasi (via GitHub)" <gi...@apache.org> on 2024/08/21 20:55:20 UTC

[I] Unable to specify env variables using fieldPath [airflow]

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

   ### Official Helm Chart version
   
   1.14.0
   
   ### Apache Airflow version
   
   2.9.2
   
   ### Kubernetes Version
   
   v1.30.2
   
   ### Helm Chart configuration
   
   Using Argo CD to deploy the helm chart
   
   ### Docker Image customizations
   
   No customization
   
   ### What happened
   
   I need to be able to add env variables like the one below to my airflow containers (all of them) but the helm chart does not support these ... or at least I don't know how to do it.
   
   ```yaml
   env:
       - name: DOGSTATSD_HOST_IP
         valueFrom:
           fieldRef:
             fieldPath: status.hostIP
       - name: STATSD_HOST
         valueFrom:
           fieldRef:
             fieldPath: status.hostIP
   ```
   
   ### What you think should happen instead
   
   env should support specifying env variables that reference fieldRef
   
   ### How to reproduce
   
   Try adding the env vars above and helm template will fail with:
   
   ```
   Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = `helm template . --name-template airflow-core-deployment-stage --namespace airflow--core-deployment--stage --kube-version 1.29 --values <path to cached source>/charts/airflow/instances/awscmhstage2/values.yaml <api versions removed> failed exit status 1: Error: values don't meet the specifications of the schema(s) in the following chart(s): airflow: - env.5: value is required - env.5: Additional property valueFrom is not allowed - env.6: value is required - env.6: Additional property valueFrom is not allowed
   ```
   
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] 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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to specify env variables using fieldPath [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #41655:
URL: https://github.com/apache/airflow/issues/41655#issuecomment-2302997406

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to specify env variables using fieldPath [airflow]

Posted by "azadabbasi (via GitHub)" <gi...@apache.org>.
azadabbasi commented on issue #41655:
URL: https://github.com/apache/airflow/issues/41655#issuecomment-2303008476

   I just found the solution:
   
   ```yaml
     extraEnv: |
       - name: DOGSTATSD_HOST_IP
         valueFrom:
           fieldRef:
             fieldPath: status.hostIP
       - name: STATSD_HOST
         valueFrom:
           fieldRef:
             fieldPath: status.hostIP
   ```


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to specify env variables using fieldPath [airflow]

Posted by "azadabbasi (via GitHub)" <gi...@apache.org>.
azadabbasi commented on issue #41655:
URL: https://github.com/apache/airflow/issues/41655#issuecomment-2303009076

   Issue resolved. Had to use extraEnv 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Unable to specify env variables using fieldPath [airflow]

Posted by "azadabbasi (via GitHub)" <gi...@apache.org>.
azadabbasi closed issue #41655: Unable to specify env variables using fieldPath
URL: https://github.com/apache/airflow/issues/41655


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org