CD
CD
CD
Production 레밸까지 자동으로 Deploy 하는 것
Kustomize 방식
GitHub Actions -> Kubernetes Manifest -> ArgoCD
Kustomize 방식이란? : 운영별 환경에 맞게 커스터마이징 가능하도록 하는 Kubernetes 배포 도구 중 하나
기본적인 구성 방법
pod.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx:latest
resources:
limits:
memory: "64Mi"
cpu: "100m"
- 일반적으로 base 디렉토리에 존재한다.
kustomization.yaml
1
2
3
4
5
6
resources:
- pod.yaml
images:
- name: nginx
newName: nginx
newTag: 1.23.1
- 일반적으로 base, overlays/dev, oeverlays/pod 디렉토리에 존재한다.
kustomize
도구를 사용
1
kubectl kustomize ./
1
2
3
4
5
6
7
8
9
10
11
12
13
14
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.23.1
resources:
limits:
memory: "64Mi"
cpu: "100m"
자동으로 pod.yaml
파일의 image path가 변경된것을 볼 수 있다.
kustomize 사용방법
- 일반적으로
kustomization.yaml
만 있으면 실행가능! - 4가지 기본 필드가 존재
- resources 필드 : 적용할 쿠버네티스 리소스(yaml)
- generators 필드 : 새로운 쿠버네티스 리소스 또는 필드를 생성함 (configmap, secret)
- transformers 필드 : 컨테이너 이미지나 이름과 태그를 수정함
- validators 필드 : 위의 2개가 재정의 될 때 참조되는 필드 또한 수정함
ArgoCD
Kubernetes Manifest -> ArgoCD -> AKS
- GitOps를 구현하기 위한 도구 중 하나로 Kubernetes의 자동 배포를 위한 오픈소스 도구
- CI/CD 중에서 CD를 담당
git pull
요청 등을 사용해 코드의 변화를 감지, Kubernetes에 변경된 내용을 반영
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.