From dc6cd1706ae409f0b4895f9ea2dd1b416da79a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20M=C3=BCller?= Date: Mon, 16 Oct 2023 00:10:43 +0200 Subject: [PATCH] feat(kube-nas): setup stakater/reloader --- .../apps/kube-tools/kustomization.yaml | 7 +++++ .../kube-nas/apps/kube-tools/namespace.yaml | 7 +++++ .../kube-tools/reloader/app/helm-release.yaml | 29 +++++++++++++++++++ .../reloader/app/kustomization.yaml | 7 +++++ .../apps/kube-tools/reloader/flux-sync.yaml | 17 +++++++++++ 5 files changed, 67 insertions(+) create mode 100644 kubernetes/kube-nas/apps/kube-tools/kustomization.yaml create mode 100644 kubernetes/kube-nas/apps/kube-tools/namespace.yaml create mode 100644 kubernetes/kube-nas/apps/kube-tools/reloader/app/helm-release.yaml create mode 100644 kubernetes/kube-nas/apps/kube-tools/reloader/app/kustomization.yaml create mode 100644 kubernetes/kube-nas/apps/kube-tools/reloader/flux-sync.yaml diff --git a/kubernetes/kube-nas/apps/kube-tools/kustomization.yaml b/kubernetes/kube-nas/apps/kube-tools/kustomization.yaml new file mode 100644 index 000000000..ce1370c89 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-tools/kustomization.yaml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./namespace.yaml + - ./reloader/flux-sync.yaml diff --git a/kubernetes/kube-nas/apps/kube-tools/namespace.yaml b/kubernetes/kube-nas/apps/kube-tools/namespace.yaml new file mode 100644 index 000000000..ee53f9720 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-tools/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: kube-tools + labels: + kustomize.toolkit.fluxcd.io/prune: disabled diff --git a/kubernetes/kube-nas/apps/kube-tools/reloader/app/helm-release.yaml b/kubernetes/kube-nas/apps/kube-tools/reloader/app/helm-release.yaml new file mode 100644 index 000000000..1a6624eec --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-tools/reloader/app/helm-release.yaml @@ -0,0 +1,29 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta1.json +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: reloader +spec: + interval: 15m + chart: + spec: + chart: reloader + version: 1.0.43 + sourceRef: + kind: HelmRepository + name: stakater-charts + namespace: flux-system + maxHistory: 15 + install: + createNamespace: true + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + fullnameOverride: reloader diff --git a/kubernetes/kube-nas/apps/kube-tools/reloader/app/kustomization.yaml b/kubernetes/kube-nas/apps/kube-tools/reloader/app/kustomization.yaml new file mode 100644 index 000000000..8efbfd9ea --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-tools/reloader/app/kustomization.yaml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kube-tools +resources: + - helm-release.yaml diff --git a/kubernetes/kube-nas/apps/kube-tools/reloader/flux-sync.yaml b/kubernetes/kube-nas/apps/kube-tools/reloader/flux-sync.yaml new file mode 100644 index 000000000..8cf28896f --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-tools/reloader/flux-sync.yaml @@ -0,0 +1,17 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1beta2.json +apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 +kind: Kustomization +metadata: + name: apps-reloader + namespace: flux-system + labels: + substitution.flux.home.arpa/enabled: "true" +spec: + interval: 10m + path: ./kubernetes/kube-nas/apps/kube-tools/reloader/app + prune: true + sourceRef: + kind: GitRepository + name: home-ops + wait: true