[Argo CD] helmfile / helm-secretsを使う
The Argo CD "repo server" component is in charge of building Kubernetes manifests based on some source files from a Helm, OCI, or git repository. When a config management plugin is correctly configured, the repo server may delegate the task of building manifests to the plugin.
3つのステップ
Write the plugin configuration file
以下の理由で-q
をつける
The generate command runs in the Application source directory each time manifests are generated. Standard output must be ONLY valid Kubernetes Objects in either YAML or JSON. A non-zero exit code will fail manifest generation.
To write log messages from the command, write them to stderr, it will always be displayed.
Error output will be sent to the UI, so avoid printing sensitive information (such as secrets).
プラグインなしでHelmチャートを処理する場合--include-crds
はデフォルトでtrueであるため(またAppのspecでskipCrds
も使わないため)--include-crds
もつける
Place the plugin configuration file in the sidecar
↑のvaluesで作られるConfigMapをvolumeに
volumeをvolume mount
Register the plugin sidecar
To install a plugin, patch argocd-repo-server to run the plugin container as a sidecar, with argocd-cmp-server as its entrypoint. You can use either off-the-shelf or custom-built plugin image as sidecar image.
サイドカーにはhelmfile
イメージを使う
helmfile
/ helm-diff
/ helm-git
/ helm-s3
/ helm-secrets
が最初から入っている
argocd-cmp-server as its entrypoint
repo-serverにもともと存在するinit containerでvar-files
volumeにバイナリをコピーしている
なので、extra containerにvar-files
をマウントすると、
そこに置いてあるargocd-cmp-server
を起動できる