Overview
- Kubernetes 클러스터에 ArgoCD 설치하기
Prerequisite
Kubernetes 클러스터 구축은 완료되었다고 가정하고 진행합니다. AWS 인프라 구축은 Overview 탭의 블로그를 참조해주시길 바랍니다.
ArgoCD 설치
// Namespace 생성
$ kubectl create namespace argocd
// ArgoCD 설치
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
// ArgoCD 삭제
$ kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
// 모두 설치 완료됐는지 확인
$ kubectl get all -n argocd
NAME READY STATUS RESTARTS AGE
pod/argocd-application-controller-0 1/1 Running 0 87m
pod/argocd-applicationset-controller-7dc76d94b4-6hvf5 1/1 Running 0 87m
pod/argocd-dex-server-6975f6d456-rhc66 1/1 Running 0 87m
pod/argocd-notifications-controller-7ffccbf884-6z4jm 1/1 Running 0 87m
pod/argocd-redis-545f8544bb-qgbvk 1/1 Running 0 87m
pod/argocd-repo-server-7c55f55c7-9lfmv 1/1 Running 0 87m
pod/argocd-server-5d48c6994c-blw9k 1/1 Running 0 87m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/argocd-applicationset-controller ClusterIP 10.43.53.174 <none> 7000/TCP,8080/TCP 87m
service/argocd-dex-server ClusterIP 10.43.65.126 <none> 5556/TCP,5557/TCP,5558/TCP 87m
service/argocd-metrics ClusterIP 10.43.38.136 <none> 8082/TCP 87m
service/argocd-notifications-controller-metrics ClusterIP 10.43.81.103 <none> 9001/TCP 87m
service/argocd-redis ClusterIP 10.43.155.140 <none> 6379/TCP 87m
service/argocd-repo-server ClusterIP 10.43.96.185 <none> 8081/TCP,8084/TCP 87m
service/argocd-server ClusterIP 10.43.208.89 <none> 80/TCP,443/TCP 87m
service/argocd-server-metrics ClusterIP 10.43.117.91 <none> 8083/TCP 87m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/argocd-applicationset-controller 1/1 1 1 87m
deployment.apps/argocd-dex-server 1/1 1 1 87m
deployment.apps/argocd-notifications-controller 1/1 1 1 87m
deployment.apps/argocd-redis 1/1 1 1 87m
deployment.apps/argocd-repo-server 1/1 1 1 87m
deployment.apps/argocd-server 1/1 1 1 87m
NAME DESIRED CURRENT READY AGE
replicaset.apps/argocd-applicationset-controller-7dc76d94b4 1 1 1 87m
replicaset.apps/argocd-dex-server-6975f6d456 1 1 1 87m
replicaset.apps/argocd-notifications-controller-7ffccbf884 1 1 1 87m
replicaset.apps/argocd-redis-545f8544bb 1 1 1 87m
replicaset.apps/argocd-repo-server-7c55f55c7 1 1 1 87m
replicaset.apps/argocd-server-5d48c6994c 1 1 1 87m
NAME READY AGE
statefulset.apps/argocd-application-controller 1/1 87m
$ vi argocd-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-server-ingress
namespace: argocd
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
ingressClassName: nginx
rules:
- host: argocd.{Master Node Public IP}.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argocd-server
port:
name: https
// Ingress 적용 (약 1분 소요)
$ kubectl apply -f argocd-ingress.yaml
// SSL Passthrough 설정 (약 1분 소요)
$ kubectl patch daemonset rke2-ingress-nginx-controller -n kube-system --type='json' -p '[{"op":"add","path":"/spec/template/spec/containers/0/args/-","value":"--enable-ssl-passthrough"}]'
// SSL Passthrough 설정 확인
$ kubectl edit daemonset rke2-ingress-nginx-controller -n kube-system
// 웹 브라우저 'argocd.{Master Node Public IP}.nip.io'에 접속 후 확인
// 아이디: admin / 초기 비밀번호는 아래 명령어로 확인
$ kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
마무리
상세 설명은 해당 링크에 있으니 참고하시길 바랍니다. (링크)
Rancher (RKE2)로 Kubernetes 클러스터를 구축했다면, Inbound Network Rules을 잘 확인해서 Port를 개방해주어야 합니다. (링크)
RKE2에서 ArgoCD를 위한 필수 Port는 443 (TCP), 80 (TCP), 8472 (UDP)가 있으니, 웹 브라우저로 접속이 안된다면 해당 부분을 확인해보시길 바랍니다.
'Kubernetes' 카테고리의 다른 글
[Kubernetes] ArgoCD 설치 및 Let's Encrypt를 통한 HTTPS 적용 (0) | 2024.06.13 |
---|---|
[Kubernetes] Gitea와 ArgoCD를 통한 CD 파이프라인 구축 (0) | 2024.06.05 |
[Kubernetes] Kubernetes 클러스터 외부에서 관리하기 (Bastion, Local) (0) | 2024.05.27 |
[Rancher] Kubernetes 클러스터 구축 (0) | 2024.05.23 |
[Kubernetes] 클러스터 운영 시 고려 사항 (0) | 2024.04.03 |