From ea0cf5355338c8386b56d25a852bfca1353f07e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20M=C3=BCller?= Date: Mon, 16 Oct 2023 00:09:54 +0200 Subject: [PATCH] feat(kube-nas): setup kubelet-csr-approver and metrics-server --- .../app/helm-release.yaml | 23 +++++++++++++++++++ .../app/kustomization.yaml | 7 ++++++ .../kubelet-csr-approver/flux-sync.yaml | 18 +++++++++++++++ .../apps/kube-system/kustomization.yaml | 8 +++++++ .../metrics-server/app/helm-release.yaml | 23 +++++++++++++++++++ .../metrics-server/app/kustomization.yaml | 7 ++++++ .../kube-system/metrics-server/flux-sync.yaml | 17 ++++++++++++++ .../kube-nas/apps/kube-system/namespace.yaml | 7 ++++++ 8 files changed, 110 insertions(+) create mode 100644 kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/helm-release.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/kustomization.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/flux-sync.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/kustomization.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/metrics-server/app/helm-release.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/metrics-server/app/kustomization.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/metrics-server/flux-sync.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/namespace.yaml diff --git a/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/helm-release.yaml b/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/helm-release.yaml new file mode 100644 index 000000000..5381306d0 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/helm-release.yaml @@ -0,0 +1,23 @@ +--- +# 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: kubelet-csr-approver + namespace: kube-system +spec: + interval: 30m + chart: + spec: + chart: kubelet-csr-approver + version: 1.0.5 + sourceRef: + kind: HelmRepository + name: postfinance-charts + namespace: flux-system + interval: 30m + values: + providerRegex: | + ^(kube-nas)$ + replicas: 1 + bypassDnsResolution: true diff --git a/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/kustomization.yaml b/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app/kustomization.yaml new file mode 100644 index 000000000..f02b6a024 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/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-system +resources: + - ./helm-release.yaml diff --git a/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/flux-sync.yaml b/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/flux-sync.yaml new file mode 100644 index 000000000..8c8b4e178 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/flux-sync.yaml @@ -0,0 +1,18 @@ +--- +# 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-kubelet-csr-approver + namespace: flux-system + labels: + substitution.flux.home.arpa/enabled: "true" +spec: + interval: 10m + path: ./kubernetes/kube-nas/apps/kube-system/kubelet-csr-approver/app + prune: true + sourceRef: + kind: GitRepository + name: home-ops + wait: true + timeout: 3m diff --git a/kubernetes/kube-nas/apps/kube-system/kustomization.yaml b/kubernetes/kube-nas/apps/kube-system/kustomization.yaml new file mode 100644 index 000000000..48a83b576 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/kustomization.yaml @@ -0,0 +1,8 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./namespace.yaml + - ./kubelet-csr-approver/flux-sync.yaml + - ./metrics-server/flux-sync.yaml diff --git a/kubernetes/kube-nas/apps/kube-system/metrics-server/app/helm-release.yaml b/kubernetes/kube-nas/apps/kube-system/metrics-server/app/helm-release.yaml new file mode 100644 index 000000000..ade99aad7 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/metrics-server/app/helm-release.yaml @@ -0,0 +1,23 @@ +--- +# 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: metrics-server +spec: + interval: 30m + chart: + spec: + chart: metrics-server + version: 3.11.0 + sourceRef: + kind: HelmRepository + name: metrics-server-charts + namespace: flux-system + interval: 30m + values: + metrics: + enabled: true + serviceMonitor: + # TODO: enable me after mini prom setup + enabled: false diff --git a/kubernetes/kube-nas/apps/kube-system/metrics-server/app/kustomization.yaml b/kubernetes/kube-nas/apps/kube-system/metrics-server/app/kustomization.yaml new file mode 100644 index 000000000..f02b6a024 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/metrics-server/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-system +resources: + - ./helm-release.yaml diff --git a/kubernetes/kube-nas/apps/kube-system/metrics-server/flux-sync.yaml b/kubernetes/kube-nas/apps/kube-system/metrics-server/flux-sync.yaml new file mode 100644 index 000000000..4b8ef0292 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/metrics-server/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-metrics-server + namespace: flux-system + labels: + substitution.flux.home.arpa/enabled: "true" +spec: + interval: 10m + path: ./kubernetes/kube-nas/apps/kube-system/metrics-server/app + prune: true + sourceRef: + kind: GitRepository + name: home-ops + wait: true diff --git a/kubernetes/kube-nas/apps/kube-system/namespace.yaml b/kubernetes/kube-nas/apps/kube-system/namespace.yaml new file mode 100644 index 000000000..5eeb2c918 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/namespace.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: kube-system + labels: + kustomize.toolkit.fluxcd.io/prune: disabled