おうちK8s構築 - ArgoCD install編

https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/#helm

helmでinstallする。argocd自体のHA構成も設定によっては可能らしい(今回は行わない)


ArgoCD自体のinstallはArgoCDでは管理できないのでhelmfileで管理することにしてみる

releases:
- name: argocd
namespace: argocd
chart: argo/argo-cd
version: 7.7.22

一旦valuesで何もカスタマイズせず、argocdのversionのみを指定する。これを他のmanifestと同じrepoで管理することでArgoCD自体の情報の保存を行う。


install後のdefault password変更

https://argo-cd.readthedocs.io/en/stable/getting_started/

に従って、初期パスワードを取得する(kubeclt get secretでも良い)

argocd admin initial-password -n argocd


この状態でport-forwardしてブラウザからlocalhost:8081にアクセスする(portは各自適宜変更して良い)

kubectl port-forward svc/argocd-server -n argocd 8081:443


port-forwardした状態でargocd cliのログイン

argocd login localhost:8081


passwordの更新

argocd account update-password


ArgoCDにapp of appsでアプリケーションをデプロイする

https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#app-of-apps

に従ってセットアップする


まず、argocdがprivate repositoryにアクセスできるようにgithub appを作成し、対象となるmanifest repositoryにinstallする。

この状態ArgoCD上のレポジトリ追加の画面(e.g. https://localhost:8081/settings/repos)からレポジトリを追加する。

Connection StatusがSuccessfulとなっていればArgoCDがレポジトリを参照することができている。


(事前にsealed-secretsをinstallする子アプリケーションと、その中身を用意する)


https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/

app-of-apps 親アプリケーションは↑に従って作成する。

argocd app create apps \
--dest-namespace argocd \
--dest-server https://kubernetes.default.svc \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path apps
argocd app sync apps

完了。移行同様にdeployを行うことができる。

Related Articles