Skip to main content

Kustomize

kustomize#

kustomize build <directory path> | kubectl apply -f -

kustomizeλŠ” μœ„μ™€ 같은 ν˜•μ‹μœΌλ‘œ μ‚¬μš©λ©λ‹ˆλ‹€. <directory path>/kustomization.yaml 의 섀정에 따라 yaml νŒŒμΌλ“€μ΄ μ‘°ν•©λ˜κ³ , κ·Έ μ‘°ν•© κ²°κ³Όκ°€ kubectl apply -f -에 μ˜ν•΄ μ μš©λ©λ‹ˆλ‹€.

Example#

local-path-provisioner
β”œβ”€β”€ base
β”‚ β”œβ”€β”€ kustomization.yaml
β”‚ └── local-path-storage.yaml
└── overlays
└── default-storageclass
β”œβ”€β”€ kustomization.yaml
└── patches
└── default-storageclass.yaml
local-path-provisioner/base/local-path-storage.yaml
#...
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-path
#...
local-path-provisioner/base/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- local-path-storage.yaml
local-path-provisioner/overlays/default-storageclass/patchs/default-storageclass.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
annotations:
storageclass.beta.kubernetes.io/is-default-class: 'true'
name: local-path
local-path-provisioner/overlays/default-storageclass/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patches:
- patches/default-storageclass.yaml

Reference#

Last updated on