Skip to content

Deprecated MetalLB managed annotations not removed from service on upgrade #2642

Description

@krezovic

MetalLB Version

0.14.9

Deployment method

Charts

Main CNI

flannel

Kubernetes Version

1.31.4

Cluster Distribution

k3s

Describe the bug

Annotations starting with "metallb.universe.tf" are deprecated as announced.

However, if a service was deployed using an older version, it contains metallb managed annotation metallb.universe.tf/ip-allocated-from-pool.

To Reproduce

  1. Deploy a service with metallb < 0.14.9 and assign an IP using metallb.universe.tf/loadBalancerIPs
  2. Upgrade metallb to 0.14.9
  3. Re-apply the same service after changing the deprecated annotation to metallb.io/loadBalancerIPs

Expected Behavior

MetalLB will complain about use of deprecated annotations in kubernetes events - however that annotation was set by MetalLB.

{68C91FDB-6B72-4AA5-A8AD-2ABE068D59D9}

Do note that service gets the new annotation metallb.io/ip-allocated-from-pool, but it does not remove the old annotation - which is what I'd expect.

Additional Context

# Source: haproxy/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: haproxy
  namespace: default
  labels:
    helm.sh/chart: haproxy-1.23.0
    app.kubernetes.io/name: haproxy
    app.kubernetes.io/instance: haproxy
    app.kubernetes.io/version: "3.0.4"
    app.kubernetes.io/managed-by: Helm
  annotations:
    metallb.io/loadBalancerIPs: "192.168.0.50"
spec:
  type: LoadBalancer
  selector:
    app.kubernetes.io/name: haproxy
    app.kubernetes.io/instance: haproxy
  externalTrafficPolicy: Local
  ports:
  - name: http
    protocol: TCP
    port: 80
    targetPort: http
  - name: https
    protocol: TCP
    port: 443
    targetPort: https

I've read and agree with the following

  • I've checked all open and closed issues and my request is not there.
  • I've checked all open and closed pull requests and my request is not there.

I've read and agree with the following

  • I've checked all open and closed issues and my issue is not there.
  • This bug is reproducible when deploying MetalLB from the main branch
  • I have read the troubleshooting guide and I am still not able to make it work
  • I checked the logs and MetalLB is not discarding the configuration as not valid
  • I enabled the debug logs, collected the information required from the cluster using the collect script and will attach them to the issue
  • I will provide the definition of my service and the related endpoint slices and attach them to this issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions