argo-cd/docs/user-guide/config-management-plugins.md
Leah abb0c4b260
feat: allow substitutions in plugin env variables (#6097)
* feat: allow substitutions in plugin env variables

Signed-off-by: Leah <github.leah@hrmny.sh>

* allow all variables

Signed-off-by: Leah <github.leah@hrmny.sh>

* add docs

Signed-off-by: Leah <github.leah@hrmny.sh>

* better phrasing

Signed-off-by: Leah <github.leah@hrmny.sh>

* add generic error to env var parsing

Signed-off-by: Leah <github.leah@hrmny.sh>
2021-06-04 19:11:09 +02:00

1.6 KiB

Plugins

Argo CD allows integrating more config management tools using config management plugins. Following changes are required to configure new plugin:

  • Make sure required binaries are available in argocd-repo-server pod. The binaries can be added via volume mounts or using custom image (see custom_tools).
  • Register a new plugin in argocd-cm ConfigMap:
data:
  configManagementPlugins: |
    - name: pluginName
      init:                          # Optional command to initialize application source directory
        command: ["sample command"]
        args: ["sample args"]
      generate:                      # Command to generate manifests YAML
        command: ["sample command"]
        args: ["sample args"]    

The generate command must print a valid YAML stream to stdout. Both init and generate commands are executed inside the application source directory.

  • Create an application and specify required config management plugin name.
argocd app create <appName> --config-management-plugin <pluginName>

More config management plugin examples are available in argocd-example-apps.

Environment

Commands have access to

  1. The system environment variables
  2. Standard build environment
  3. Variables in the application spec (References to system and build variables will get interpolated in the variables' values):

v1.2

spec:
  source:
    plugin:
      env:
        - name: FOO
          value: bar
        - name: REV
          value: test-$ARGOCD_APP_REVISION