diff --git a/charts/infrastructure/Chart.yaml b/charts/infrastructure/Chart.yaml index 0354599..40b038e 100644 --- a/charts/infrastructure/Chart.yaml +++ b/charts/infrastructure/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 name: cluster description: An infrastructure collection of manifests for homelab type: application -version: 0.1.7 +version: 0.1.8 diff --git a/charts/infrastructure/templates/argocd-appset.yml b/charts/infrastructure/templates/argocd-appset.yml new file mode 100644 index 0000000..fb1b71b --- /dev/null +++ b/charts/infrastructure/templates/argocd-appset.yml @@ -0,0 +1,31 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: apps + namespace: "{{ .Values.ns.argocd }}" +spec: + generators: + - git: + directories: + - path: charts/apps/* + repoURL: git@github.com:{{ .Values.gitops.repo }}.git + revision: "{{ .Values.gitops.revision }}" + template: + metadata: {} + spec: + destination: {} + project: "" + template: + metadata: + name: "{{`apps-{{path.basename}}`}}" + spec: + destination: + namespace: "{{`{{path.basename}}`}}" + server: https://kubernetes.default.svc + project: default + revisionHistoryLimit: 10 + source: + path: '{{`{{path}}`}}' + repoURL: git@github.com:{{ .Values.gitops.repo }}.git + targetRevision: "{{ .Values.gitops.revision }}" \ No newline at end of file diff --git a/charts/infrastructure/templates/argocd-repo.yaml b/charts/infrastructure/templates/argocd-repo.yaml new file mode 100644 index 0000000..cb935dd --- /dev/null +++ b/charts/infrastructure/templates/argocd-repo.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: Secret +metadata: + labels: + argocd.argoproj.io/secret-type: repository + name: homelab + namespace: plugin-argo-cd +type: Opaque +stringData: + name: homelab + type: git + username: git + url: git@github.com:{{ .Values.gitops.repo }}.git +data: + sshPrivateKey: "{{ .Values.gitops.sshkey | b64enc }}" \ No newline at end of file diff --git a/tf-argocd.tf b/tf-argocd.tf deleted file mode 100644 index bde776f..0000000 --- a/tf-argocd.tf +++ /dev/null @@ -1,42 +0,0 @@ -resource "argocd_repository" "homelab" { - name = "homelab" - repo = "git@github.com:asosnovsky/homelab.git" - username = "git" - ssh_private_key = var.ssh_key - insecure = true -} - -resource "argocd_application_set" "apps" { - metadata { - name = "apps" - } - spec { - generator { - git { - repo_url = argocd_repository.homelab.repo - revision = "v2" - file { - path = "charts/apps/*" - } - } - } - template { - metadata { - name = "apps-{{path.basename}}" - } - - spec { - source { - repo_url = argocd_repository.homelab.repo - target_revision = "v2" - path = "{{path}}" - } - - destination { - server = "https://kubernetes.default.svc" - namespace = "{{path.basename}}" - } - } - } - } -} diff --git a/tf-modules.tf b/tf-modules.tf index 5696aa4..1afeab8 100644 --- a/tf-modules.tf +++ b/tf-modules.tf @@ -52,6 +52,7 @@ module "k8s-helm-charts" { "server.insecure" = true "server.basehref" = "/" "server.rootpath" = "" + "server.disable.auth" : true } } crds = { diff --git a/tf-provider.tf b/tf-provider.tf index 646ac35..9a87cdd 100644 --- a/tf-provider.tf +++ b/tf-provider.tf @@ -24,10 +24,6 @@ terraform { source = "cloudflare/cloudflare" version = "5.2.0" } - argocd = { - source = "argoproj-labs/argocd" - version = "7.5.2" - } } } @@ -43,6 +39,3 @@ provider "http" {} provider "cloudflare" { api_token = var.cloudflare.api_token } -provider "argocd" { - core = true -}