From 828b8e1b8c2f3f6753919945064a0b92e889810f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20M=C3=BCller?= Date: Mon, 16 Oct 2023 00:24:30 +0200 Subject: [PATCH] feat(kube-nas): install coredns with chart --- .../kube-system/coredns/app/helm-release.yaml | 90 +++++++++++++++++++ .../coredns/app/kustomization.yaml | 7 ++ .../apps/kube-system/coredns/flux-sync.yaml | 19 ++++ .../repositories/helm/coredns-charts.yaml | 10 +++ 4 files changed, 126 insertions(+) create mode 100644 kubernetes/kube-nas/apps/kube-system/coredns/app/helm-release.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/coredns/app/kustomization.yaml create mode 100644 kubernetes/kube-nas/apps/kube-system/coredns/flux-sync.yaml create mode 100644 kubernetes/kube-nas/flux/repositories/helm/coredns-charts.yaml diff --git a/kubernetes/kube-nas/apps/kube-system/coredns/app/helm-release.yaml b/kubernetes/kube-nas/apps/kube-system/coredns/app/helm-release.yaml new file mode 100644 index 000000000..7202ac2ad --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/coredns/app/helm-release.yaml @@ -0,0 +1,90 @@ +--- +# 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: coredns + namespace: kube-system +spec: + interval: 30m + chart: + spec: + chart: coredns + version: 1.27.1 + sourceRef: + kind: HelmRepository + name: coredns-charts + namespace: flux-system + maxHistory: 2 + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + fullnameOverride: coredns + replicaCount: 1 + k8sAppLabelOverride: kube-dns + service: + name: kube-dns + clusterIP: 10.43.0.10 + serviceAccount: + create: true + deployment: + annotations: + reloader.stakater.com/auto: "true" + servers: + - zones: + - zone: . + scheme: dns:// + use_tcp: true + port: 53 + plugins: + - name: log + - name: errors + - name: health + configBlock: |- + lameduck 5s + - name: ready + - name: kubernetes + parameters: cluster.local in-addr.arpa ip6.arpa + configBlock: |- + pods insecure + fallthrough in-addr.arpa ip6.arpa + ttl 30 + - name: prometheus + parameters: 0.0.0.0:9153 + - name: forward + parameters: . /etc/resolv.conf + - name: cache + parameters: 30 + - name: loop + - name: reload + - name: loadbalance + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: Exists + tolerations: + - key: CriticalAddonsOnly + operator: Exists + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app.kubernetes.io/instance: coredns diff --git a/kubernetes/kube-nas/apps/kube-system/coredns/app/kustomization.yaml b/kubernetes/kube-nas/apps/kube-system/coredns/app/kustomization.yaml new file mode 100644 index 000000000..f02b6a024 --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/coredns/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/coredns/flux-sync.yaml b/kubernetes/kube-nas/apps/kube-system/coredns/flux-sync.yaml new file mode 100644 index 000000000..570adeece --- /dev/null +++ b/kubernetes/kube-nas/apps/kube-system/coredns/flux-sync.yaml @@ -0,0 +1,19 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1beta2.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: apps-coredns + namespace: flux-system + labels: + substitution.flux.home.arpa/enabled: "true" +spec: + path: ./kubernetes/kube-nas/apps/kube-system/coredns/app + prune: false # never should be deleted + sourceRef: + kind: GitRepository + name: home-ops + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m diff --git a/kubernetes/kube-nas/flux/repositories/helm/coredns-charts.yaml b/kubernetes/kube-nas/flux/repositories/helm/coredns-charts.yaml new file mode 100644 index 000000000..5e8323130 --- /dev/null +++ b/kubernetes/kube-nas/flux/repositories/helm/coredns-charts.yaml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrepository-source-v1beta2.json +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: coredns-charts + namespace: flux-system +spec: + interval: 2h + url: https://coredns.github.io/helm