From 3a5b188e9a7b7ef9beecb30777cb4db22e87c14e Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Thu, 9 Jun 2022 09:13:42 -0400 Subject: [PATCH] feat(cluster): add kured as optional deployment Signed-off-by: Devin Buhl --- .config.sample.env | 6 ++++ .../apps/kube-system/kured/helm-release.yaml | 32 +++++++++++++++++++ .../apps/kube-system/kured/kustomization.yaml | 5 +++ cluster/apps/kube-system/kustomization.yaml | 1 + cluster/apps/kustomization.yaml | 5 --- tmpl/cluster/cluster-settings.yaml | 1 + 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 cluster/apps/kube-system/kured/helm-release.yaml create mode 100644 cluster/apps/kube-system/kured/kustomization.yaml diff --git a/.config.sample.env b/.config.sample.env index 72726bed..72a1d0f0 100644 --- a/.config.sample.env +++ b/.config.sample.env @@ -43,6 +43,12 @@ export BOOTSTRAP_AGE_PUBLIC_KEY="" # e.g. 192.168.1.254 export BOOTSTRAP_KUBE_VIP_ADDR="" +# Choose your timezone +# Used to set your systems timezone +# and Kured timezone +# e.g. America/New_York +export BOOTSTRAP_TIMEZONE="Etc/UTC" + # # Ansible related variables # diff --git a/cluster/apps/kube-system/kured/helm-release.yaml b/cluster/apps/kube-system/kured/helm-release.yaml new file mode 100644 index 00000000..259bf60e --- /dev/null +++ b/cluster/apps/kube-system/kured/helm-release.yaml @@ -0,0 +1,32 @@ +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: kured + namespace: kube-system +spec: + interval: 5m + chart: + spec: + chart: kured + version: 2.15.0 + sourceRef: + kind: HelmRepository + name: weaveworks-kured-charts + namespace: flux-system + interval: 5m + install: + createNamespace: true + remediation: + retries: 3 + upgrade: + remediation: + retries: 3 + values: + configuration: + annotateNodes: true + startTime: "10pm" + endTime: "2am" + logFormat: "json" + rebootCommand: "/bin/systemctl reboot" + timeZone: "${TIMEZONE}" diff --git a/cluster/apps/kube-system/kured/kustomization.yaml b/cluster/apps/kube-system/kured/kustomization.yaml new file mode 100644 index 00000000..2fa2de20 --- /dev/null +++ b/cluster/apps/kube-system/kured/kustomization.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - helm-release.yaml diff --git a/cluster/apps/kube-system/kustomization.yaml b/cluster/apps/kube-system/kustomization.yaml index 92028b9d..80a2f314 100644 --- a/cluster/apps/kube-system/kustomization.yaml +++ b/cluster/apps/kube-system/kustomization.yaml @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + # - kured - metrics-server - reflector - reloader diff --git a/cluster/apps/kustomization.yaml b/cluster/apps/kustomization.yaml index 945541cf..cebd1b14 100644 --- a/cluster/apps/kustomization.yaml +++ b/cluster/apps/kustomization.yaml @@ -2,11 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - # Be sure to NOT downgrade k3s by keep the value in - # ./provision/ansible/inventory/group_vars/kubernetes/k3s.yml - # updated if you need to re-run the Ansible playbook. - # To enable automatic Kubernetes upgrades uncomment - # the below line # - system-upgrade - default - kube-system diff --git a/tmpl/cluster/cluster-settings.yaml b/tmpl/cluster/cluster-settings.yaml index 18cd40eb..af7be379 100644 --- a/tmpl/cluster/cluster-settings.yaml +++ b/tmpl/cluster/cluster-settings.yaml @@ -5,6 +5,7 @@ metadata: name: cluster-settings namespace: flux-system data: + TIMEZONE: ${BOOTSTRAP_TIMEZONE} METALLB_LB_RANGE: ${BOOTSTRAP_METALLB_LB_RANGE} METALLB_K8S_GATEWAY_ADDR: ${BOOTSTRAP_METALLB_K8S_GATEWAY_ADDR} METALLB_TRAEFIK_ADDR: ${BOOTSTRAP_METALLB_TRAEFIK_ADDR}