EKS ArgoCD 구성

문학적인유사성·2023년 6월 12일
0

뎁옵깃옵쿠베

목록 보기
9/46
post-thumbnail

설치

ArgoCD 공식문서

HA for production

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/ha/install.yaml

Stable

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

ArgoCD CLI

CLI install 공식문서

wget https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
cp argocd-linux-amd64 /usr/local/bin/argocd
chomd +x /usr/local/bin/argocd

argocd version
argocd: v2.7.4+a33baa3
  BuildDate: 2023-06-05T19:16:50Z
  GitCommit: a33baa301fe61b899dc8bbad9e554efbc77e0991
  GitTreeState: clean
  GoVersion: go1.19.9
  Compiler: gc
  Platform: linux/amd64
FATA[0000] Argo CD server address unspecified

kubectl apply -n argocd -f install.yaml

아아 중간에 노드가 리소스 모자라다고 pod가 펜딩되서...^^:;
eksctl anywhere upgrade cluster 해줌.

내 벨레로 어디갔어..
pending만 보면 눈물 나는 병이 생길꺼만 같다...

고생하고 나면 이렇게 다 뜬다..
eksanywhere에서는 metalLB를 사용해서 그냥 서비스타입을 LB로 바꿔버렸다.

EKS에서 alb controller로 올릴때

svc타입 변경

kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "NodePort"}}'

ingress 생성

aws alb controller를 사용하는 경우 grpc 때문에 따로 추가해야되는 것이 있었다.
아래와 같이 추가해주면 된다.

  • 인터넷으로 들어올때 https로 들어옴
  • CLI로 접속할때 gprc로 들어옴
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: argocd
  name: argocd-ingress
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
    alb.ingress.kubernetes.io/load-balaner-name: yusa-argocd
    alb.ingress.kubernetes.io/conditions.argogrpc: |
         [{"field":"http-header","httpHeaderConfig":{"httpHeaderName": "Content-Type", "values":["application/grpc"]}}]
    alb.ingress.kubernetes.io/backend-protocol: HTTPS
    alb.ingress.kubernetes.io/target-type: instance
    alb.ingress.kubernetes.io/ssl-redirect: '443'
    alb.ingress.kubernetes.io/tags: app=argo
    alb.ingress.kubernetes.io/certificate-arn: ${자신의 ACM 서티 arn 넣기}
spec:
  rules:
    - host: argocd.XXX.XXX #만약에 서티 안쓰고 싶으면 그냥 이부분 빈칸으로 주면됨.
      http:
        paths:
          - path: /
            backend:
              service:
                name: argogrpc
                port:
                  number: 443
            pathType: Prefix
          - path: /*
            backend:
              service:
                name: argocd-server
                port:
                  number: 443
            pathType: ImplementationSpecific
  tls:
    - hosts:
        - argocd.XXX.XXX

grpc 서비스 만들기

apiVersion: v1
kind: Service
metadata:
  annotations:
    alb.ingress.kubernetes.io/backend-protocol-version: GRPC 
  labels:
    app: argogrpc
  name: argogrpc
  namespace: argocd
spec:
  ports:
  - name: "443"
    port: 443
    protocol: TCP
    targetPort: 8080
  selector:
    app.kubernetes.io/name: argocd-server
  sessionAffinity: None
  type: NodePort

확인

아래와같이 두개의 타겟그룹 모두 healthy가 된다!


307 오류 해결

https://github.com/argoproj/argo-cd/discussions/8199 깃허브 링크

http 사용불가

무조건 연결이 https로 설정되야함.

비밀번호 확인 후 업데이트

argocd admin initial-password -n argocd
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo

CLI 로그인

[root@ip-10-1-8-104 argoCD]# argocd login ${내 도메인넣기}
Username: admin
Password:
'admin:login' logged in successfully
Context '도메인뜬다' updated

결과

아래와같이 버전이 나오게됨!

[root@ip-10-1-8-104 argoCD]# argocd version
argocd: v2.7.7+4650bb2
  BuildDate: 2023-07-05T20:02:35Z
  ...
  Platform: linux/amd64
argocd-server: v2.7.6+00c914a.dirty
  BuildDate: 2023-06-20T20:51:13Z
  ...
 

0개의 댓글