위에 Go template 깐 YAML
Helm 이 Kubernetes 의 패키지 매니저. chart 가 YAML template 디렉토리. helm install 이 template 을 values.yaml 로 렌더하고 결과 적용. 바닥엔 같은 K8s manifest; 중간 templating layer 가 한 chart 로 dev/staging/prod 에 다른 값으로 배포.
Chart 레이아웃
Chart.yaml— chart 메타데이터.values.yaml— 기본 값 (chart 의 API).templates/—{{ .Values.x }}치환된 YAML template.charts/— sub-chart.
String quoting 함정
Helm template 이 텍스트 출력. 결과가 그 후 YAML 로 파싱. 그래서 bare 값 emit 한 template 이 YAML 에 의해 다시 타이핑됨 — port: 8000 인 {{ .Values.port }} 가 K8s 가 string 기대하는 곳에서도 정수 8000 됨. 렌더된 출력 명시적 quote: {{ .Values.port | quote }} 또는 quote 로 wrap.
'렌더된 YAML 이 가끔 무효 YAML' 문제: Helm template 이 깨진 YAML (누락된 newline, 이중 파이프, 잘못 들여쓴 block) 만들 수 있어. CI 에서
helm template ./chart 실행 후 kubeconform 또는 yq . 로 파이프 — render-time 검증, 배포-time 만 아님.