2019-05-08 16:37:45 +00:00
# Kustomize
2020-04-15 19:04:31 +00:00
The following configuration options are available for Kustomize:
2019-05-08 16:37:45 +00:00
* `namePrefix` is a prefix appended to resources for Kustomize apps
2019-10-16 23:34:52 +00:00
* `nameSuffix` is a suffix appended to resources for Kustomize apps
2019-08-02 20:13:27 +00:00
* `images` is a list of Kustomize image overrides
2020-04-15 19:04:31 +00:00
* `commonLabels` is a string map of an additional labels
2020-10-29 18:12:55 +00:00
* `commonAnnotations` is a string map of an additional annotations
2021-07-26 20:31:34 +00:00
2019-06-07 15:46:11 +00:00
To use Kustomize with an overlay, point your path to the overlay.
!!! tip
If you're generating resources, you should read up how to ignore those generated resources using the [`IgnoreExtraneous` compare option ](compare-options.md ).
2019-06-14 16:34:27 +00:00
## Private Remote Bases
2021-07-26 20:31:34 +00:00
If you have remote bases that are either (a) HTTPS and need username/password (b) SSH and need SSH private key, then they'll inherit that from the app's repo.
2019-06-14 16:34:27 +00:00
2021-01-28 22:46:57 +00:00
This will work if the remote bases uses the same credentials/private key. It will not work if they use different ones. For security reasons your app only ever knows about its own repo (not other team's or users repos), and so you won't be able to access other private repos, even if Argo CD knows about them.
2019-06-14 16:34:27 +00:00
Read more about [private repos ](private-repositories.md ).
2019-08-02 23:57:33 +00:00
## `kustomize build` Options/Parameters
2021-04-06 16:24:57 +00:00
To provide build options to `kustomize build` of default kustomize version, use `kustomize.buildOptions` field of `argocd-cm` ConfigMap. Use `kustomize.buildOptions.<version>` to register version specific build options.
2019-08-02 23:57:33 +00:00
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
2019-08-21 20:52:08 +00:00
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
2019-08-02 23:57:33 +00:00
data:
2021-07-26 20:31:34 +00:00
kustomize.buildOptions: --load_restrictor LoadRestrictionsNone
2021-04-06 16:24:57 +00:00
kustomize.buildOptions.v3.9.1: --output /tmp
2019-08-02 23:57:33 +00:00
```
2020-04-15 19:04:31 +00:00
## Custom Kustomize versions
2021-01-28 22:46:57 +00:00
Argo CD supports using multiple kustomize versions simultaneously and specifies required version per application.
2020-04-15 19:04:31 +00:00
To add additional versions make sure required versions are [bundled ](../operator-manual/custom_tools.md ) and then
2021-07-26 20:31:34 +00:00
use `kustomize.path.<version>` fields of `argocd-cm` ConfigMap to register bundled additional versions.
2020-04-15 19:04:31 +00:00
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
namespace: argocd
labels:
app.kubernetes.io/name: argocd-cm
app.kubernetes.io/part-of: argocd
data:
2021-04-06 16:24:57 +00:00
kustomize.path.v3.5.1: /custom-tools/kustomize_3_5_1
kustomize.path.v3.5.4: /custom-tools/kustomize_3_5_4
2020-04-15 19:04:31 +00:00
```
2019-10-21 23:54:23 +00:00
2021-01-28 22:46:57 +00:00
Once a new version is configured you can reference it in Application spec as following:
2020-04-30 20:17:44 +00:00
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook
spec:
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: HEAD
path: guestbook-kustomize
kustomize:
version: v3.5.4
```
Additionally application kustomize version can be configured using Parameters tab of Application Details page or using following CLI command:
```
argocd app set < appyName > --kustomize-version v3.5.4
```
2019-10-21 23:54:23 +00:00
## Build Environment
2020-02-04 07:47:04 +00:00
Kustomize does not support parameters and therefore cannot support the standard [build environment ](build-environment.md ).