마구잡

Kubernetes + gitlab + gitlab-ci + harbor + argocd 총 집합 ( 3 ) 본문

Kubernetes

Kubernetes + gitlab + gitlab-ci + harbor + argocd 총 집합 ( 3 )

MAGUJOB 2024. 5. 21. 14:16
반응형

지난번 하버 설치에 이어서

 

Kubernetes + gitlab + gitlab-ci + harbor + argocd 총 집합 ( 2 )

지난번 깃랩 설치에 이어서 Kubernetes + gitlab + gitlab-ci + harbor + argocd 총 집합 ( 1 )이전 마지막 글을 쓴 시점 부터 지금까지 약 2개월간 혼자서 실제 사이트의 운영환경과 거의 비슷한 구성을 만들기

mgujob.tistory.com


 

아르고CD 설치 전 MetalLB가 배포 되어있어야 한다.


1. 아르고CD 설치

헬름을 통한 아르고CD 차트 pull

helm repo add argo https://argoproj.github.io/argo-helm
helm pull argo/argo-cd

 

압축 해제 & 밸류 파일 복사

tar -zxvf argo-cd-6.7.8.tgz && cd argo-cd-6.7.8
cp values.yaml my-values.yaml

 

my-values.yaml 수정

 

92   # -- Mapping between IP and hostnames that will be injected as entries in the pod's hosts files
93   hostAliases:
94    - ip: 이전 사용한 깃랩 로드밸런서 IP
95      hostnames:
96      - 이전 사용한 깃랩 도메인.com
...
1933   ## Server service configuration
1934   service:
1935     # -- Server service annotations
1936     annotations: {}
1937     # -- Server service labels
1938     labels: {}
1939     # -- Server service type
1940     type: LoadBalancer <- 서비스 타입

 

네임스페이스 생성

kubectl create ns argocd

 

헬름을 통한 하버 배포

helm install harbor -f my-values.yaml . -n argocd

 

배포 확인

kubectl get po -n argocd
NAME                                                READY   STATUS    RESTARTS     AGE
argocd-application-controller-0                     1/1     Running   1 (8d ago)   46d
argocd-applicationset-controller-79fc9f7d49-nxnfv   1/1     Running   1 (8d ago)   46d
argocd-dex-server-77499d974f-cl7f8                  1/1     Running   1 (8d ago)   46d
argocd-notifications-controller-6cd97859d-bhmxt     1/1     Running   1 (8d ago)   46d
argocd-redis-67696df9f4-qjh6c                       1/1     Running   1 (8d ago)   46d
argocd-repo-server-7cddf6c6f6-xqkjv                 1/1     Running   1 (8d ago)   46d
argocd-server-794f587f66-lmw8w                      1/1     Running   1 (8d ago)   46d

kubectl get svc -n argocd
NAME                               TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                      AGE
argocd-applicationset-controller   ClusterIP      10.97.68.221     <none>           7000/TCP                     46d
argocd-dex-server                  ClusterIP      10.96.16.151     <none>           5556/TCP,5557/TCP            46d
argocd-redis                       ClusterIP      10.98.139.229    <none>           6379/TCP                     46d
argocd-repo-server                 ClusterIP      10.109.54.33     <none>           8081/TCP                     46d
argocd-server                      LoadBalancer   10.110.198.130   192.168.60.117   80:30162/TCP,443:31074/TCP   46d

 

아르고CD 어드민 패스워드 추출

kubectl -n argocd get secrets argocd-initial-admin-secret -ojsonpath="{.data.password}" | base64 -d

 

웹 페이지 접속 로드밸런서 IP 혹은 노드포트로 접속

로그인 페이지

2. 깃 레파지토리 등록

1. 세팅 -> 레포지토리 -> 커넥트 레포

 

 

2. 이전 깃랩 설치 후 등록한 레포 확인

 

주소 복사

3. 아르고CD 등록

Choose your connection method: VIA HTTPS

Type: git

Project: default

Repository URL: 복사한 깃 레파지토리 주소 등록

Username: git user

Password: git user pass

 

편의성을 위해 서버 인증 스킵

등록 완료

반응형