Bug 1937459
| Summary: | Wrong Subnet retrieved for Service without Selector | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Maysa Macedo <mdemaced> |
| Component: | Networking | Assignee: | MichaĆ Dulko <mdulko> |
| Networking sub component: | kuryr | QA Contact: | Itzik Brown <itbrown> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | unspecified | CC: | juriarte, mdulko |
| Version: | 4.7 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.8.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-07-27 22:52:37 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1970320 | ||
|
Description
Maysa Macedo
2021-03-10 17:05:16 UTC
Steps to reproduce/verify: 1. Install a cluster with OVN Octavia Provider configured 2. Create a Pod running on host-network 3. Create a Service without Selector e.g https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors 4. Create an Endpoint pointing to that Pod on host-network OC 4.8.0-0.nightly-2021-05-10-225140
OSP RHOS-16.1-RHEL-8-20210323.n.0
deploy.yaml
------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo
labels:
app: demo
spec:
replicas: 2
selector:
matchLabels:
app: demo
template:
metadata:
labels:
app: demo
spec:
hostNetwork: true
containers:
- name: demo
image: quay.io/kuryr/demo
ports:
- containerPort: 8080
service.yaml
-------------
apiVersion: v1
kind: Service
metadata:
name: demo
labels:
app: demo
spec:
ports:
- port: 80
protocol: TCP
targetPort: 8080
Create pods
------------
$ oc create -f deploy.yaml
Created a service
-----------------
$ oc create -f service.yaml
Get pods addresses
------------------
$ oc get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
demo-7f5775d4fd-49vgw 1/1 Running 0 39m 10.196.3.141 ostest-9m8zj-worker-100-42rrx <none> <none>
demo-7f5775d4fd-hkz95 1/1 Running 0 39m 10.196.2.6 ostest-9m8zj-worker-100-wxpkh <none> <none>
endpoints.yaml
--------------
apiVersion: v1
kind: Endpoints
metadata:
name: demo
subsets:
- addresses:
- ip: 10.196.3.141
- ip: 10.196.2.6
ports:
- port: 8080
Create endpoints
----------------
$ oc create -f endpoints.yaml
Open port 8080 in the worker security group
-------------------------------------------
$ . shiftstackrc; openstack security group rule create --dst-port 8080 --ingress --protocol tcp ostest-9m8zj-worker
Get Service IP
--------------
$ oc get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
demo ClusterIP 172.30.56.222 <none> 80/TCP 92m
Connect to the service from a pod
---------------------------------
$ oc exec -it demo-7f5775d4fd-49vgw -- curl 172.30.56.222
ostest-9m8zj-worker-100-42rrx: HELLO! I AM ALIVE!!!
$ oc exec -it demo-7f5775d4fd-49vgw -- curl 172.30.56.222
ostest-9m8zj-worker-100-wxpkh: HELLO! I AM ALIVE!!!
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 (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), 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/RHSA-2021:2438 |