/kubernetes-platform-skills:metallb-bare-metal-load-balancer-configurationfrom kubernetes-platform-skills
Configures MetalLB for LoadBalancer Services on bare-metal/on-prem Kubernetes clusters. Covers IP address pools, Layer2 (ARP/NDP) mode, and BGP mode with peer configuration.
Ships in kubernetes-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A Service of type: LoadBalancer is meaningless on a cluster with no
cloud provider integration — without something to satisfy that request,
the Service sits with EXTERNAL-IP: <pending> forever. MetalLB fills
exactly that gap for bare-metal and on-prem clusters by implementing the
load-balancer API itself: it watches for LoadBalancer Services,
allocates an IP from a configured pool, and announces reachability to
that IP using one of two fundamentally different mechanisms — Layer2
mode (ARP/NDP, one node at a time, simple but limited failover speed and
no real load spreading) or BGP mode (each node advertises routes to
upstream routers, enabling real ECMP load spreading but requiring actual
BGP peering with the physical/virtual network). Choosing the wrong mode
for the network you actually have, or misconfiguring the IP pool, is the
most common way MetalLB looks "installed" but doesn't actually make
Services reachable. This skill covers configuring both modes and the IP
pool; verifying that allocation and peering are actually healthy before
depending on it in production is
metallb-configuration-validation's
job.
LoadBalancer Service support on a new bare-metal/on-prem
Kubernetes cluster (kubeadm, K3s, Cluster API on bare metal) with no
cloud load-balancer integration.LoadBalancer Service stuck <pending> on a bare-metal
cluster.LoadBalancer implementation already claiming that role (MetalLB
and a cloud controller manager's LB integration conflict if both are
active).strictARP enabled on kube-proxy if running in IPVS mode (required
for Layer2 mode to work correctly — see step 2).BGPPeer CRD and
the router's own BGP neighbor configuration).Install MetalLB:
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.8/config/manifests/metallb-native.yaml
kubectl -n metallb-system get pods # controller + speaker DaemonSet, wait for Running
If kube-proxy runs in IPVS mode, enable strictARP before
configuring Layer2 mode — without it, kube-proxy's own ARP handling
conflicts with MetalLB's, and Services intermittently become
unreachable:
kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e 's/strictARP: false/strictARP: true/' | \
kubectl apply -f - -n kube-system
Not required for iptables-mode kube-proxy (the more common default), but always confirm which mode is actually running before skipping this step.
Choose Layer2 or BGP mode based on the actual network, not familiarity:
Configure an IPAddressPool (works for both modes — this is
what actually gets allocated to Services):
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: production-pool
namespace: metallb-system
spec:
addresses:
- 10.0.100.10-10.0.100.50
autoAssign: true
Reserve a separate, non-overlapping pool per environment/purpose
(e.g. a smaller autoAssign: false pool for Services that need a
specific, manually-chosen IP) rather than one pool for everything —
see step 7 for scoping pools to specific namespaces.
Configure Layer2 advertisement:
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: production-l2
namespace: metallb-system
spec:
ipAddressPools:
- production-pool
Configure BGP mode instead, with explicit peer(s) matching the upstream router's actual configuration:
apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
name: rack1-router
namespace: metallb-system
spec:
myASN: 64512
peerASN: 64500
peerAddress: 10.0.0.1
holdTime: "90s"
---
apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
name: production-bgp
namespace: metallb-system
spec:
ipAddressPools:
- production-pool
aggregationLength: 32
myASN/peerASN/peerAddress must exactly match what's configured
on the router's side — mismatches here are the most common cause of
a BGPPeer never reaching Established (see
metallb-configuration-validation).
Scope pools to specific namespaces/Services when different teams or environments must not draw from each other's IP ranges:
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: dev-pool
namespace: metallb-system
spec:
addresses:
- 10.0.100.60-10.0.100.70
autoAssign: false
apiVersion: v1
kind: Service
metadata:
name: dev-app
annotations:
metallb.io/address-pool: dev-pool
spec:
type: LoadBalancer
autoAssign: false on a pool means Services must explicitly opt in
via the annotation, preventing accidental allocation from a
restricted pool.
Request a specific IP for a Service when a stable, pre-registered address (e.g. already in DNS) is required, rather than accepting whatever the pool auto-assigns:
apiVersion: v1
kind: Service
metadata:
name: payments-api
annotations:
metallb.io/loadBalancerIPs: "10.0.100.20"
spec:
type: LoadBalancer
aggregationLength: 32 (advertise each service IP individually)
unless there's a specific reason to aggregate into larger CIDR
blocks — aggregation trades route-table size for less precise
per-service traffic engineering.autoAssign: false for anything
needing a deliberately chosen IP) rather than one large pool where
any Service could land on any address.BGPPeer and the router's neighbor config) — one
side changing without the other produces a session that silently
never re-establishes.Symptom: A LoadBalancer Service stays EXTERNAL-IP: <pending>
indefinitely.
Fix: Check that an IPAddressPool actually exists with
autoAssign: true (or the Service references one explicitly via
annotation) and that the pool isn't already exhausted
(kubectl -n metallb-system get ipaddresspools -o yaml and compare
addresses used vs. available) — a common cause is every address in
the pool already allocated to existing Services, leaving nothing for
a new one.
Symptom: A Service gets an EXTERNAL-IP assigned, but it's
unreachable from outside the cluster.
Fix: In Layer2 mode, confirm strictARP is enabled if kube-proxy
runs in IPVS mode (step 2) — without it, ARP responses for the
service IP can be inconsistent. In BGP mode, confirm the BGPPeer
session is actually Established (see
metallb-configuration-validation)
— an assigned IP with no working BGP session announces nothing to
the upstream network, leaving the address unreachable despite
Kubernetes reporting it as allocated.
Symptom: Two Services end up with the same external IP, or a Service gets an IP that's also in use by something else on the network. Fix: The MetalLB pool overlaps with a range still handed out by DHCP or statically assigned elsewhere — reserve the pool's range explicitly and remove it from DHCP scope before assigning it to MetalLB, and audit existing static assignments on that subnet before the pool is put into production use.
Symptom: Failover after a node failure in Layer2 mode takes much longer than expected (tens of seconds to minutes), causing visible client-side disruption. Fix: This is an inherent Layer2-mode limitation, not a misconfiguration — failover depends on ARP cache expiry on upstream switches/clients, which MetalLB can influence somewhat via gratuitous ARP but not eliminate. If faster failover is a hard requirement, this is a reason to move to BGP mode (ECMP reroutes faster) rather than tuning Layer2 mode further.
Symptom: Someone deletes an IPAddressPool that still has
Services actively using addresses from it, "to reconfigure the range."
Fix: Deleting a pool still in use by live Services leaves those
Services with an orphaned/unmanaged external IP and can disrupt
traffic — check kubectl get svc -A -o jsonpath='{range .items[?(@.spec.type=="LoadBalancer")]}{.metadata.namespace}/{.metadata.name}: {.status.loadBalancer.ip}{"\n"}{end}'
for current allocations from a pool before deleting or resizing it,
and migrate/re-provision affected Services deliberately rather than
deleting the pool out from under them.
Scenario: A 4-node on-prem cluster on a flat 10.0.0.0/24 L2
segment needs LoadBalancer Services to work, with no BGP-capable
router available, and a stable IP reserved in advance for a public-
facing payments-api Service that's already registered in DNS.
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.8/config/manifests/metallb-native.yaml
kubectl -n metallb-system get pods
Confirm kube-proxy mode and enable strictARP if IPVS:
kubectl get configmap kube-proxy -n kube-system -o jsonpath='{.data.config\.conf}' | grep mode
# mode: "ipvs"
kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e 's/strictARP: false/strictARP: true/' | kubectl apply -f - -n kube-system
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata: { name: production-pool, namespace: metallb-system }
spec:
addresses: ["10.0.0.200-10.0.0.220"]
autoAssign: true
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata: { name: production-l2, namespace: metallb-system }
spec:
ipAddressPools: ["production-pool"]
apiVersion: v1
kind: Service
metadata:
name: payments-api
namespace: payments
annotations:
metallb.io/loadBalancerIPs: "10.0.0.210"
spec:
type: LoadBalancer
selector: { app: payments-api }
ports: [{ port: 443, targetPort: 8443 }]
10.0.0.210 was chosen deliberately (already registered as
payments-api.example.com in DNS) and sits outside the .200-.220
autoAssign pool's typical auto-pick order but still within it, so it's
both explicitly pinned and validly drawn from the reserved range —
kubectl get svc payments-api -n payments confirms
EXTERNAL-IP: 10.0.0.210 and the Service is reachable from outside the
cluster once ARP for that address resolves to the node currently
holding it.
LoadBalancer IP to route HTTP(S) traffic to multiple Services.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin kubernetes-platform-skills35 skills in this plugin
/cert-manager-tls-automationGuides installing and configuring cert-manager for automated TLS certificate issuance and renewal — Issuers vs. ClusterIssuers, ACME/ Let's Encrypt HTTP-01 and DNS-01 challenges, private-CA issuance, and integration with Ingress-nginx and Istio gateways. Use when a user asks to "automate TLS certificates on Kubernetes," "set up cert-manager with Let's Encrypt," "fix a stuck Certificate that won't become Ready," "use DNS-01 for a wildcard cert," "rotate mTLS certs automatically," or "issue certs from an internal CA."
/cni-networking-calico-flannelGuides choosing and installing a Kubernetes CNI plugin — Calico vs. Flannel — including NetworkPolicy enforcement capability differences, BGP vs. VXLAN/overlay data paths, and IP address management (IPAM) tradeoffs. Use when a user asks to "choose a CNI plugin for Kubernetes," "enable NetworkPolicy enforcement," "set up Calico with BGP peering," "install Flannel," "debug pod-to-pod connectivity across nodes," or "migrate from Flannel to Calico."
/complete-kubernetes-deployment-on-aks-from-scratchSequences a complete, end-to-end AKS deployment from a bare Azure subscription to a production-ready cluster serving a first workload — Azure landing zone prerequisites, AKS cluster and node pool provisioning, Azure CNI (with the Calico/Cilium alternative noted), ingress (Application Gateway Ingress Controller vs. ingress-nginx), cert-manager with Azure DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on AKS from scratch," "set up a new AKS environment end to end," "build a production AKS cluster from a fresh Azure subscription," or "give me the full sequence to go from nothing to a working AKS cluster."
/complete-kubernetes-deployment-on-eks-from-scratchSequences a complete, end-to-end EKS deployment from a bare AWS account to a production-ready cluster serving a first workload — landing zone/IAM prerequisites, EKS cluster and node group provisioning, VPC CNI (with the Calico/Cilium alternative noted), ingress (ALB vs. ingress-nginx), cert- manager with Route 53 DNS-01, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/ orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on EKS from scratch," "stand up a new EKS environment end to end," "build a production EKS cluster from a fresh AWS account," or "give me the full sequence to go from nothing to a working EKS cluster."
/complete-kubernetes-deployment-on-gke-from-scratchSequences a complete, end-to-end GKE deployment from a bare GCP project to a production-ready cluster serving a first workload — GCP landing zone prerequisites, GKE cluster and node pool provisioning, VPC-native/ Dataplane V2 CNI (with the Calico alternative noted), ingress (GKE Ingress/Gateway API vs. ingress-nginx), cert-manager with Cloud DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on GKE from scratch," "set up a new GKE environment end to end," "build a production GKE cluster from a fresh GCP project," or "give me the full sequence to go from nothing to a working GKE cluster."
/complete-kubernetes-deployment-on-oke-oci-from-scratchSequences a complete, end-to-end OKE (Oracle Container Engine for Kubernetes) deployment from a bare OCI tenancy to a production-ready cluster serving a first workload — OCI landing zone prerequisites (Compartments, Dynamic Groups), OKE Enhanced cluster and node pool provisioning, VCN-Native pod networking (with the Calico NetworkPolicy add-on noted), ingress (Native Ingress Controller vs. ingress-nginx), cert-manager with OCI DNS via a community webhook solver, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill sequencing several existing tool-specific skills in the correct order and flagging the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on OKE from scratch," "set up OKE on OCI end to end," "build a production OKE cluster from a fresh OCI tenancy," or "give me the full sequence to go from nothing to a working OKE cluster."
Other plugins' skills for the same job