我正在尝试使用 ArgoCD 的掌舵图在我的 k8s 集群中部署 ArgoCD。我使用 Terraform 部署所有内容。现在我想从 ArgoCD 更改配置文件,以便它可以连接到我的私人仓库。当我在集群中运行 ArgoCD 之后使用 kubectl 手动更改文件时,它可以工作,但是当我尝试使用 terraform 时,我收到消息Error: configmaps "argocd-cm" already exists
,这意味着我无法覆盖由 ArgoCD 创建的配置映射。如何更改这些变量?
地形
resource "kubernetes_namespace" "argocd" {
metadata {
name = "argocd"
}
}
resource "kubernetes_secret" "argocd_registry_secret" {
metadata {
name = "argocd-repo-credentials"
namespace = "argocd"
}
data = {
username = "USERNAME"
password = "PASSWORD"
}
}
data "helm_repository" "argoproj" {
name = "argoproj"
url = "https://argoproj.github.io/argo-helm"
}
resource "helm_release" "argocd" {
name = "argocd"
chart = "argoproj/argo-cd"
version = "2.3.5"
namespace = kubernetes_namespace.argocd.metadata[0].name
timeout = 600
}
resource "kubernetes_config_map" "argocd-cm" {
depends_on = [helm_release.argocd]
metadata {
name = "argocd-cm"
namespace = "argocd"
}
data = {
config = file("${path.module}/configs/ingress/argo-configmap.yaml")
}
}