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

"No endpoints" issue #839

Closed
justinsb opened this issue Jun 12, 2017 · 1 comment
Closed

"No endpoints" issue #839

justinsb opened this issue Jun 12, 2017 · 1 comment
Assignees

Comments

@justinsb
Copy link
Member

We were hitting the "no endpoints for X" issue after upgrading from beta.5 to beta.7.

I think the problem is that there are too many names floating around, but I think that actually ingress has made a mistake here: https://github.com/kubernetes/ingress/blob/master/core/pkg/ingress/controller/controller.go#L840-L848

	for _, servicePort := range svc.Spec.Ports {
		// targetPort could be a string, use the name or the port (int)
		if strconv.Itoa(int(servicePort.Port)) == backendPort ||
			servicePort.TargetPort.String() == backendPort ||
			servicePort.Name == backendPort {

So backendPort is the backendPort of the ingress. We match against the service's exposed port (good), or the service's Name (good) or the service's TargetPort (which I think is wrong, but is not the issue here).

			endps := ic.getEndpoints(svc, servicePort.TargetPort, api.ProtocolTCP, hz)
			if len(endps) == 0 {
				glog.Warningf("service %v does not have any active endpoints", svcKey)
			}

We then get the endpoints using servicePort.TargetPort ... but that is not correct. It should be servicePort.Name, because it is the service port Name that is stored in the Endpoint, not the targetport Name.

https://github.com/kubernetes/kubernetes/blob/master/pkg/api/types.go#L2833-L2835

Also note that there might be no name at all, if the service only defines a single port.

(For the record, I also thought it was the TargetPort in the Endpoint)

@aledbf
Copy link
Member

aledbf commented Jun 13, 2017

Closing. Fixed in #846

@aledbf aledbf closed this as completed Jun 13, 2017
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

Successfully merging a pull request may close this issue.

2 participants