From f98ae20083501cff2c67028b3b2a1dd81ac4e4ea Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Tue, 14 Nov 2023 00:21:13 +0100 Subject: [PATCH] feat(dev): Rework environment configuration --- Makefile | 2 ++ environments/dev/bootstrap/kustomization.yaml | 18 ++++++++++++++++++ environments/dev/bootstrap/metallb-patch.yaml | 13 +++++++++++++ environments/dev/kustomization.yaml | 13 +------------ 4 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 environments/dev/bootstrap/kustomization.yaml create mode 100644 environments/dev/bootstrap/metallb-patch.yaml diff --git a/Makefile b/Makefile index f0e7d09..e1f6bc9 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ dev: + kubectl taint nodes outsider type=services:NoSchedule --overwrite + kubectl apply -k environments/dev/bootstrap --all kubectl apply -k environments/dev --prune=true --all prod: diff --git a/environments/dev/bootstrap/kustomization.yaml b/environments/dev/bootstrap/kustomization.yaml new file mode 100644 index 0000000..cb3d83d --- /dev/null +++ b/environments/dev/bootstrap/kustomization.yaml @@ -0,0 +1,18 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + # MetalLB installation and configuration + - https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml + # Traefik CRD + - https://raw.githubusercontent.com/traefik/traefik/v2.9/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml + - https://raw.githubusercontent.com/traefik/traefik/v2.9/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml + # Longhorn CRD + - https://raw.githubusercontent.com/longhorn/longhorn/v1.5.2/deploy/longhorn.yaml + # SOPS secrets operator CRDs + - https://raw.githubusercontent.com/isindir/sops-secrets-operator/master/config/crd/bases/isindir.github.com_sopssecrets.yaml + # Install CoudNativePG operator + - https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.20/releases/cnpg-1.19.1.yaml + +patchesStrategicMerge: + - ./metallb-patch.yaml diff --git a/environments/dev/bootstrap/metallb-patch.yaml b/environments/dev/bootstrap/metallb-patch.yaml new file mode 100644 index 0000000..1ef3ae7 --- /dev/null +++ b/environments/dev/bootstrap/metallb-patch.yaml @@ -0,0 +1,13 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: speaker + namespace: metallb-system +spec: + template: + spec: + tolerations: + - key: "type" + operator: "Equal" + value: "services" + effect: "NoSchedule" diff --git a/environments/dev/kustomization.yaml b/environments/dev/kustomization.yaml index d421aaf..027fb00 100644 --- a/environments/dev/kustomization.yaml +++ b/environments/dev/kustomization.yaml @@ -2,17 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - # Traefik CRD - - https://raw.githubusercontent.com/traefik/traefik/v2.9/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml - - https://raw.githubusercontent.com/traefik/traefik/v2.9/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml - # MetalLB installation and configuration - - https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml + # MetalLB configuration - ../../metallb - # PostgreSQL operator and its UI - - github.com/zalando/postgres-operator/manifests - - github.com/zalando/postgres-operator/ui/manifests - # SOPS secrets operator CRDs - - https://raw.githubusercontent.com/isindir/sops-secrets-operator/master/config/crd/bases/isindir.github.com_sopssecrets.yaml # Miscellanous basic configuration - ../../res # NFS client configuration @@ -29,5 +20,3 @@ resources: patchesStrategicMerge: #- ../../environments/dev/traefik-internal-service.yaml #- ../../environments/dev/traefik-external-service.yaml - - ../../environments/dev/postgres-operator-patch.yaml - - ../../environments/dev/metallb-patch.yaml