<p>I'm having some trouble getting the Nginx ingress controller working in my Kubernetes cluster. I have created the nginx-ingress deployments, services, roles, etc., according to <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/</a></p>

<p>I also deployed a simple <code>hello-world</code> app which listens on port <code>8080</code></p>

<pre><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: hello-world
  namespace: default
spec:
  selector:
    matchLabels:
      name: hello-world
  template:
    metadata:
      labels:
        name: hello-world
    spec:
      containers:
      - name: hello-world
        image: myrepo/hello-world
        resources:
          requests:
            memory: 200Mi
            cpu: 150m
          limits:
            cpu: 300m
        ports:
          - name: http
            containerPort: 8080
            protocol: TCP
</code></pre>

<p>And created a service for it</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  namespace: default
  name: hello-world
spec:
  selector:
    app: hello-world
  ports:
    - name: server
      port: 8080
</code></pre>

<p>Finally, I created a TLS secret (<code>my-tls-secret</code>) and deployed the nginx ingress per the instructions.  For example:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
  name: hello-world
  namespace: default
spec:
  rules:
    - host: hello-world.mydomain.com
      http:
        paths:
        - path: /
          backend:
            serviceName: hello-world
            servicePort: server
  tls:
      - hosts:
          - hello-world.mydomain.com
        secretName: my-tls-cert
</code></pre>

<p>However, I am unable to ever reach my application, and in the logs I see</p>

<pre><code>W0103 19:11:15.712062       6 controller.go:826] Service "default/hello-world" does not have any active Endpoint.
I0103 19:11:15.712254       6 controller.go:172] Configuration changes detected, backend reload required.
I0103 19:11:15.864774       6 controller.go:190] Backend successfully reloaded.
</code></pre>

<p>I am not sure why it says <code>Service "default/hello-world" does not have any active Endpoint</code>. I have used a similar service definition for the traefik ingress controller without any issues.</p>

<p>I'm hoping I'm missing something obvious with the nginx ingress. Any help you can provide would be appreciated! </p>

cookandy
<p>I discovered what I was doing wrong. In my application definition I was using <code>name</code> as my selector</p>

<pre><code>  selector:
    matchLabels:
      name: hello-world
  template:
    metadata:
      labels:
        name: hello-world
</code></pre>

<p>Whereas in my service I was using <code>app</code></p>

<pre><code>  selector:
    app: hello-world
</code></pre>

<p>After updating my service to use <code>app</code>, it worked</p>

<pre><code>  selector:
    matchLabels:
      app: hello-world
  template:
    metadata:
      labels:
        app: hello-world
</code></pre>
