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>
  • Loading branch information
christianh814 authored and tesla59 committed Dec 16, 2023
1 parent 2bb2e59 commit e282f4c
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 e282f4c

Please sign in to comment.