K8 Ingress does not have an endpoint

7/23/2018

I want to make services accessible from outside the K8 cluster using an ingress controller. Following 5.5 from the Kubernetes Cookbook, I ran this manifest:

kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: nginx-public
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host:
    http:
      paths:
      - path: /web
        backend:
          serviceName: nginx
          servicePort: 80

The Ingress object is visible in the Kubernetes dashboard; but it does not have an assigned endpoint:

enter image description here

Output of kubectl get ing:

NAME           HOSTS     ADDRESS   PORTS     AGE
nginx-public   *                   80        54m

update

Running kubectl describe ingress nginx-public gives:

Name:             nginx-public
Namespace:        default
Address:
Default backend:  default-http-backend:80 (<none>)
Rules:
  Host  Path  Backends
  ----  ----  --------
  *
        /web   nginx:80 (<none>)
Annotations:
  ingress.kubernetes.io/rewrite-target:  /
Events:                                  <none>
-- Joost Döbken
azure
kubernetes
kubernetes-ingress

1 Answer

7/24/2018

Actually this is an issue with Kubernetes Dashboard, we have the same issue.

Even if it isn't displayed it doesn't mean your ingress isn't working. First you should check the ingress with kubectl (kubectl describe ingress nginx-public) and verify that the output is smiliar to this:

Name:             test-ingress
Namespace:        test
Address:          
Default backend:  default-http-backend:80 (<none>)
TLS:
  test-ssl-secret terminates test.myorg.com
Rules:
  Host                      Path  Backends
  ----                      ----  --------
  test.myorg.com  
                            /   test-service:80 (<none>)

Afterwards you should verify your service is reachable via your specified host.

Update:

Depending on the service in front of your ingress-controller your service should be reachable via http://{serverip}:{nodeport-http-port}/web in case your service is of type NodePort(you will get 2 external ports in the 30000-39999 range, one is the http port the other the https port) or http://{address-from-external-loadbalancer}/web if the service is of type LoadBalancer.

2nd-Update

After some further investigation about the issue i stumbled upon a bug issue of kubernetes-dashboard stating that it's indeed possible to show the endpoints of ingress. The problem actually isn't caused by the dashboard, but a missing parameter on the ingress deployment.

For nginx-ingress-controller its the following:

NGINX Ingress CLI arguments

The missing option is --publish-service If you used helm to deploy the controller you need to add the parameter --set controller.publishService.enabled=true

-- BeWu
Source: StackOverflow