fix: remove typo from flux taskfile, make flux/config/cluster.yaml include all kustomizations for the cluster

This commit is contained in:
SeanOMik 2024-05-03 21:31:55 -04:00
parent 42b9f3c530
commit 078eaa2498
Signed by: SeanOMik
GPG Key ID: FEC9E2FC15235964
3 changed files with 79 additions and 97 deletions

View File

@ -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:

View File

@ -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

View File

@ -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
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