[k8s] ArgoCD kustomize 주요 옵션

Woong·2025년 8월 19일
0

Docker, k8s

목록 보기
22/26

kustomize name, resource 정의 관련

  • namespace : 리소스 namespace 정의
  • namePrefix, nameSuffix : 리소스 접두사
  • images : kustomize 로 override 할 이미지 목록
    • 컨테이너 이미지 태그 교체할 때 사용
  • replicas : pod replica

patch, component

  • patches : 리소스를 패치 정의
  • components : component 에 대한 부분적으로 overlay 지정
  • ignoreMissingComponents : 지정한 component 가 없어도 에러 없이 빌드하는 옵션

ex)

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../base

# 모든 리소스의 metadata.name 에 적용되는 prefix
namePrefix: api-docs-agent-
namespace: agent

patches:
- path: patch-deployment.yaml
- path: patch-service.yaml

images:
- name: <account_id>.dkr.ecr.ap-northeast-1.amazonaws.com/agents/my_app
  newTag: <git_revision>

label, annotaion

  • commonLabels, commonAnnotations : 모든 리소스에 공통 label, annotation 추가
  • labelWithoutSelector : .spec.selector가 없는 리소스에도 commonLabels를 강제로 붙일지 여부. (boolean)
  • labelIncludeTemplates : 템플릿 내부(spec.template.metadata.labels)까지 commonLabels 적용 여부 (boolean)
  • forceCommonLabels : label 이 정의된 것도 commonLabels 로 강제로 덮어씌우는 옵션 (boolean)
  • forceCommonAnnotations : annotaion 이 정의된 것도commonAnnotations 로 강제로 덮어씌우는 옵션 (boolean)
  • commonAnnotationsEnvsubst : commonAnnotations 값에서 환경변수 치환을 허용.
    • ex) "build: ${ARGOCD_APP_REVISION}"

reference

0개의 댓글