From 8907406bb6242baf4aa09513e0915608170b5a7a Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Tue, 16 Jan 2024 21:17:06 -0600 Subject: [PATCH] Added snapshot class, moved volsync, and removed cluster-apps- prefix to ks.yaml's. --- .../apps/cert-manager/cert-manager/ks.yaml | 6 ++-- kubernetes/apps/default/jellyfin/ks.yaml | 4 +-- kubernetes/apps/default/qbittorrent/ks.yaml | 2 +- kubernetes/apps/flux-system/add-ons/ks.yaml | 4 +-- kubernetes/apps/kube-system/cilium/ks.yaml | 2 +- .../apps/kube-system/metrics-server/ks.yaml | 2 +- kubernetes/apps/kyverno/kyverno/ks.yaml | 6 ++-- kubernetes/apps/network/cloudflared/ks.yaml | 2 +- kubernetes/apps/network/echo-server/ks.yaml | 2 +- kubernetes/apps/network/external-dns/ks.yaml | 8 ++--- kubernetes/apps/network/ingress-nginx/ks.yaml | 8 ++--- .../nvidia-device-plugin/ks.yaml | 2 +- .../rook-ceph/rook-ceph/app/helmrelease.yaml | 2 +- .../apps/security/external-secrets/ks.yaml | 12 +++---- kubernetes/apps/storage/kustomization.yaml | 2 ++ .../snapshot-controller/app/helmrelease.yaml | 33 +++++++++++++++++++ .../apps/storage/snapshot-controller/ks.yaml | 21 ++++++++++++ .../volsync/app/helmrelease.yaml | 0 .../volsync/app/kustomization.yaml | 0 .../apps/{system => storage}/volsync/ks.yaml | 4 +-- kubernetes/apps/system/kustomization.yaml | 1 - .../system/node-feature-discovery/ks.yaml | 2 +- kubernetes/apps/system/reloader/ks.yaml | 2 +- .../apps/system/snapshot-controller/ks.yaml | 2 +- 24 files changed, 92 insertions(+), 37 deletions(-) create mode 100644 kubernetes/apps/storage/snapshot-controller/app/helmrelease.yaml create mode 100644 kubernetes/apps/storage/snapshot-controller/ks.yaml rename kubernetes/apps/{system => storage}/volsync/app/helmrelease.yaml (100%) rename kubernetes/apps/{system => storage}/volsync/app/kustomization.yaml (100%) rename kubernetes/apps/{system => storage}/volsync/ks.yaml (86%) diff --git a/kubernetes/apps/cert-manager/cert-manager/ks.yaml b/kubernetes/apps/cert-manager/cert-manager/ks.yaml index 8f1229fa..d12c873a 100644 --- a/kubernetes/apps/cert-manager/cert-manager/ks.yaml +++ b/kubernetes/apps/cert-manager/cert-manager/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-cert-manager + name: cert-manager namespace: flux-system spec: interval: 10m @@ -18,7 +18,7 @@ spec: apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-cert-manager-issuers + name: cert-manager-issuers namespace: flux-system spec: interval: 10m @@ -29,4 +29,4 @@ spec: name: homelab wait: false dependsOn: - - name: cluster-apps-cert-manager + - name: cert-manager diff --git a/kubernetes/apps/default/jellyfin/ks.yaml b/kubernetes/apps/default/jellyfin/ks.yaml index 6a445602..b61ba41b 100644 --- a/kubernetes/apps/default/jellyfin/ks.yaml +++ b/kubernetes/apps/default/jellyfin/ks.yaml @@ -3,11 +3,11 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-jellyfin + name: jellyfin namespace: flux-system spec: dependsOn: - - name: cluster-apps-external-secrets-stores + - name: external-secrets-stores path: ./kubernetes/apps/default/jellyfin/app prune: true sourceRef: diff --git a/kubernetes/apps/default/qbittorrent/ks.yaml b/kubernetes/apps/default/qbittorrent/ks.yaml index 7d4f94a2..e85ab334 100644 --- a/kubernetes/apps/default/qbittorrent/ks.yaml +++ b/kubernetes/apps/default/qbittorrent/ks.yaml @@ -20,7 +20,7 @@ spec: dependsOn: - name: local-path-provisioner - name: volsync - - name: cluster-apps-external-secrets-stores + - name: external-secrets-stores # --- # # yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json # apiVersion: kustomize.toolkit.fluxcd.io/v1 diff --git a/kubernetes/apps/flux-system/add-ons/ks.yaml b/kubernetes/apps/flux-system/add-ons/ks.yaml index d893a4b8..ef8ec66e 100644 --- a/kubernetes/apps/flux-system/add-ons/ks.yaml +++ b/kubernetes/apps/flux-system/add-ons/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-flux-webhooks + name: flux-webhooks namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" @@ -20,7 +20,7 @@ spec: apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-flux-monitoring + name: flux-monitoring namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" diff --git a/kubernetes/apps/kube-system/cilium/ks.yaml b/kubernetes/apps/kube-system/cilium/ks.yaml index 2e22b200..b9adeed7 100644 --- a/kubernetes/apps/kube-system/cilium/ks.yaml +++ b/kubernetes/apps/kube-system/cilium/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-cilium + name: cilium namespace: flux-system spec: interval: 30m diff --git a/kubernetes/apps/kube-system/metrics-server/ks.yaml b/kubernetes/apps/kube-system/metrics-server/ks.yaml index 26a32508..6c0925a3 100644 --- a/kubernetes/apps/kube-system/metrics-server/ks.yaml +++ b/kubernetes/apps/kube-system/metrics-server/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-metrics-server + name: metrics-server namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" diff --git a/kubernetes/apps/kyverno/kyverno/ks.yaml b/kubernetes/apps/kyverno/kyverno/ks.yaml index 9400c9b0..115f8878 100644 --- a/kubernetes/apps/kyverno/kyverno/ks.yaml +++ b/kubernetes/apps/kyverno/kyverno/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-kyverno + name: kyverno namespace: flux-system spec: path: ./kubernetes/apps/kyverno/kyverno/app @@ -20,11 +20,11 @@ spec: apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-cluster-policies + name: cluster-policies namespace: flux-system spec: dependsOn: - - name: cluster-apps-kyverno + - name: kyverno path: ./kubernetes/apps/kyverno/kyverno/policies prune: true sourceRef: diff --git a/kubernetes/apps/network/cloudflared/ks.yaml b/kubernetes/apps/network/cloudflared/ks.yaml index 42bd86af..690d9093 100644 --- a/kubernetes/apps/network/cloudflared/ks.yaml +++ b/kubernetes/apps/network/cloudflared/ks.yaml @@ -13,7 +13,7 @@ spec: labels: app.kubernetes.io/name: *app dependsOn: - - name: cluster-apps-external-secrets-stores + - name: external-secrets-stores path: ./kubernetes/apps/network/cloudflared/app prune: false sourceRef: diff --git a/kubernetes/apps/network/echo-server/ks.yaml b/kubernetes/apps/network/echo-server/ks.yaml index 94e823c9..a3022b62 100644 --- a/kubernetes/apps/network/echo-server/ks.yaml +++ b/kubernetes/apps/network/echo-server/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-echo-server + name: echo-server namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" diff --git a/kubernetes/apps/network/external-dns/ks.yaml b/kubernetes/apps/network/external-dns/ks.yaml index aea45d41..75c3ab8f 100644 --- a/kubernetes/apps/network/external-dns/ks.yaml +++ b/kubernetes/apps/network/external-dns/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-externaldns-hsn-dev + name: externaldns-hsn-dev namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" @@ -16,13 +16,13 @@ spec: name: homelab wait: true dependsOn: - - name: cluster-apps-external-secrets-stores + - name: external-secrets-stores --- # yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-externaldns-jahanson-tech + name: externaldns-jahanson-tech namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" @@ -35,7 +35,7 @@ spec: name: homelab wait: true dependsOn: - - name: cluster-apps-external-secrets-stores + - name: external-secrets-stores --- # yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 diff --git a/kubernetes/apps/network/ingress-nginx/ks.yaml b/kubernetes/apps/network/ingress-nginx/ks.yaml index cc1fe108..6468d641 100644 --- a/kubernetes/apps/network/ingress-nginx/ks.yaml +++ b/kubernetes/apps/network/ingress-nginx/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-ingress-nginx-external + name: ingress-nginx-external namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" @@ -16,13 +16,13 @@ spec: name: homelab wait: true dependsOn: - - name: cluster-apps-cert-manager-issuers + - name: cert-manager-issuers --- # yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-ingress-nginx-internal + name: ingress-nginx-internal namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" @@ -35,4 +35,4 @@ spec: name: homelab wait: true dependsOn: - - name: cluster-apps-cert-manager-issuers + - name: cert-manager-issuers diff --git a/kubernetes/apps/nvidia-device-plugin/nvidia-device-plugin/ks.yaml b/kubernetes/apps/nvidia-device-plugin/nvidia-device-plugin/ks.yaml index 9add6db9..403bb44c 100644 --- a/kubernetes/apps/nvidia-device-plugin/nvidia-device-plugin/ks.yaml +++ b/kubernetes/apps/nvidia-device-plugin/nvidia-device-plugin/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-nvidia-device-plugin + name: nvidia-device-plugin namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" diff --git a/kubernetes/apps/rook-ceph/rook-ceph/app/helmrelease.yaml b/kubernetes/apps/rook-ceph/rook-ceph/app/helmrelease.yaml index 2f33795d..3d6add1e 100644 --- a/kubernetes/apps/rook-ceph/rook-ceph/app/helmrelease.yaml +++ b/kubernetes/apps/rook-ceph/rook-ceph/app/helmrelease.yaml @@ -1,5 +1,5 @@ --- -# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta2.json apiVersion: helm.toolkit.fluxcd.io/v2beta2 kind: HelmRelease metadata: diff --git a/kubernetes/apps/security/external-secrets/ks.yaml b/kubernetes/apps/security/external-secrets/ks.yaml index 8d1b8ef0..12583cbf 100644 --- a/kubernetes/apps/security/external-secrets/ks.yaml +++ b/kubernetes/apps/security/external-secrets/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-external-secrets + name: external-secrets namespace: flux-system spec: interval: 10m @@ -18,7 +18,7 @@ spec: apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-external-secrets-stores + name: external-secrets-stores namespace: flux-system spec: interval: 10m @@ -29,13 +29,13 @@ spec: name: homelab wait: true dependsOn: - - name: cluster-apps-external-secrets + - name: external-secrets --- # yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-external-secrets-cluster-secrets + name: external-secrets-cluster-secrets namespace: flux-system spec: interval: 10m @@ -46,5 +46,5 @@ spec: name: homelab wait: true dependsOn: - - name: cluster-apps-external-secrets - - name: cluster-apps-external-secrets-stores + - name: external-secrets + - name: external-secrets-stores diff --git a/kubernetes/apps/storage/kustomization.yaml b/kubernetes/apps/storage/kustomization.yaml index 3e7f3f59..d3585c1c 100644 --- a/kubernetes/apps/storage/kustomization.yaml +++ b/kubernetes/apps/storage/kustomization.yaml @@ -7,3 +7,5 @@ resources: - ./namespace.yaml # Flux-Kustomizations - ./local-path-provisioner/ks.yaml + - ./snapshot-controller/ks.yaml + - ./volsync/ks.yaml diff --git a/kubernetes/apps/storage/snapshot-controller/app/helmrelease.yaml b/kubernetes/apps/storage/snapshot-controller/app/helmrelease.yaml new file mode 100644 index 00000000..a200d10d --- /dev/null +++ b/kubernetes/apps/storage/snapshot-controller/app/helmrelease.yaml @@ -0,0 +1,33 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: snapshot-controller +spec: + interval: 30m + chart: + spec: + chart: snapshot-controller + version: 2.0.4 + sourceRef: + kind: HelmRepository + name: piraeus + namespace: flux-system + install: + crds: CreateReplace + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + crds: CreateReplace + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + controller: + serviceMonitor: + create: true + webhook: + enabled: false diff --git a/kubernetes/apps/storage/snapshot-controller/ks.yaml b/kubernetes/apps/storage/snapshot-controller/ks.yaml new file mode 100644 index 00000000..573c7be7 --- /dev/null +++ b/kubernetes/apps/storage/snapshot-controller/ks.yaml @@ -0,0 +1,21 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app snapshot-controller + namespace: flux-system +spec: + targetNamespace: storage + commonMetadata: + labels: + app.kubernetes.io/name: *app + path: ./kubernetes/main/apps/storage/snapshot-controller/app + prune: true + sourceRef: + kind: GitRepository + name: homelab + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/apps/system/volsync/app/helmrelease.yaml b/kubernetes/apps/storage/volsync/app/helmrelease.yaml similarity index 100% rename from kubernetes/apps/system/volsync/app/helmrelease.yaml rename to kubernetes/apps/storage/volsync/app/helmrelease.yaml diff --git a/kubernetes/apps/system/volsync/app/kustomization.yaml b/kubernetes/apps/storage/volsync/app/kustomization.yaml similarity index 100% rename from kubernetes/apps/system/volsync/app/kustomization.yaml rename to kubernetes/apps/storage/volsync/app/kustomization.yaml diff --git a/kubernetes/apps/system/volsync/ks.yaml b/kubernetes/apps/storage/volsync/ks.yaml similarity index 86% rename from kubernetes/apps/system/volsync/ks.yaml rename to kubernetes/apps/storage/volsync/ks.yaml index afe610a2..1c834eb1 100644 --- a/kubernetes/apps/system/volsync/ks.yaml +++ b/kubernetes/apps/storage/volsync/ks.yaml @@ -6,12 +6,12 @@ metadata: name: &appname volsync namespace: flux-system spec: - targetNamespace: system + targetNamespace: storage commonMetadata: labels: app.kubernetes.io/name: *appname interval: 10m - path: "./kubernetes/apps/system/volsync/app" + path: "./kubernetes/apps/storage/volsync/app" prune: true sourceRef: kind: GitRepository diff --git a/kubernetes/apps/system/kustomization.yaml b/kubernetes/apps/system/kustomization.yaml index 948b8349..bbfd6492 100644 --- a/kubernetes/apps/system/kustomization.yaml +++ b/kubernetes/apps/system/kustomization.yaml @@ -9,4 +9,3 @@ resources: - ./node-feature-discovery/ks.yaml - ./reloader/ks.yaml - ./snapshot-controller/ks.yaml - - ./volsync/ks.yaml diff --git a/kubernetes/apps/system/node-feature-discovery/ks.yaml b/kubernetes/apps/system/node-feature-discovery/ks.yaml index 83f41794..32aa294a 100644 --- a/kubernetes/apps/system/node-feature-discovery/ks.yaml +++ b/kubernetes/apps/system/node-feature-discovery/ks.yaml @@ -22,7 +22,7 @@ spec: apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-node-feature-discovery-rules + name: node-feature-discovery-rules namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" diff --git a/kubernetes/apps/system/reloader/ks.yaml b/kubernetes/apps/system/reloader/ks.yaml index fd69eb10..3c83cdc9 100644 --- a/kubernetes/apps/system/reloader/ks.yaml +++ b/kubernetes/apps/system/reloader/ks.yaml @@ -3,7 +3,7 @@ apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: - name: cluster-apps-reloader + name: reloader namespace: flux-system labels: substitution.flux.home.arpa/enabled: "true" diff --git a/kubernetes/apps/system/snapshot-controller/ks.yaml b/kubernetes/apps/system/snapshot-controller/ks.yaml index 0354577b..2f92e3cc 100644 --- a/kubernetes/apps/system/snapshot-controller/ks.yaml +++ b/kubernetes/apps/system/snapshot-controller/ks.yaml @@ -19,4 +19,4 @@ spec: wait: true timeout: 2m dependsOn: - - name: cluster-apps-cert-manager + - name: cert-manager