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