Skip to content

Commit

Permalink
feat(kustomize): update kustomize docs
Browse files Browse the repository at this point in the history
Signed-off-by: arlan lloyd <arlanlloyd@gmail.com>
  • Loading branch information
acelinkio committed Aug 6, 2023
1 parent c12f422 commit 1b1531f
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/user-guide/kustomize.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,64 @@ The following configuration options are available for Kustomize:
* `namespace` is a kubernetes resources namespace
* `forceCommonAnnotations` is a boolean value which defines if it's allowed to override existing annotations
* `commonAnnotationsEnvsubst` is a boolean value which enables env variables substition in annotation values
* `patches` is a list of Kustomize patches that supports inline updates

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).

## Patches
Patches are a way to kustomize resources using inline configurations in ArgoCD applications. This allows for kustomizing without kustomization file. `patches` follow the same logic as the corresponding Kustomization. Any patches that target existing Kustomization file will be merged.

The following Kustomization manifest can be used as example.
```yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
name: kustomize-inline-example
namespace: test1
resources:
- https://raw.githubusercontent.com/argoproj/argocd-example-apps/master/guestbook/guestbook-ui-deployment.yaml
- https://raw.githubusercontent.com/argoproj/argocd-example-apps/master/guestbook/guestbook-ui-svc.yaml
patches:
- target:
kind: Deployment
name: guestbook-ui
patch: |-
- op: replace
path: /spec/template/spec/containers/0/ports/0/containerPort
value: 443
```
The following is similar and clone the repository, use the specified path, then kustomize.
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: kustomize-inline-guestbook
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: test1
server: https://kubernetes.default.svc
project: default
source:
path: guestbook
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: master
kustomize:
patches:
- target:
kind: Deployment
name: guestbook-ui
patch: |-
- op: replace
path: /spec/template/spec/containers/0/ports/0/containerPort
value: 443
```
## Private Remote Bases
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.
Expand Down

0 comments on commit 1b1531f

Please sign in to comment.