diff --git a/argocd/app-of-apps/Chart.yaml b/argocd/app-of-apps/Chart.yaml new file mode 100644 index 0000000000..21cfe49977 --- /dev/null +++ b/argocd/app-of-apps/Chart.yaml @@ -0,0 +1,4 @@ +--- +apiVersion: "v2" +name: "app-of-apps" +version: "0" diff --git a/argocd/app-of-apps/templates/apps.yaml b/argocd/app-of-apps/templates/apps.yaml new file mode 100644 index 0000000000..6817725529 --- /dev/null +++ b/argocd/app-of-apps/templates/apps.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + annotations: + argocd.argoproj.io/sync-wave: "5" + name: apps + namespace: argocd +spec: + project: default + source: + path: argocd/apps + repoURL: {{ .Values.spec.source.repoURL }} + targetRevision: {{ .Values.spec.source.targetRevision }} + helm: + values: | + {{ toYaml .Values | nindent 8 }} + destination: + namespace: default + server: {{ .Values.spec.destination.server }} + syncPolicy: + automated: + selfHeal: true diff --git a/argocd/app-of-apps/values.yaml b/argocd/app-of-apps/values.yaml new file mode 100644 index 0000000000..ec6a7ca8a6 --- /dev/null +++ b/argocd/app-of-apps/values.yaml @@ -0,0 +1,7 @@ +--- +spec: + destination: + server: https://kubernetes.default.svc + source: + repoURL: ... + targetRevision: HEAD diff --git a/examples/k3os-libvirt-demo-app/terraform/main.tf b/examples/k3os-libvirt-demo-app/terraform/main.tf index 3bb4a2f546..3fb95046fa 100644 --- a/examples/k3os-libvirt-demo-app/terraform/main.tf +++ b/examples/k3os-libvirt-demo-app/terraform/main.tf @@ -1,6 +1,6 @@ locals { repo_url = "https://github.com/camptocamp/camptocamp-devops-stack.git" - target_revision = "master" + target_revision = "HEAD" base_domain = module.cluster.base_domain kubernetes_host = module.cluster.kubernetes_host @@ -11,7 +11,7 @@ locals { } module "cluster" { - source = "git::https://github.com/camptocamp/camptocamp-devops-stack.git//modules/k3os-libvirt?ref=master" + source = "git::https://github.com/camptocamp/camptocamp-devops-stack.git//modules/k3os-libvirt?ref=HEAD" cluster_name = terraform.workspace node_count = 1 @@ -20,11 +20,14 @@ module "cluster" { target_revision = local.target_revision } -provider "kubernetes-alpha" { - host = local.kubernetes_host - username = local.kubernetes_username - password = local.kubernetes_password - cluster_ca_certificate = local.kubernetes_cluster_ca_certificate +provider "helm" { + kubernetes { + insecure = true + host = local.kubernetes_host + username = local.kubernetes_username + password = local.kubernetes_password + load_config_file = false + } } provider "vault" { @@ -33,47 +36,28 @@ provider "vault" { skip_tls_verify = true } -resource "kubernetes_manifest" "project_apps" { - provider = kubernetes-alpha - - manifest = { - "apiVersion" = "argoproj.io/v1alpha1" - "kind" = "Application" - "metadata" = { - "name" = "project-apps" - "namespace" = "argocd" - "annotations" = { - "argocd.argoproj.io/sync-wave" = "15" - } - } - "spec" = { - "project" = "default" - "source" = { - "path" = "examples/k3s-docker-demo-app/argocd/project-apps" - "repoURL" = local.repo_url - "targetRevision" = local.target_revision - "helm" = { - "values" = <