From a344f6a6ba9293b96cd35f14e894fbb073427076 Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Sat, 31 Aug 2024 15:58:50 +0200 Subject: [PATCH] chore(makefile): enhancing metallb installation (#564) Signed-off-by: Dario Tranchitella --- Makefile | 8 ++++---- hack/metallb.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 hack/metallb.yaml diff --git a/Makefile b/Makefile index dfad845f..074822b7 100644 --- a/Makefile +++ b/Makefile @@ -210,10 +210,10 @@ build: $(KO) ##@ Deployment metallb: - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml - kubectl apply -f https://kind.sigs.k8s.io/examples/loadbalancer/metallb-config.yaml - echo "" - docker network inspect -f '{{.IPAM.Config}}' kind + kubectl apply -f "https://raw.githubusercontent.com/metallb/metallb/$$(curl "https://api.github.com/repos/metallb/metallb/releases/latest" | jq -r ".tag_name")/config/manifests/metallb-native.yaml" + kubectl wait pods -n metallb-system -l app=metallb,component=controller --for=condition=Ready --timeout=10m + kubectl wait pods -n metallb-system -l app=metallb,component=speaker --for=condition=Ready --timeout=2m + cat hack/metallb.yaml | sed -E "s|172.19|$$(docker network inspect -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}' kind | sed -E 's|^([0-9]+\.[0-9]+)\..*$$|\1|g')|g" | kubectl apply -f - cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.yaml diff --git a/hack/metallb.yaml b/hack/metallb.yaml new file mode 100644 index 00000000..389f9277 --- /dev/null +++ b/hack/metallb.yaml @@ -0,0 +1,15 @@ +# Metal LB manifests: used for local development purposes +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: kamaji-kind-pool + namespace: metallb-system +spec: + addresses: + - 172.19.255.100-172.19.255.150 +--- +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: empty + namespace: metallb-system