Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

custom environment variable - argocd

There are build environment variables (https://argoproj.github.io/argo-cd/user-guide/build-environment/) so can inject something like $ARGOCD_APP_NAME on the application/helm yaml file and it resolves to the actual value.

Is there a way we can set custom environment variables so it can be resolved on the argocd application yaml file?

For example on below argocd application yaml, need to set the ENV value so helm can know which values.yaml to use.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
    ...
spec:
    ...
    source:
       ...
        helm:
            valueFiles:
                - values_${ENV}.yaml
like image 822
lorraine Avatar asked May 31 '26 12:05

lorraine


1 Answers

It's a late answer, but you can. You can use the plugin field to add the ENV variables in the application level, the example follows:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  ...
spec:
  ...
  source:
    plugin:
      env:
          - name: ENV_VARIABLE
            value: ENV_VALUE
like image 101
Matheus Avatar answered Jun 02 '26 19:06

Matheus