ArgoCD로 헬름 배포하기

문학적인유사성·2023년 7월 16일
0

뎁옵깃옵쿠베

목록 보기
31/46

스터디원들은 폰노이만
더 열심히 해야지 도움이될수있도록ㅋㅋ...

공식문서... 진짜 설명 거지같아서 스터디원 분들이랑 너무 많은 삽질을 했다.. ㅠㅠ 역시 폰노이만들이다... 더 열심히하자 ㅠ

참고

Beta Feature
Specifying multiple sources for an application is a beta feature. The UI and CLI still generally behave as if only the first source is specified. Full UI/CLI support will be added in a future release. This feature is subject to change in backwards incompatible ways until it is marked stable.

argocd 헬름 배포하기

argocd 로그인

argocd login ${argocd url}
Username: ~~~
Password: ****
'admin:login' logged in successfully
Context '${argocd url}' updated

argocd cli 사용해서 app 만들기

  1. 하기전에 깃 등록이 되어있어야함! (로그인 필요 ), 나는 ui들어가서 깃등록해줬음
  2. 해당 깃에 prometheus-values.yaml 넣고 필요한 value 채워넣기
    만약 안된다면 helm pull으로 받아서 해당 벨류 확인해보는 것 추천 프로메테우스를 해당 벨류를 넣고 한번 만들어보면 오류를 알수있다 yaml에서 잘못 오타내서 찾는데 한참걸림
  3. destination 넣기
  4. kubectl create ns prometheus
  5. argocd app create kube-prometheus-stack -f prometheus.yaml
공식 다큐 예시
apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  sources:
  - repoURL: 'https://prometheus-community.github.io/helm-charts'
    chart: prometheus
    targetRevision: 15.7.1
    helm:
      valueFiles:
      - $values/charts/prometheus/values.yaml
  - repoURL: 'https://git.example.gom/org/value-files.git'
    targetRevision: dev
    ref: values
적용
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kube-prometheus-stack
spec:
  sources:
    - chart: kube-prometheus-stack
      helm:
        valueFiles:
          - $values/prometheus-values.yaml
      repoURL: https://prometheus-community.github.io/helm-charts
      targetRevision: ${사용하고싶은 프로메테우스 버전 넣기}
    - repoURL: ${내 깃위치 넣기}
      ref: values
      targetRevision: HEAD
  destination:
    server: https://kubernetes.default.svc
    namespace: prometheus
  syncPolicy:
    syncOptions:
    - ServerSideApply=true

결과

argocd가 깃 레포에서 헬름차트를 가져와서 프로메테우스. 알터 메니저등 필요한 것 올라온것을 확인할수있다. ( 아래에 엄청 길게.. 쭉쭉 생김)

values에 ingress도 넣어두면 alb controller가 ingress도 알아서 만들어주는 것을 확인할수있다.

그라파나는 json으로 적용해주었다

뜬금 대쉬보드 추천 :
템플릿 ID:9797, https://grafana.com/orgs/nalbam
Kubernetes Cluster - Prometheus


오류

Argo error creating application: the server could not find the requested resource (post applications.argoproj.io)

여기저기 다니면서 계속 확인해보니 crds가 제대로 설치되지않은 문제였음
crds 재설치를 찾아서하는 것은 무리라고 깨닫고, 지우고 재설치하여 해결함.

argocd filnalizers 오류 및 namespace terminating 오류

아래와 같이 명령어로 해결함
강제로 날려버리기~

kubectl proxy &
kubectl get ns argocd -o json > argocd.json
sed -i '/"kubernetes"/d' ./argocd.json
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/argocd/finalize

참고링크

https://shortstories.gitbook.io/studybook/kubernetes/undefined/kubernetes-namespace-phase-terminating

https://togomi.tistory.com/7

https://mateon.tistory.com/86

0개의 댓글