Bug 1881931 - Headless services are not skipped by Kuryr
Summary: Headless services are not skipped by Kuryr
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Maysa Macedo
QA Contact: GenadiC
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-23 12:19 UTC by Maysa Macedo
Modified: 2020-10-27 16:44 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 16:44:06 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift kuryr-kubernetes pull 350 0 None open Bug 1881931: Skip KuryrLoadbalancer creation for Headless Service 2020-09-23 12:22:10 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:44:25 UTC

Description Maysa Macedo 2020-09-23 12:19:54 UTC
Description of problem:

Headless Service are not wired by Kuryr as it returns
directly the Pod's IPs behind the Service and do not
load-balance between them, consequently no KuryrLoadbalancer
Custom Resource should not get created for it.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Maysa Macedo 2020-09-23 12:21:20 UTC
s/not get created/get created

Comment 3 rlobillo 2020-09-25 10:16:34 UTC
Verified on OCP4.6.0-0.nightly-2020-09-24-074159 over RHOS-16.1-RHEL-8-20200903.n.0.

Headless service is created and fully operative without neither klb crd nor loadbalancer associated to it:

With below definition:

$ cat demo_svc.yaml 
apiVersion: v1
kind: Service
metadata:
  name: demo
labels:
  app: demo
spec:
  selector:                  
    app: demo
  clusterIP: None
  ports:
  - port: 80
    protocol: TCP
    targetPort: 8080

Below service is created:

$ oc get all -o wide
NAME                       READY   STATUS    RESTARTS   AGE    IP               NODE                          NOMINATED NODE   READINESS GATES
pod/demo-66cdc7b66-gtmrf   1/1     Running   0          114m   10.128.116.11    ostest-dxmgg-worker-0-cffvp   <none>           <none>
pod/demo-66cdc7b66-nnlds   1/1     Running   0          114m   10.128.117.32    ostest-dxmgg-worker-0-m6k55   <none>           <none>
pod/demo-66cdc7b66-zpnzt   1/1     Running   0          114m   10.128.116.91    ostest-dxmgg-worker-0-shl4z   <none>           <none>
pod/demo-caller            1/1     Running   0          109m   10.128.117.118   ostest-dxmgg-worker-0-shl4z   <none>           <none>

NAME           TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE     SELECTOR
service/demo   ClusterIP   None         <none>        80/TCP    9m50s   app=demo

NAME                   READY   UP-TO-DATE   AVAILABLE   AGE    CONTAINERS   IMAGES       SELECTOR
deployment.apps/demo   3/3     3            3           114m   demo         kuryr/demo   app=demo

NAME                             DESIRED   CURRENT   READY   AGE    CONTAINERS   IMAGES       SELECTOR
replicaset.apps/demo-66cdc7b66   3         3         3       114m   demo         kuryr/demo   app=demo,pod-template-hash=66cdc7b66


So,when trying to reach pod/demo through the service, only the first one is reached (there is no loadbalancing):

(shiftstack) [stack@undercloud-0 endpoint_test]$ oc rsh pod/demo-caller curl demo.test.svc.cluster.local:8080
demo-66cdc7b66-gtmrf: HELLO! I AM ALIVE!!!
(shiftstack) [stack@undercloud-0 endpoint_test]$ oc rsh pod/demo-caller curl demo.test.svc.cluster.local:8080
demo-66cdc7b66-gtmrf: HELLO! I AM ALIVE!!!
(shiftstack) [stack@undercloud-0 endpoint_test]$ oc rsh pod/demo-caller curl demo.test.svc.cluster.local:8080
demo-66cdc7b66-gtmrf: HELLO! I AM ALIVE!!!
(shiftstack) [stack@undercloud-0 endpoint_test]$ oc rsh pod/demo-caller curl demo.test.svc.cluster.local:8080
demo-66cdc7b66-gtmrf: HELLO! I AM ALIVE!!!

There is not klb and openstack loadbalancer associated:

(shiftstack) [stack@undercloud-0 endpoint_test]$ oc get svc/demo
NAME   TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
demo   ClusterIP   None         <none>        80/TCP    11m
(shiftstack) [stack@undercloud-0 endpoint_test]$ oc get klb
No resources found in test namespace.
$ openstack loadbalancer show test/demo
Unable to locate test/demo in loadbalancers


Furthermore, as expected,the DNS resolution for the headless service provides directly the 3 pods fulfilling the selector condition:

$ oc rsh pod/demo-caller nslookup demo.test.svc.cluster.local
Server:		172.30.0.10
Address:	172.30.0.10:53


Name:	demo.test.svc.cluster.local
Address: 10.128.116.11
Name:	demo.test.svc.cluster.local
Address: 10.128.116.91
Name:	demo.test.svc.cluster.local
Address: 10.128.117.32

Comment 6 errata-xmlrpc 2020-10-27 16:44:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.