Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Added example of using build env vars in your Kustomized App #16025

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading