From 078eaa2498391af8c94db7ff97a684ee51446c47 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 3 May 2024 21:31:55 -0400 Subject: [PATCH] fix: remove typo from flux taskfile, make flux/config/cluster.yaml include all kustomizations for the cluster --- .taskfiles/Flux/Taskfile.yaml | 2 +- cluster/base.yaml | 91 -------------------------------- cluster/flux/config/cluster.yaml | 83 +++++++++++++++++++++++++++-- 3 files changed, 79 insertions(+), 97 deletions(-) delete mode 100644 cluster/base.yaml diff --git a/.taskfiles/Flux/Taskfile.yaml b/.taskfiles/Flux/Taskfile.yaml index b5db0e3..10a1392 100644 --- a/.taskfiles/Flux/Taskfile.yaml +++ b/.taskfiles/Flux/Taskfile.yaml @@ -11,7 +11,7 @@ tasks: desc: Bootstrap Flux into a Kubernetes cluster cmds: - kubectl apply --server-side --kustomize {{.CLUSTER_DIR}}/bootstrap/flux - - sops --decrypt {{.CLUSTER_SECRET_SOPS_FILE}} | kubectl apply --server-side --filename -z + - sops --decrypt {{.CLUSTER_SECRET_SOPS_FILE}} | kubectl apply --server-side --filename - - sops --decrypt {{.GITHUB_DEPLOY_KEY_FILE}} | kubectl apply --server-side --filename - - kubectl apply --server-side --kustomize {{.CLUSTER_DIR}}/flux/config preconditions: diff --git a/cluster/base.yaml b/cluster/base.yaml deleted file mode 100644 index 581fccf..0000000 --- a/cluster/base.yaml +++ /dev/null @@ -1,91 +0,0 @@ -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: cluster-secrets - namespace: flux-system -spec: - timeout: 5m - interval: 10m - path: ./cluster/secrets - prune: true - sourceRef: - kind: GitRepository - name: home-cluster - decryption: - provider: sops - secretRef: - name: sops-gpg ---- -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: crds - namespace: flux-system -spec: - timeout: 5m - interval: 10m - path: ./cluster/crds - prune: true - sourceRef: - kind: GitRepository - name: home-cluster ---- -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: core - namespace: flux-system -spec: - timeout: 5m - interval: 10m - dependsOn: - - name: cluster-secrets - - name: crds - path: ./cluster/core - prune: true - sourceRef: - kind: GitRepository - name: home-cluster - decryption: - provider: sops - secretRef: - name: sops-gpg - postBuild: - substitute: {} - substituteFrom: - - kind: ConfigMap - name: cluster-settings - - kind: Secret - name: cluster-secrets ---- -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json -apiVersion: kustomize.toolkit.fluxcd.io/v1 -kind: Kustomization -metadata: - name: apps - namespace: flux-system -spec: - timeout: 5m - interval: 10m - dependsOn: - - name: cluster-secrets - - name: core - path: ./cluster/apps - prune: true - sourceRef: - kind: GitRepository - name: home-cluster - decryption: - provider: sops - secretRef: - name: sops-gpg - postBuild: - substitute: {} - substituteFrom: - - kind: ConfigMap - name: cluster-settings - - kind: Secret - name: cluster-secrets \ No newline at end of file diff --git a/cluster/flux/config/cluster.yaml b/cluster/flux/config/cluster.yaml index 37f802b..78654a9 100644 --- a/cluster/flux/config/cluster.yaml +++ b/cluster/flux/config/cluster.yaml @@ -17,17 +17,90 @@ spec: apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster + name: cluster-secrets namespace: flux-system spec: - interval: 10m0s - path: ./cluster/base.yaml + timeout: 5m + interval: 10m + path: ./cluster/secrets prune: true sourceRef: kind: GitRepository name: home-cluster - # Support decryption decryption: provider: sops secretRef: - name: sops-gpg \ No newline at end of file + name: sops-gpg +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: crds + namespace: flux-system +spec: + timeout: 5m + interval: 10m + path: ./cluster/crds + prune: true + sourceRef: + kind: GitRepository + name: home-cluster +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: core + namespace: flux-system +spec: + timeout: 5m + interval: 10m + dependsOn: + - name: cluster-secrets + - name: crds + path: ./cluster/core + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: apps + namespace: flux-system +spec: + timeout: 5m + interval: 10m + dependsOn: + - name: cluster-secrets + - name: core + path: ./cluster/apps + prune: true + sourceRef: + kind: GitRepository + name: home-cluster + decryption: + provider: sops + secretRef: + name: sops-gpg + postBuild: + substitute: {} + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets \ No newline at end of file