Kubernetes – ArgoCD 설치

By | 2022년 10월 28일
Table of Contents

Kubernetes – ArgoCD 설치

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

타입을 NodePort 로 변경해준다.

kubectl edit svc argocd-server -n argocd
---------------------------
spec:
  clusterIP: 10.107.7.97
  clusterIPs:
  - 10.107.7.97
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: http
    port: 80
    nodePort: 30100            # 여기
    targetPort: 8080
 - name: https
   port: 443
   protocol: TCP
   targetPort: 8080
  selector:
    app.kubernetes.io/name: argocd-server
  sessionAffinity: None
  type: NodePort                # 여기
---------------------------
kubectl get svc argocd-server -n argocd

https://worker node IP:30100/ 로 접속할 수 있다.

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

admin/<위에서 생성한 비밀번호> 를 이용해 로그인할 수 있다.

Disable internal TLS

ingress 에서 https 인증을 처리하는 경우, argocd 의 https 강제실행을 중지시켜야 할 필요가 있다.

아래 명령으로 https 전환이 강제되는 것을 확인할 수 있다.

skyer9@notebook:~/work/cert2$ kubectl get svc -n argocd
NAME                                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
argocd-server                             ClusterIP   10.98.113.43     <none>        80/TCP,443/TCP               7d22h

curl http://10.98.113.43/
<a href="https://10.98.113.43/">Temporary Redirect</a>.

server.insecure: "true" 을 추가해 준다.

kubectl edit cm argocd-cmd-params-cm -n argocd

......
apiVersion: v1
data:
  server.insecure: "true"
......

생성되어 있는 Pod 를 삭제한다.

kubectl get pod -n argocd
kubectl delete pod argocd-server-7b4888c795-qkm4n -n argocd
kubectl get pod -n argocd
kubectl get svc -n argocd
curl http://10.98.113.43/

답글 남기기