Skip to content

Commit

Permalink
added example of using build env vars in your Kustomized Argo CD Appl…
Browse files Browse the repository at this point in the history
…ication (argoproj#16025)

Signed-off-by: Christian Hernandez <christian@chernand.io>
Signed-off-by: jmilic1 <70441727+jmilic1@users.noreply.github.com>
  • Loading branch information
christianh814 authored and jmilic1 committed Nov 13, 2023
1 parent 00fad8a commit 339e5ff
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/user-guide/kustomize.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,34 @@ argocd app set <appName> --kustomize-version v3.5.4

Kustomize apps have access to the [standard build environment](build-environment.md) which can be used in combination with a [config managment plugin](../operator-manual/config-management-plugins.md) to alter the rendered manifests.

You can use these build environment variables in your Argo CD Application manifests. You can enable this by setting `.spec.source.kustomize.commonAnnotationsEnvsubst` to `true` in your Application manifest.

For example, the following Application manifest will set the `app-source` annotation to the name of the Application:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook-app
namespace: argocd
spec:
project: default
destination:
namespace: demo
server: https://kubernetes.default.svc
source:
path: kustomize-guestbook
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: HEAD
kustomize:
commonAnnotationsEnvsubst: true
commonAnnotations:
app-source: ${ARGOCD_APP_NAME}
syncPolicy:
syncOptions:
- CreateNamespace=true
```

## Kustomizing Helm charts

It's possible to [render Helm charts with Kustomize](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md).
Expand Down

0 comments on commit 339e5ff

Please sign in to comment.