使用 Argo CD 将 git 与 bitnami/wordpress 同步

时间:2021-07-07 09:16:56

标签: wordpress kubernetes cloud bitnami argocd

我刚刚使用 Argo CD 和 Helm 选项安装了 bitnami/wordpress 图像。现在我的部署与 helm 同步。例如,我现在可以将它与我的 git 存储库同步吗?我的意思是将当前的 Wordpress 文件推送到 git 并与之同步?因为那样我可以修改我需要的插件文件。 Bitnami/wordpress 是非根容器,所以我无法创建 sftp 帐户。

怎么做?

1 个答案:

答案 0 :(得分:1)

您可以通过将 sidecar 容器添加到执行 git 同步的 WordPress 容器来实现。

为此,您必须将以下值添加到 ArgoCD 中的 WordPress 应用程序:

function confirmDelete() {
    return confirm('Are you sure you want to delete this record?');
}

这将在您的 Wordpress pod 中配置一个共享 wordpress-data 卷的辅助容器。变化

注意:在 ArgoCD 中执行应用程序同步时,您还需要提供值 sidecars: - name: git-sync image: bitnami/git:2.32.0-debian-10-r24 imagePullPolicy: IfNotPresent command: - /bin/bash - -ec - | [[ -f "/opt/bitnami/scripts/git/entrypoint.sh" ]] && source "/opt/bitnami/scripts/git/entrypoint.sh" while true; do #Add here your commands to synchronize the git repository with /bitnami/wordpress/wp-content sleep 60 done volumeMounts: - mountPath: /bitnami/wordpress name: wordpress-data subPath: Wordpress mariadb.auth.passwordmariadb.auth.rootPassword