Bug 1989700
Summary: | Metallb: The controller fails to handout the available IP address if there is a service that is assigned a static address | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Arti Sood <asood> |
Component: | Networking | Assignee: | Mohamed Mahmoud <mmahmoud> |
Networking sub component: | ovn-kubernetes | QA Contact: | Arti Sood <asood> |
Status: | CLOSED NOTABUG | Docs Contact: | |
Severity: | high | ||
Priority: | unspecified | ||
Version: | 4.9 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-08-04 17:19:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Arti Sood
2021-08-03 18:19:36 UTC
for statically assigned service IP we need to use spec: loadBalancerIP: 40.121.183.52 as described in https://metallb.universe.tf/usage/example/ Provided IP address in service spec as below:- spec: ports: - port: 80 targetPort: 8080 protocol: TCP selector: name: hello-idle type: LoadBalancer loadBalancerIP: 172.31.249.82 IP address is not assigned to service. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-idle LoadBalancer 172.30.188.135 <pending> 80:32179/TCP 45m MetalLB logs error message:- {"caller":"main.go:76","event":"endUpdate","msg":"end of service update","service":"a1/hello-world","ts":"2021-08-04T13:58:51.149428959Z"} {"caller":"main.go:49","event":"startUpdate","msg":"start of service update","service":"a2/hello-idle","ts":"2021-08-04T13:59:57.176240509Z"} {"caller":"service.go:93","event":"clearAssignment","msg":"user requested a different IP than the one currently assigned","reason":"differentIPRequested","service":"a2/hello-idle","ts":"2021-08-04T13:59:57.176300106Z"} {"caller":"service.go:106","error":"\"172.31.249.82\" is not allowed in config","msg":"IP allocation failed","op":"allocateIP","service":"a2/hello-idle","ts":"2021-08-04T13:59:57.176336044Z"} {"caller":"main.go:75","event":"noChange","msg":"service converged, no change","service":"a2/hello-idle","ts":"2021-08-04T13:59:57.176452342Z"} {"caller":"main.go:76","event":"endUpdate","msg":"end of service update","service":"a2/hello-idle","ts":"2021-08-04T13:59:57.176473491Z"} To assign static ip address to a loadbalancer service. 1. Create address pool with IPs that could be used as static IPs. apiVersion: metallb.io/v1alpha1 kind: AddressPool metadata: name: address-pool-static namespace: metallb-system spec: protocol: layer2 addresses: - 172.31.249.82 - 172.31.249.82 - 172.31.249.202 - 172.31.249.202 autoAssign: false 2. Create a service with specific IP and annotation for the address pool. apiVersion: v1 kind: List items: - apiVersion: v1 kind: ReplicationController metadata: labels: name: hello-idle name: hello-idle spec: replicas: 2 selector: name: hello-idle template: metadata: labels: name: hello-idle spec: containers: - image: quay.io/openshifttest/hello-pod@sha256:04b6af86b03c1836211be2589db870dba09b7811c197c47c07fbbe33c7f80ef7 name: hello-idle ports: - containerPort: 8080 protocol: TCP resources: limits: cpu: 200m memory: 256Mi requests: cpu: 100m memory: 256Mi terminationMessagePath: /dev/termination-log dnsPolicy: ClusterFirst restartPolicy: Always securityContext: {} terminationGracePeriodSeconds: 30 - apiVersion: v1 kind: Service metadata: name: hello-idle annotations: metallb.universe.tf/address-pool: address-pool-static spec: ports: - port: 80 targetPort: 8080 protocol: TCP selector: name: hello-idle type: LoadBalancer loadBalancerIP: 172.31.249.82 The service will be assigned 172.31.249.82 from the pool of IPs in the address pool. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-idle LoadBalancer 172.30.191.103 172.31.249.82 80:31966/TCP 13m curl http://172.31.249.82 Hello Pod! I was able create another service that was obtained and assigned IP address dynamically from different address pool. |