diff --git a/modules/k3s-docker/main.tf b/modules/k3s-docker/main.tf index 274b1ee7c4..3a7bddf9b5 100644 --- a/modules/k3s-docker/main.tf +++ b/modules/k3s-docker/main.tf @@ -83,48 +83,23 @@ server: ] } -resource "kubernetes_manifest" "app_of_apps" { - provider = kubernetes-alpha - - manifest = { - "apiVersion" = "argoproj.io/v1alpha1" - "kind" = "Application" - "metadata" = { - "name" = "apps" - "namespace" = "argocd" - "annotations" = { - "argocd.argoproj.io/sync-wave" = "5" - } - } - "spec" = { - "project" = "default" - "source" = { - "path" = "argocd/apps" - "repoURL" = var.repo_url - "targetRevision" = var.target_revision - "helm" = { - "parameters" = var.app_of_apps_parameters - "values" = templatefile("${path.module}/values.tmpl.yaml", - { - cluster_name = var.cluster_name, - base_domain = local.base_domain, - repo_url = var.repo_url, - target_revision = var.target_revision, - } - ) - } - } - "destination" = { - "namespace" = "default" - "server" = "https://kubernetes.default.svc" - } - "syncPolicy" = { - "automated" = { - "selfHeal" = true - } +resource "helm_release" "app_of_apps" { + name = "app-of-apps" + chart = "${path.module}/../../argocd/app-of-apps" + namespace = "argocd" + dependency_update = true + create_namespace = true + + values = [ + templatefile("${path.module}/values.tmpl.yaml", + { + cluster_name = var.cluster_name, + base_domain = local.base_domain, + repo_url = var.repo_url, + target_revision = var.target_revision, } - } - } + ) + ] depends_on = [ helm_release.argocd, @@ -133,7 +108,7 @@ resource "kubernetes_manifest" "app_of_apps" { resource "null_resource" "wait_for_vault" { depends_on = [ - kubernetes_manifest.app_of_apps, + helm_release.app_of_apps, ] provisioner "local-exec" {