Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: reference pod targetPort by name doesn't work #80

Closed
pires opened this issue Feb 23, 2017 · 3 comments
Closed

Bug: reference pod targetPort by name doesn't work #80

pires opened this issue Feb 23, 2017 · 3 comments

Comments

@pires
Copy link
Contributor

pires commented Feb 23, 2017

Having the following descriptors...

iis-pod.yaml:

apiVersion: v1
kind: Pod
metadata:
  name: iis
  labels:
    component: iis-http-server
spec:
  containers:
  - name: iis
    image: microsoft/iis:nanoserver
    imagePullPolicy: IfNotPresent
    ports:
    - containerPort: 80
      name: iis-http
  nodeSelector:
    beta.kubernetes.io/os: windows

iis-svc.yaml:

apiVersion: v1
kind: Service
metadata:
  name: iis
spec:
  clusterIP: 10.100.28.123
  selector:
    component: iis-http-server
  ports:
  - name: http
    port: 80
    targetPort: iis-http

...works in Kubernetes because the controller-manager block that takes care of service endpoints can map service targetPort: iis-http to pod containerPort: 80 (mapped by name: iis-http).

However, OVN doesn't follow:

$ sudo ovn-nbctl list Load_Balancer
_uuid               : a53b0274-aeb9-4ec0-9668-acbb09077297
external_ids        : {"k8s-cluster-lb-tcp"=yes}
protocol            : []
vips                : {"10.100.0.10:53"="172.17.0.2:53", "10.100.0.1:443"="10.142.0.2:443", "10.100.28.123:80"="10.244.5.234:iis-http"}

_uuid               : 99f881dd-b0cf-492e-8008-2cc1be371829
external_ids        : {"k8s-cluster-lb-udp"=yes}
protocol            : udp
vips                : {"10.100.0.10:53"="172.17.0.2:53"}

The issue is "10.244.5.234:iis-http".

@shettyg
Copy link
Collaborator

shettyg commented Feb 23, 2017

Thanks for the bug report. Do you happen to know whether this name is unique across namespaces or the same name can be repeated across namespaces?

@pires
Copy link
Contributor Author

pires commented Feb 24, 2017

All Kubernetes namespaced resources, meaning resources isolated by a namespace, can have repeated names across namespaces.

@shettyg
Copy link
Collaborator

shettyg commented Feb 24, 2017

I have a fix. I will spend some time sanity testing it before posting it here.

shettyg added a commit that referenced this issue Mar 1, 2017
Fixes: #80

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants