From a03ea7d20842b7ec74d4f48245e5a1abb377a6d3 Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Sat, 12 Jul 2025 18:38:50 +0300 Subject: [PATCH] metallb: Migrate to kustomize + helm --- metallb-system/README.md | 29 ------------------- {metallb-system => metallb}/.gitignore | 0 metallb/README.md | 15 ++++++++++ .../application-extras.yaml | 19 ------------ metallb/kustomization.yaml | 17 +++++++++++ metallb/values.yaml | 4 +++ 6 files changed, 36 insertions(+), 48 deletions(-) delete mode 100644 metallb-system/README.md rename {metallb-system => metallb}/.gitignore (100%) create mode 100644 metallb/README.md rename metallb-system/application.yml => metallb/application-extras.yaml (79%) create mode 100644 metallb/kustomization.yaml create mode 100644 metallb/values.yaml diff --git a/metallb-system/README.md b/metallb-system/README.md deleted file mode 100644 index eb266eb..0000000 --- a/metallb-system/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# MetalLB - -## Background - -MetalLB exposes services to the outside world. - - -## Deployment - -To update manifests: - -``` -curl -O https://raw.githubusercontent.com/metallb/metallb-operator/v0.14.2/bin/metallb-operator.yaml -kubectl apply -f metallb-operator.yaml -kubectl apply -f application.yml -``` - -Set up BGP secrets: - -``` -kubectl delete secret -n metallb-system mikrotik-router - kubectl create secret -n metallb-system generic mikrotik-router --type=kubernetes.io/basic-auth --from-literal=password=... -``` - -Eventually the external IP should show up here: - -``` -kubectl get svc -n traefik -``` diff --git a/metallb-system/.gitignore b/metallb/.gitignore similarity index 100% rename from metallb-system/.gitignore rename to metallb/.gitignore diff --git a/metallb/README.md b/metallb/README.md new file mode 100644 index 0000000..fd2e9c7 --- /dev/null +++ b/metallb/README.md @@ -0,0 +1,15 @@ +# MetalLB + +## Derployment + +With ArgoCD. Render it locally: + +```sh +kustomize build . --enable-helm +``` + +Eventually the external IP should show up here: + +``` +kubectl get svc -n traefik +``` diff --git a/metallb-system/application.yml b/metallb/application-extras.yaml similarity index 79% rename from metallb-system/application.yml rename to metallb/application-extras.yaml index 16386fc..325e7c3 100644 --- a/metallb-system/application.yml +++ b/metallb/application-extras.yaml @@ -1,23 +1,4 @@ --- -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: monitoring - namespace: metallb-system -spec: - selector: {} - podMetricsEndpoints: - - port: monitoring ---- -apiVersion: metallb.io/v1beta1 -kind: MetalLB -metadata: - name: metallb - namespace: metallb-system -spec: - nodeSelector: - node-role.kubernetes.io/worker: "" ---- # Slice of the private Zoo subnet using MetalLB L2 method apiVersion: metallb.io/v1beta1 kind: IPAddressPool diff --git a/metallb/kustomization.yaml b/metallb/kustomization.yaml new file mode 100644 index 0000000..89f6ee4 --- /dev/null +++ b/metallb/kustomization.yaml @@ -0,0 +1,17 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: metallb-system + +# spec: https://kubectl.docs.kubernetes.io/references/kustomize/builtins/#_helmchartinflationgenerator_ +helmCharts: +- includeCRDs: true + name: &name metallb + releaseName: *name + repo: https://metallb.github.io/metallb + valuesFile: values.yaml + version: 0.15.2 + +resources: +- ssh://git@git.k-space.ee/secretspace/kube/metallb # secrets (.env): mikrotik-router +- ./application-extras.yaml diff --git a/metallb/values.yaml b/metallb/values.yaml new file mode 100644 index 0000000..429dfb8 --- /dev/null +++ b/metallb/values.yaml @@ -0,0 +1,4 @@ +prometheus: + rbacPrometheus: false + serviceMonitor: + enabled: true