yeonghoon.kim

  • 게시판
  • 갤러리

ArgoCD 복구 중 GitLab 접근 문제 정리

김영훈 2026.06.22 12:26 조회 수 : 26

클러스터를 다시 만들고 ArgoCD를 복구하는 과정에서 GitLab repo 접근 문제가 나옴.

ArgoCD UI가 뜬다고 바로 GitOps가 되는 건 아니었음.

ArgoCD가 GitLab repo를 읽으려면 몇 가지가 같이 맞아야 함.

  • ArgoCD가 설치되어 있어야 함
  • argocd namespace의 Secret/ConfigMap이 복구되어야 함
  • Pod 안에서 gitlab.yeonghoon.kim이 내부 IP로 해석되어야 함
  • GitLab SSH host key가 known_hosts에 등록되어야 함
  • repo credential Secret이 있어야 함

먼저 ArgoCD 설치 중 CRD 오류가 있었음.

공식 install manifest 적용 중 applicationsets.argoproj.io CRD가 annotation 크기 제한으로 실패함.

오류는 대략 이런 쪽.

metadata.annotations: Too long

ArgoCD CRD가 커서 일반 apply 경로에서 annotation 제한에 걸린 것으로 봄.

해당 CRD는 server-side apply로 다시 적용.

# ArgoCD install manifest를 server-side apply 방식으로 적용한다.
kubectl apply --server-side --force-conflicts \
  -n argocd \
  -f https://raw.githubusercontent.com/argoproj/argo-cd/v3.4.3/manifests/install.yaml

ArgoCD 설치 후에는 Ingress와 UI를 먼저 확인함.

# ArgoCD Pod 상태를 확인한다.
kubectl -n argocd get pods -o wide
# ArgoCD Ingress 상태를 확인한다.
kubectl -n argocd get ingress argocd-server -o wide
# Ingress VIP로 ArgoCD UI 응답을 직접 확인한다.
curl -k -sS -o /dev/null -w "%{http_code}\n" \
  --max-time 10 \
  --resolve "argo.yeonghoon.kim:443:192.168.200.49" \
  https://argo.yeonghoon.kim/

UI 응답이 살아도 GitLab repo 접근은 별도 문제.

cluster-apps root Application을 적용했을 때 처음에는 known_hosts 오류가 남.

knownhosts: key is unknown

이건 GitLab 비밀번호나 SSH key가 틀렸다는 뜻이라기보다, ArgoCD가 gitlab.yeonghoon.kim:2224의 SSH host key를 아직 신뢰하지 않는다는 뜻.

GitLab SSH host key 확인.

# GitLab SSH host key를 확인한다.
ssh-keyscan -p 2224 gitlab.yeonghoon.kim

ArgoCD known_hosts ConfigMap에 등록.

# GitLab SSH 공개 host key를 ArgoCD known_hosts ConfigMap에 등록한다.
ssh-keyscan -p 2224 gitlab.yeonghoon.kim 2>/dev/null | \
kubectl -n argocd create configmap argocd-ssh-known-hosts-cm \
  --from-file=ssh_known_hosts=/dev/stdin \
  --dry-run=client -o yaml | \
kubectl -n argocd apply -f -

repo-server 재시작.

# ArgoCD repo-server가 known_hosts 변경을 다시 읽도록 재시작한다.
kubectl -n argocd rollout restart deployment/argocd-repo-server
kubectl -n argocd rollout status deployment/argocd-repo-server --timeout=180s

그 다음 root Application 적용.

# cluster-apps root Application을 적용한다.
cd /home/ioniere/gitlab-project-clones/ioniere/cluster-apps
kubectl -n argocd apply -f bootstrap/root-application.yaml

상태 확인.

# cluster-apps Application 상태를 확인한다.
kubectl -n argocd get application cluster-apps \
  -o jsonpath='sync={.status.sync.status}{"\n"}health={.status.health.status}{"\n"}message={.status.operationState.message}{"\n"}'

복구 중에는 GitLab 접근 문제를 한 번에 Secret 문제로 단정하면 안 됨.

나눠서 봐야 함.

DNS 문제
= Pod 안에서 gitlab.yeonghoon.kim이 잘못된 IP로 해석됨

known_hosts 문제
= GitLab SSH host key를 ArgoCD가 신뢰하지 않음

repo credential 문제
= ArgoCD가 GitLab repo에 들어갈 SSH key나 credential이 없음

ArgoCD 설치 문제
= CRD나 controller가 정상 설치되지 않음

CoreDNS override, known_hosts, repo credential, root Application 순서가 중요하다는 걸 다시 확인함.

ArgoCD UI가 뜬 것과 ArgoCD가 GitLab repo를 읽는 것은 별개로 봐야 함.


  • 추천 0

  • 비추천 0
이 게시물을
목록

댓글 0

번호 제목 글쓴이 날짜 조회 수
339 yeonghoon.kim php 업그레이드 new 김영훈 2026.07.09 0
338 GitLab Registry PAT 만료로 이미지 Pull 실패 김영훈 2026.07.08 14
337 Stateful과 Stateless 구분해보기 김영훈 2026.07.02 23
336 Git revert는 기록을 지우는 게 아니라 되돌리는 기록을 남기는 것 김영훈 2026.06.29 19
335 OutOfSync와 Degraded 구분하기 김영훈 2026.06.28 25
334 control-plane 장애 시나리오 관찰 김영훈 2026.06.27 12
333 worker 재부팅 전 drain 절차 정리 김영훈 2026.06.26 20
332 ImagePullBackOff와 registry pull secret 누락 김영훈 2026.06.22 17
» ArgoCD 복구 중 GitLab 접근 문제 정리 김영훈 2026.06.22 26
330 관측 스택과 앱 배포 저장소 구조 정리 김영훈 2026.06.19 23
329 SOPS Secret 복구와 ArgoCD root Application 적용 김영훈 2026.06.18 28
328 복구 런북 초반 누락 사항 정리 김영훈 2026.06.17 15
327 CoreDNS로 GitLab Registry 내부 주소 고정 김영훈 2026.06.17 19
326 ArgoCD와 GitOps 구조 준비 김영훈 2026.06.16 16
325 SOPS age로 Kubernetes Secret 암복호화 김영훈 2026.06.15 23
324 yeonghoon.kim 배포 파일을 Helm Chart로 전환 [1] 김영훈 2026.06.12 18
323 Docker Compose 서비스를 Kubernetes로 이전(깃랩 도커 저장소 필요) [2] 김영훈 2026.06.10 20
322 Kubernetes 기본 클러스터, ingress-nginx 설치 김영훈 2026.06.09 15
321 DGX Kubernetes 구성 계획 김영훈 2026.06.08 25
320 2026년 일본 여행(21일) 요약 김영훈 2026.06.02 17
쓰기 태그
 첫 페이지 1 2 3 4 5 6 7 8 9 10 끝 페이지