Skip to content

[Bug]Request specific IPs not working #1984

Closed

Description

@joy717
  • Version of MetalLB: v0.13.10
  • Version of Kubernetes: v1.24.6
  • Name and version of network addon: Calico v3.23.3
  • Whether you've configured kube-proxy for iptables or ipvs mode: ipvs

How to produce:
I have a svc my-svc which specify an ip address. eg: 192.168.1.10
and there are other svces which is pending.
after restarting MetalLB's controller again and again, this ip will be assigned to other svc.

which is not correct.

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"vin-nginx","namespace":"default"},"spec":{"ports":[{"port":80,"protocol":"TCP","targetPort":80}],"selector":{"app":"vin-nginx"}}}
    metallb.universe.tf/loadBalancerIPs: 192.168.20.11
  creationTimestamp: "2023-06-16T09:33:02Z"
  name: vin-nginx
  namespace: default
  resourceVersion: "2226800"
  uid: 0501ddb1-7df8-4389-85bf-bd7bb112bf05
spec:
  allocateLoadBalancerNodePorts: true
  clusterIP: 10.101.243.80
  clusterIPs:
  - 10.101.243.80
  externalTrafficPolicy: Cluster
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - nodePort: 32725
    port: 80
    protocol: TCP
    targetPort: 80
  selector:
    app: vin-nginx
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer: {}
[root@k8s-1 ~]# kubectl  get svc
NAME         TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)        AGE
kubernetes   ClusterIP      10.96.0.1        <none>          443/TCP        20d
vin-nginx    LoadBalancer   10.101.243.80    <pending>       80:32725/TCP   3d22h
vin-nginx3   LoadBalancer   10.98.253.119    <pending>       80:32616/TCP   3d22h
vin-nginx4   LoadBalancer   10.110.171.155   <pending>       80:32065/TCP   3d22h
vin-nginx5   LoadBalancer   10.97.219.26     192.168.20.11   80:32146/TCP   3d22h

Activity

  1. fedepaol commented on Jun 20, 2023

    @fedepaol
    Member

    Yeah, the controller restart is something we can improve. One possible way is to loop all the services that have an IP already assigned, in order to maintain it if possible.

  2. joy717 commented on Jun 20, 2023

    @joy717
    Author

    Thx for replying.
    Here is my thoughts: #1774 (comment)

  3. fedepaol commented on Jun 20, 2023

    @fedepaol
    Member

    yep I am advocating for the first approach you suggested as it will keep the current stateless approach

  4. changed the title [-][Bug]Request specifict IPs not working[/-] [+][Bug]Request specific IPs not working[/+] on Jun 21, 2023
  5. liornoy commented on Jul 17, 2023

    @liornoy
    Contributor

    Hey @joy717 just updating you that I'm working on a fix for that.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions