LoginSignup
1
0

More than 1 year has passed since last update.

ArgoCDにaws-loadbalancer-controllerのHelmチャートを登録するサンプル

Posted at
  • ArgoCDをクラスタに展開完了すると、kind: Application のカスタムリソースが作成される
  • そのため、マニフェストファイルをkubectl applyすれば、自動的にArgoCDにリソースが登録されるようになる
  • ArgoCDでは、Helm、kustomize,jsonnetなども扱うことができる

How it works¶
Argo CD follows the GitOps pattern of using Git repositories as the source of truth for defining the desired application state. Kubernetes manifests can be specified in several ways:
kustomize applications
helm charts
jsonnet files
Plain directory of YAML/json manifests
Any custom config management tool configured as a config management plugin
https://argo-cd.readthedocs.io/en/stable/

マニフェストファイルを用意する

helm installコマンド

helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
  -n kube-system \
  --set clusterName=cluster-name \
  --set serviceAccount.create=false \
  --set serviceAccount.name=aws-load-balancer-controller 

マニフェストファイル

argocd-aws-loadbalancer-controller.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: aws-loadbalancer-controller
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/aws/eks-charts ← リポジトリURL
    path: stable/aws-load-balancer-controller ← リポジトリURLのルートから対象リソースがあるまでのパス
    helm:
      parameters:
      - name: "clusterName" ← --setで指定しているパラメータ
        value: "vamdemic-stg-eks-cluster" ← --setで指定しているパラメータ
      - name: "serviceAccount.create"
        value: "false"
      - name: "serviceAccount.name"
        value: "aws-load-balancer-controller"
      releaseName: aws-load-balancer-controller
  destination:
    server: https://kubernetes.default.svc
    namespace: kube-system
  syncPolicy:
    automated:
      prune: true
  ignoreDifferences:
  - group: ""
    kind: Service
    jsonPointers:
    - /spec/clusterIP

デプロイ

kubectl apply -f manifests/argocd-aws-loadbalancer-controller.yaml

確認

kubectl -n argocd get application
NAME                          SYNC STATUS   HEALTH STATUS
aws-loadbalancer-controller   Synced        Healthy
guestbook                     Synced        Healthy

きれいにデプロイがかかると、GUIからはこのように見える

image.png

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0