2.4. 在 Argo CD CR 中启用配置管理插件
Argo CD 支持作为内置配置管理工具,支持 Helm、Jsonnet 和 Kustomize。要使用不同的配置管理工具,或者启用内置的配置管理工具未提供的功能,您可以使用配置管理插件(CMP)。
在 Argo CD 中,CMP 指定为 Argo CD repo 服务器容器的 sidecar 容器。如需更多信息,请参阅"Config 管理插件"。
在 Red Hat OpenShift GitOps Operator 中,您可以将 Config Management 插件配置为 Argo CD 自定义资源(CR)中的 sidecar 容器。配置 sidecar 容器时,您可以指定一个现成或自定义构建的容器镜像。如果没有指定镜像,系统会使用与插件的 repo 服务器相同的镜像。
要在 Red Hat OpenShift GitOps Operator 中配置 sidecar 容器,请在 Argo CD CR 中添加 .spec.repo.sidecarContainers 键。
配置管理插件配置示例
apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
name: <my_argocd>
spec:
repo:
sidecarContainers:
- name: <my_cmp>
command: [/var/run/argocd/argocd-cmp-server]
image: <my_image>
securityContext:
runAsNonRoot: <true>
runAsUser:
volumeMounts:
- mountPath: /var/run/argocd
name: <var_files>
- mountPath: /home/argocd/cmp-server/plugins
name: plugins
- mountPath: /tmp
name: tmp
- mountPath: /home/argocd/cmp-server/config/plugin.yaml
subPath: <plugin.yaml>
name: <cmp_plugin>