github.com/argoproj/argo-cd@v1.8.7/docs/user-guide/parameters.md (about) 1 # Parameter Overrides 2 3 Argo CD provides a mechanism to override the parameters of Argo CD applications that leverages config management 4 tools. This provides flexibility in having most of the application manifests defined in Git, while leaving room 5 for *some* parts of the k8s manifests determined dynamically, or outside of Git. It also serves as an alternative way of 6 redeploying an application by changing application parameters via Argo CD, instead of making the 7 changes to the manifests in Git. 8 9 !!! tip 10 Many consider this mode of operation as an anti-pattern to GitOps, since the source of 11 truth becomes a union of the Git repository, and the application overrides. The Argo CD parameter 12 overrides feature is provided mainly as a convenience to developers and is intended to be used in 13 dev/test environments, vs. production environments. 14 15 To use parameter overrides, run the `argocd app set -p (COMPONENT=)PARAM=VALUE` command: 16 17 ```bash 18 argocd app set guestbook -p image=example/guestbook:abcd123 19 argocd app sync guestbook 20 ``` 21 22 The `PARAM` is expected to be a normal YAML path 23 24 ```bash 25 argocd app set guestbook -p ingress.enabled=true 26 argocd app set guestbook -p ingress.hosts[0]=guestbook.myclusterurl 27 ``` 28 29 The `argocd app set` [command](./commands/argocd_app_set.md) supports more tool-specific flags such as `--kustomize-image`, `--jsonnet-ext-var-str` etc 30 flags. You can also specify overrides directly in the source field on application spec. Read more about supported options in corresponded tool [documentation](./application_sources.md). 31 32 ## When To Use Overrides? 33 34 The following are situations where parameter overrides would be useful: 35 36 1. A team maintains a "dev" environment, which needs to be continually updated with the latest 37 version of their guestbook application after every build in the tip of master. To address this use 38 case, the application would expose a parameter named `image`, whose value used in the `dev` 39 environment contains a placeholder value (e.g. `example/guestbook:replaceme`). The placeholder value 40 would be determined externally (outside of Git) such as a build system. Then, as part of the build 41 pipeline, the parameter value of the `image` would be continually updated to the freshly built image 42 (e.g. `argocd app set guestbook -p image=example/guestbook:abcd123`). A sync operation 43 would result in the application being redeployed with the new image. 44 45 2. A repository of Helm manifests is already publicly available (e.g. https://github.com/helm/charts). 46 Since commit access to the repository is unavailable, it is useful to be able to install charts from 47 the public repository and customize the deployment with different parameters, without resorting to 48 forking the repository to make the changes. For example, to install Redis from the Helm chart 49 repository and customize the the database password, you would run: 50 51 ```bash 52 argocd app create redis --repo https://github.com/helm/charts.git --path stable/redis --dest-server https://kubernetes.default.svc --dest-namespace default -p password=abc123 53 ``` 54 55 ## Store Overrides In Git 56 57 The config management tool specific overrides can be specified in `.argocd-source.yaml` file stored in the source application 58 directory in the Git repository. 59 60 !!! warn 61 The `.argocd-source` is a beta feature and subject to change. 62 63 The `.argocd-source.yaml` file is used during manifest generation and overrides 64 application source fields, such as `kustomize`, `helm` etc. 65 66 Example: 67 68 ```yaml 69 kustomize: 70 images: 71 - gcr.io/heptio-images/ks-guestbook-demo:0.2 72 ``` 73 74 The `.argocd-source` is trying to solve two following main use cases: 75 76 - Provide the unifed way to "override" application parameters in Git and enable the "write back" feature 77 for projects like [argocd-image-updater](https://github.com/argoproj-labs/argocd-image-updater). 78 - Support "discovering" applications in the Git repository by projects like [applicationset](https://github.com/argoproj-labs/applicationset) 79 (see [git files generator](https://github.com/argoproj-labs/applicationset/blob/master/examples/git-files-discovery.yaml))