TroubleShooting/Devops Issue
[트러블슈팅] ArgoCD Notification Controller 가 이상해요
JMcunst
2025. 3. 14. 19:25
728x90
서론
EKS 환경에서 배포되어 운영 중인 ArgoCD를 모니터링하는 과정에서 argocd-notifications-controller 파드안의 컨테이너 하나가 계속해서 restart 되고 있는 현상이 발견되었다.
해결하기
간단한 확인
일단 파드의 이벤트를 확인한다.
kubectl describe pod argocd-notifications-controller-79f4bf5bdd-5zjtn -n argocd
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning BackOff 4s (x131454 over 2d) kubelet Back-off restarting failed container notifications-controller in pod argocd-notifications-controller-79f4bf5bdd-5zjtn_argocd(2349b8d0-bf62-4cfe-9a14-e6c91e87f283)
OOMKilled, CrashLoopBackOff 이라던지 failed to connect와 같은 이슈는 보이지 않는다.
다만, 문제의 컨테이너가 확인된다. notification-controller 가 계속해서 리스타트 되고 있었다.
로그를 확인해보자.
kubectl logs argocd-notifications-controller-79f4bf5bdd-5zjtn -n argocd --all-containers=true
... 중략 ...
time="2025-03-13T00:50:02Z" level=info msg="Trigger on-sync-succeeded result: [{[0].zxM90Et6k4Elb1-fHdjtDJq0xR0 [app-sync-succeeded] true}]" app=argocd/[Service_Name]
time="2025-03-13T00:50:02Z" level=info msg="Notification about condition 'on-sync-succeeded.[0].1xM934t6k4Elb1-fHdjer2q0xR0' already sent to '{slack dev_build_states}'" app=argocd/[Service_Name]
time="2025-03-13T00:50:02Z" level=info msg="Processing completed" app=argocd/[Service_Name]
time="2025-03-13T00:45:52Z" level=info msg="ArgoCD Notifications Controller is starting" built="2024-03-28T15:02:45Z" commit=335875d13e014f2sq203873f4744182585f24746 namespace=argocd version=v2.10.5+335875d
time="2025-03-13T00:45:52Z" level=info msg="serving metrics on port 9001"
time="2025-03-13T00:45:52Z" level=info msg="loading configuration 9001"
time="2025-03-13T00:45:52Z" level=fatal msg="listen tcp 0.0.0.0:9001: bind: address already in use"
9001 포트가 이미 사용되고 있어서, notification-controller가 뜨지 못하고 있음을 확인할 수 있다.
점유 프로세스 찾기
그렇다면 누가 9001을 쓰고 있는지 확인할 수 있을까?
kubectl exec -it argocd-notifications-controller-79f4bf5bdd-5zjtn -n argocd -- ss -tulnp
Defaulted container "argocd-notifications-controller" out of: argocd-notifications-controller, notifications-controller
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "32a26b1ab796220e8206a921b0a3a2b0fece3952ca59b5cdda1bc5c3da07b372": OCI runtime exec failed: exec failed: unable to start container process: exec: "ss": executable file not found in $PATH: unknown
ss, netstat 등이 없다.
직접 접속을 일단 해보기로 하자.
exec kubectl exec -i -t -n argocd argocd-notifications-controller-79f4bf5bdd-5zjtn -c argocd-notifications-controller -- sh -c "clear; (bash || ash || sh)"
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "a13d31dbdfac7497b052c751b6a031e0c02d623b6ddd0c3dd6f60098b4e966f5": OCI runtime exec failed: exec failed: unable to start container process: exec: "sh": executable file not found in $PATH: unknown
Terminal will auto-close in 15 seconds ...
kubectl exec로 컨테이너 내부에 접속하려 했지만, 실행 가능한 쉘(sh, bash, ash)이 존재하지 않아서 실패한다..
포트 변경
그럼 일단은 9002로 포트를 바꾸고 Helm으로 재배포를 하자.
재배포 후 파드를 확인하면 컨테이너가 정상적으로 올라옴을 확인할 수 있다!
728x90