From 70101a1c3f35f91db725698f46fa41a72ece7e5f Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Wed, 18 Oct 2023 16:51:42 +0200 Subject: [PATCH] Prepare the arm cluster --- Makefile | 1 + badhouseplants/helmfile.yaml | 24 ++-- badhouseplants/values/values.longhorn.yaml | 6 +- .../values/values.metallb-resources.yaml | 4 + common/values.ipaddresspool.yaml | 14 ++ environments.yaml | 2 +- etersoft/values/values.metallb-resources.yaml | 4 + helmfile.yaml | 23 +++- releases.yaml | 123 ++++++++++++------ 9 files changed, 137 insertions(+), 64 deletions(-) create mode 100644 badhouseplants/values/values.metallb-resources.yaml create mode 100644 common/values.ipaddresspool.yaml create mode 100644 etersoft/values/values.metallb-resources.yaml diff --git a/Makefile b/Makefile index 1814372..7b59972 100644 --- a/Makefile +++ b/Makefile @@ -2,3 +2,4 @@ create_crb: kubectl create clusterrolebinding drone-deployer-workaround \ --clusterrole=cluster-admin \ --serviceaccount=drone-service:default + diff --git a/badhouseplants/helmfile.yaml b/badhouseplants/helmfile.yaml index bbbf5d4..609bef5 100644 --- a/badhouseplants/helmfile.yaml +++ b/badhouseplants/helmfile.yaml @@ -5,42 +5,42 @@ releases: - <<: *drone installed: true namespace: drone-service - createNamespace: false + createNamespace: true - <<: *drone-runner-docker installed: true namespace: drone-service - createNamespace: false + createNamespace: true - <<: *longhorn installed: true namespace: longhorn-system - createNamespace: false + createNamespace: true - <<: *argocd installed: true namespace: argo-system - createNamespace: false + createNamespace: true - <<: *nrodionov installed: true namespace: nrodionov-application - createNamespace: false + createNamespace: true - <<: *minecraft installed: true namespace: minecraft-application - createNamespace: false + createNamespace: true - <<: *gitea installed: true namespace: gitea-service - createNamespace: false + createNamespace: true - <<: *funkwhale installed: true namespace: funkwhale-application - createNamespace: false + createNamespace: true - <<: *prometheus installed: true @@ -50,12 +50,12 @@ releases: - <<: *loki installed: false namespace: monitoring-system - createNamespace: false + createNamespace: true - <<: *promtail installed: false namespace: monitoring-system - createNamespace: false + createNamespace: true - <<: *bitwarden installed: true @@ -92,10 +92,6 @@ releases: namespace: mail-service createNamespace: true - - <<: *istio-gateway-resources - installed: true - namespace: istio-system - createNamespace: false} bases: - ../environments.yaml diff --git a/badhouseplants/values/values.longhorn.yaml b/badhouseplants/values/values.longhorn.yaml index 078e6ab..6ed56f7 100644 --- a/badhouseplants/values/values.longhorn.yaml +++ b/badhouseplants/values/values.longhorn.yaml @@ -5,9 +5,9 @@ defaultSettings: guaranteedReplicaManagerCPU: 6 storageOverProvisioningPercentage: 300 storageMinimalAvailablePercentage: 5 - defaultDataPath: /media-longhorn + defaultDataPath: /media/longhorn csi: - kubeletRootDir: /var/snap/microk8s/common/var/lib/kubelet + kubeletRootDir: /var/lib/kubelet persistence: - defaultClassReplicaCount: 1 + defaultClassReplicaCount: 3 enablePSP: false diff --git a/badhouseplants/values/values.metallb-resources.yaml b/badhouseplants/values/values.metallb-resources.yaml new file mode 100644 index 0000000..abc5b80 --- /dev/null +++ b/badhouseplants/values/values.metallb-resources.yaml @@ -0,0 +1,4 @@ +ext-ipaddresspool: + enabled: true + name: badhouseplants-addresspool + addresses: 195.201.250.50-195.201.250.50 \ No newline at end of file diff --git a/common/values.ipaddresspool.yaml b/common/values.ipaddresspool.yaml new file mode 100644 index 0000000..3cebb5f --- /dev/null +++ b/common/values.ipaddresspool.yaml @@ -0,0 +1,14 @@ +--- +ext-ipaddresspool: + templates: + - | + --- + apiVersion: metallb.io/v1beta1 + kind: IPAddressPool + metadata: + name: "{{ .Values.name }}" + spec: + addresses: + - "{{ .Values.addresses }}" + autoAssign: true + avoidBuggyIPs: false \ No newline at end of file diff --git a/environments.yaml b/environments.yaml index 13a3ca2..d7c7497 100644 --- a/environments.yaml +++ b/environments.yaml @@ -1,5 +1,5 @@ environments: badhouseplants: - kubeContext: badhouseplants + kubeContext: badhouseplants-arm etersoft: kubeContext: etersoft diff --git a/etersoft/values/values.metallb-resources.yaml b/etersoft/values/values.metallb-resources.yaml new file mode 100644 index 0000000..b67493d --- /dev/null +++ b/etersoft/values/values.metallb-resources.yaml @@ -0,0 +1,4 @@ +ext-ipaddresspool: + enabled: true + name: etersoft-addresspool + addresses: 91.232.225.63-91.232.225.63 \ No newline at end of file diff --git a/helmfile.yaml b/helmfile.yaml index 738d891..daa8ebc 100644 --- a/helmfile.yaml +++ b/helmfile.yaml @@ -9,42 +9,51 @@ releases: - <<: *metrics-server installed: true namespace: kube-system - createNamespace: false + createNamespace: true - <<: *istio-base installed: true namespace: istio-system - createNamespace: false + createNamespace: true - <<: *istio-gateway installed: true namespace: istio-system - createNamespace: false + createNamespace: true + + - <<: *istio-gateway-resources + installed: true + namespace: istio-system + createNamespace: true - <<: *istiod installed: true namespace: istio-system - createNamespace: false + createNamespace: true - <<: *cert-manager installed: true namespace: cert-manager - createNamespace: false + createNamespace: true - <<: *minio installed: true namespace: minio-service - createNamespace: false + createNamespace: true - <<: *openvpn installed: true namespace: openvpn-service - createNamespace: false + createNamespace: true - <<: *metallb installed: true namespace: metallb-system createNamespace: true + - <<: *metallb-resources + installed: true + namespace: metallb-system + helmfiles: - path: {{.Environment.Name }}/helmfile.yaml diff --git a/releases.yaml b/releases.yaml index 1155aa8..6999a36 100644 --- a/releases.yaml +++ b/releases.yaml @@ -87,15 +87,32 @@ templates: alias: ext-database values: - '{{ requiredEnv "PWD" }}/common/values.database.yaml' - # ---------------------------- + + ext-ipaddresspool: + dependencies: + - chart: bedag/raw + version: 2.0.0 + alias: ext-ipaddresspool + values: + - '{{ requiredEnv "PWD" }}/common/values.ipaddresspool.yaml' + + # ------------------------------------------------------------------- # -- Releases - # ---------------------------- + # ------------------------------------------------------------------- # -- System - # ---------------------------- + # -- This is what has to be installed first. Without those releases + # -- cluster can't function + # ------------------------------------------------------------------- + common-system: + labels: + layer: system + metrics-server: &metrics-server name: metrics-server chart: metrics-server/metrics-server version: 3.11.0 + inherit: + - template: common-system values: - common/values.{{ .Release.Name }}.yaml @@ -103,20 +120,84 @@ templates: name: metallb chart: metallb/metallb version: 0.13.11 + inherit: + - template: common-system + + metallb-resources: &metallb-resources + name: metallb-resources + chart: bedag/raw + version: 2.0.0 + needs: + - metallb + inherit: + - template: default-env-values + - template: ext-ipaddresspool + - template: common-system cert-manager: &cert-manager name: cert-manager chart: jetstack/cert-manager version: 1.13.1 + inherit: + - template: common-system set: - name: installCRDs value: true + longhorn: &longhorn name: longhorn chart: longhorn/longhorn version: 1.5.1 inherit: - template: default-env-values + - template: common-system + + # ---------------------------- + # -- Istio + # ---------------------------- + common-istio: + labels: + bundle: istio + version: 1.19.3 + inherit: + - template: common-system + + istio-base: &istio-base + name: istio-base + chart: istio/base + inherit: + - template: crd-management-hook + - template: common-istio + + istio-gateway: &istio-gateway + name: istio-ingressgateway + chart: istio/gateway + needs: + - istio-base + - metallb-system/metallb-resources + inherit: + - template: common-istio + - template: default-env-values + + istiod: &istiod + name: istiod + chart: istio/istiod + needs: + - istio-base + inherit: + - template: common-istio + - template: default-env-values + + istio-gateway-resources: &istio-gateway-resources + name: istio-gateway-resources + chart: bedag/raw + version: 2.0.0 + needs: + - istio-base + inherit: + - template: ext-istio-gateway + - template: default-env-values + - template: common-system argocd: &argocd name: argocd @@ -157,42 +238,6 @@ templates: inherit: - template: monitoring-common - template: default-env-values - # ---------------------------- - # -- Istio - # ---------------------------- - istio-common: - labels: - bundle: istio - version: 1.19.3 - - istio-base: &istio-base - name: istio-base - chart: istio/base - inherit: - - template: crd-management-hook - - template: istio-common - - istio-gateway: &istio-gateway - name: istio-ingressgateway - chart: istio/gateway - inherit: - - template: istio-common - - template: default-env-values - - istio-gateway-resources: &istio-gateway-resources - name: istio-gateway-resources - chart: bedag/raw - version: 2.0.0 - inherit: - - template: ext-istio-gateway - - template: default-env-values - - istiod: &istiod - name: istiod - chart: istio/istiod - inherit: - - template: istio-common - - template: default-env-values # ---------------------------- # -- Applications