728x90
반응형
Kubernetest - Helm 으로 CD 구성하기 feat. ArgoCD
ArgoCD 는 쿠버네티스 클러스터에 지속적인 배포를 가능하게 하는 도구이다. Git repo 를 레퍼런스로 사용하여 클러스터의 현재 상태와 저장소의 원하는 상태를 동기화한다.
# examp
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
# app 이름
name: my-app
namespace: argocd
spec:
project: default
# git repo 에서 helm 차트가 있는 경로를 찾아서 소싱
source:
repoURL: <https://github.com/my-org/my-repo.git>
targetRevision: HEAD
path: my-chart/
destination:
server: <https://kubernetes.default.svc>
namespace: my-namespace
Argo CD 설치하기
Argo CD 는 k8s 안에 네임스페이스를 만들고 해당 위치에 설치해준다.
https://argo-cd.readthedocs.io/en/stable/
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
네임스페이스 argocd 로 검색하면 제대로 설치가 되었는지 알 수 있다.
kimminhyeok@Ivans-Mac k8s % k get po -n argocd
NAME READY STATUS RESTARTS AGE
argocd-application-controller-0 1/1 Running 0 93s
argocd-applicationset-controller-745cd84657-s9fkw 1/1 Running 0 93s
argocd-dex-server-684c58b4b5-jqj8c 1/1 Running 0 93s
argocd-notifications-controller-f5877f4fb-jkcbp 1/1 Running 0 93s
argocd-redis-685866888c-8x5s6 1/1 Running 0 93s
argocd-repo-server-76bc8c68b9-f9qsr 1/1 Running 0 93s
argocd-server-b456cd7d5-clhnv 1/1 Running 0 93s
argoCD 의 서비스를 로드밸런서로 바꿔주기
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
kimminhyeok@Ivans-Mac k8s % k get svc -n argocd
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
argocd-applicationset-controller ClusterIP 198.19.227.1 <none> 7000/TCP,8080/TCP 8m20s
argocd-dex-server ClusterIP 198.19.206.85 <none> 5556/TCP,5557/TCP,5558/TCP 8m20s
argocd-metrics ClusterIP 198.19.247.26 <none> 8082/TCP 8m20s
argocd-notifications-controller-metrics ClusterIP 198.19.202.39 <none> 9001/TCP 8m20s
argocd-redis ClusterIP 198.19.220.116 <none> 6379/TCP 8m20s
argocd-repo-server ClusterIP 198.19.164.181 <none> 8081/TCP,8084/TCP 8m20s
argocd-server LoadBalancer 198.19.167.212 argocd-argocd-server-ea9d6-19567594-e4f019505591.kr.lb.naverncp.com 80:32305/TCP,443:31311/TCP 8m20s
argocd-server-metrics ClusterIP 198.19.183.217 <none> 8083/TCP 8m20s
argocd-argocd-server-ea9d6-19567594-e4f019505591.kr.lb.naverncp.com
위 주소로 접속하면 경고 메세지가 뜨는데, https 라 인증서가 없어서 그런것 같다. Advanced 로 열어서 우회되는 경로로 접속한다.
cli 설치하기
brew install argocd
어드민 비밀번호 초기화
The initial password for the admin account is auto-generated
and stored as clear text in the field password in a secret
named argocd-initial-admin-secret in your Argo CD installation namespace.
You can simply retrieve this password using the argocd CLI:
argocd admin initial-password -n argocd
# result
kimminhyeok@Ivans-Mac k8s % argocd admin initial-password -n argocd
1ARiknR4OfGOWb-A
id : admin
password: 1ARiknR4OfGOWb-A
로그인 후 비밀번호를 본인의 비밀번호로 업데이트!
728x90
반응형
'Dev. > ArgoCD' 카테고리의 다른 글
ArgoCD: Deploy App (1) | 2023.10.12 |
---|---|
ArgoCD: Git repo referencing (1) | 2023.10.11 |
댓글