Migrate to current MetalLB Service configuration

Proprietary

Bring the Service side of a MetalLB installation up to date: annotations move off the deprecated metallb.universe.tf domain onto metallb.io, and an address pinned in the deprecated spec.loadBalancerIP moves into the metallb.io/loadBalancerIPs annotation that replaced it. These are MetalLB's own conventions rather than Kubernetes API migrations. Nothing here applies to a cluster whose LoadBalancer services are served by a cloud provider or by another bare metal load balancer, so scope the run to the manifests MetalLB serves. The domain rename runs first, so that a service already carrying metallb.universe.tf/loadBalancerIPs is compared against its migrated name.

org.openrewrite.kubernetes.metallb.MetalLB
mod run . --recipe=org.openrewrite.kubernetes.metallb.MetalLB

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Migrate MetalLB annotations to the metallb.io domain
  2. Migrate Service spec.loadBalancerIP to the MetalLB annotation