From 58986afe32752c3668f10a3f1a673898fd6d6b58 Mon Sep 17 00:00:00 2001 From: "Guillaume B.B. Van Hemmen" Date: Fri, 27 Dec 2024 13:46:42 +0100 Subject: [PATCH] #0000 - Add MetalLB Helm values and update installation script Introduces custom `metallb.yaml` Helm values with node selectors and tolerations targeting specific nodes. Renames and adjusts MetalLB resource file, removing unused IPs. Updates installation script to apply the new Helm values and handle namespace creation idempotently. --- helm-values/metallb.yaml | 19 +++++++++++++++++++ .../metallb-ip.yaml | 2 -- scripts/00_install_metalLB.sh | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 helm-values/metallb.yaml rename metallb-ressources.yaml => ressources/metallb-ip.yaml (85%) mode change 100644 => 100755 scripts/00_install_metalLB.sh diff --git a/helm-values/metallb.yaml b/helm-values/metallb.yaml new file mode 100644 index 0000000..af183d4 --- /dev/null +++ b/helm-values/metallb.yaml @@ -0,0 +1,19 @@ +controller: + nodeSelector: + com.van-hemmen.role: gateway + com.van-hemmen.hosting: ovh + tolerations: + - key: "com.van-hemmen.role" + operator: "Equal" + value: "gateway" + effect: "NoSchedule" + +speaker: + nodeSelector: + com.van-hemmen.role: gateway + com.van-hemmen.hosting: ovh + tolerations: + - key: "com.van-hemmen.role" + operator: "Equal" + value: "gateway" + effect: "NoSchedule" diff --git a/metallb-ressources.yaml b/ressources/metallb-ip.yaml similarity index 85% rename from metallb-ressources.yaml rename to ressources/metallb-ip.yaml index 711b485..ce3396a 100644 --- a/metallb-ressources.yaml +++ b/ressources/metallb-ip.yaml @@ -5,8 +5,6 @@ metadata: namespace: metallb-system spec: addresses: - - 5.196.149.159/32 - - 5.196.149.200/32 - 5.196.149.203/32 --- apiVersion: metallb.io/v1beta1 diff --git a/scripts/00_install_metalLB.sh b/scripts/00_install_metalLB.sh old mode 100644 new mode 100755 index c2a9bf6..52e0375 --- a/scripts/00_install_metalLB.sh +++ b/scripts/00_install_metalLB.sh @@ -5,7 +5,7 @@ set -ex helm repo add metallb https://metallb.github.io/metallb helm repo update -kubectl create namespace metallb-system +kubectl create namespace metallb-system || true kubectl label namespace metallb-system pod-security.kubernetes.io/enforce=privileged -helm install metallb metallb/metallb --namespace metallb-system +helm install metallb metallb/metallb --namespace metallb-system -f ./helm-values/metallb.yaml