Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-1864

[MetalLB] The service should be assigned to node based L2 advertisement that meets the criteria

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Undefined
    • None
    • 4.12
    • Networking / Metal LB
    • None
    • Moderate
    • CNF Network Sprint 225
    • 1
    • False
    • Hide

      None

      Show
      None

    Description

      Description of problem:

      The node to announce the L2 service should be selected based on the L2 advertisement that completely matches the ipaddresspool selector and the ipaddress pool.
      
      Two l2 advertisements that have ip addresspools selected on label (zone=east) but one has specific ip address pool while the other does not have.
      Service is created requesting ip addresspool that is not specified in any of the advertisement.

      Version-Release number of selected component (if applicable):

      4.12

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create two ip address pools - ipaddresspool-a and ipaddress-pool-b both with label zone=east
      -----
      oc get ipaddresspool ipaddresspool-a -n openshift-operators -oyaml
      apiVersion: metallb.io/v1beta1
      kind: IPAddressPool
      metadata:
        creationTimestamp: "2022-09-29T19:17:35Z"
        generation: 1
        labels:
          zone: east
        name: ipaddresspool-a
        namespace: openshift-operators
        resourceVersion: "8283505"
        uid: 28e234cc-acea-422f-b590-173b8ec4c34d
      spec:
        addresses:
        - 192.168.216.101-192.168.216.150
        autoAssign: true
        avoidBuggyIPs: false
      
       oc get ipaddresspool ipaddresspool-b -n openshift-operators -oyaml
      apiVersion: metallb.io/v1beta1
      kind: IPAddressPool
      metadata:
        creationTimestamp: "2022-09-29T19:17:42Z"
        generation: 1
        labels:
          zone: east
        name: ipaddresspool-b
        namespace: openshift-operators
        resourceVersion: "8317966"
        uid: b8ea254b-20e2-4062-b2e4-62b98d6e28fb
      spec:
        addresses:
        - 192.168.216.151-192.168.216.200
        autoAssign: true
        avoidBuggyIPs: false
      
      
       2. Create two l2advertisements one with ipaddresspool selector & ip addresspool and other with just ip addresspool selector announcing service on different set of nodes.
      
      oc get l2advertisements l2-adv-east -n openshift-operators -oyaml
      apiVersion: metallb.io/v1beta1
      kind: L2Advertisement
      metadata:
        creationTimestamp: "2022-09-29T19:33:42Z"
        generation: 2
        name: l2-adv-east
        namespace: openshift-operators
        resourceVersion: "8318763"
        uid: 7a0c23ce-e7a6-46db-a81f-0ccab7adf9e0
      spec:
        ipAddressPoolSelectors:
        - matchExpressions:
          - key: zone
            operator: In
            values:
            - east
        ipAddressPools:
        - ipaddresspool-a
        nodeSelectors:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - worker000-r650
            - worker001-r650
            - worker002-r650
            - worker003-r650
            - worker004-r650
            - worker005-r650
      
      oc get l2advertisements l2-adv-west -n openshift-operators -oyaml
      apiVersion: metallb.io/v1beta1
      kind: L2Advertisement
      metadata:
        creationTimestamp: "2022-09-29T19:34:59Z"
        generation: 2
        name: l2-adv-west
        namespace: openshift-operators
        resourceVersion: "8329049"
        uid: 26f4b83c-2cf4-4b73-a404-bf463900bdb8
      spec:
        ipAddressPoolSelectors:
        - matchExpressions:
          - key: zone
            operator: In
            values:
            - east
        nodeSelectors:
        - matchExpressions:
          - key: kubernetes.io/hostname
            operator: In
            values:
            - worker006-r650
            - worker008-r650
            - worker009-r650
            - worker010-r650
            - worker011-r650
      
      
       3. Create a service requesting address from ipaddresspool-b.
      oc get svc hello-idle -oyaml
      apiVersion: v1
      kind: Service
      metadata:
        annotations:
          metallb.universe.tf/address-pool: ipaddresspool-b
        creationTimestamp: "2022-09-29T20:28:51Z"
        name: hello-idle
        namespace: a1
        resourceVersion: "8329276"
        uid: cd181150-b4fc-4c8a-bdda-c5c03f91c5e2
      spec:
        allocateLoadBalancerNodePorts: true
        clusterIP: 172.30.8.149
        clusterIPs:
        - 172.30.8.149
        externalTrafficPolicy: Cluster
        internalTrafficPolicy: Cluster
        ipFamilies:
        - IPv4
        ipFamilyPolicy: SingleStack
        ports:
        - nodePort: 31586
          port: 8000
          protocol: TCP
          targetPort: 8080
        selector:
          name: hello-idle
        sessionAffinity: None
        type: LoadBalancer
      status:
        loadBalancer:
          ingress:
          - ip: 192.168.216.151
      
      
      oc get events
      LAST SEEN   TYPE     REASON             OBJECT                             MESSAGE
      37m         Normal   Scheduled          pod/hello-idle-c4pt5               Successfully assigned a1/hello-idle-c4pt5 to worker002-r650 by master-2
      37m         Normal   AddedInterface     pod/hello-idle-c4pt5               Add eth0 [10.129.6.16/23] from ovn-kubernetes
      37m         Normal   Pulled             pod/hello-idle-c4pt5               Container image "quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7" already present on machine
      37m         Normal   Created            pod/hello-idle-c4pt5               Created container hello-idle
      37m         Normal   Started            pod/hello-idle-c4pt5               Started container hello-idle
      37m         Normal   Scheduled          pod/hello-idle-rqjbk               Successfully assigned a1/hello-idle-rqjbk to worker011-r650 by master-2
      37m         Normal   AddedInterface     pod/hello-idle-rqjbk               Add eth0 [10.131.0.235/23] from ovn-kubernetes
      37m         Normal   Pulled             pod/hello-idle-rqjbk               Container image "quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7" already present on machine
      37m         Normal   Created            pod/hello-idle-rqjbk               Created container hello-idle
      37m         Normal   Started            pod/hello-idle-rqjbk               Started container hello-idle
      37m         Normal   IPAllocated        service/hello-idle                 Assigned IP ["192.168.216.151"]
      37m         Normal   SuccessfulCreate   replicationcontroller/hello-idle   Created pod: hello-idle-c4pt5
      37m         Normal   SuccessfulCreate   replicationcontroller/hello-idle   Created pod: hello-idle-rqjbk
      2m35s       Normal   nodeAssigned       service/hello-idle                 announcing from node "worker002-r650" with protocol "layer2"
      
      
      

      Actual results:

      Node selected ( worker002-r650) to announce the L2 service IP is from l2-adv-east. l2-adv-east has both ipaddresspool selector + ip address pool (ipaddresspool-a)

      Expected results:

      Node selected to announce L2 service IP should be from l2-adv-west that matches the ipaddresspool selector label.

      Additional info:

      ipaddresspool selector AND ip addresspool both should be considered if l2advertisement is created with both values.

       

       

       

       

       

      Attachments

        Activity

          People

            fpaoline@redhat.com Federico Paolinelli
            rhn-support-asood Arti Sood
            Arti Sood Arti Sood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: