Kubernetes Nginx Ingress not finding service endpoint












1















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 https://kubernetes.github.io/ingress-nginx/deploy/



I also deployed a simple hello-world app which listens on port 8080



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


And created a service for it



kind: Service
apiVersion: v1
metadata:
namespace: default
name: hello-world
spec:
selector:
app: hello-world
ports:
- name: server
port: 8080


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



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


However, I am unable to ever reach my application, and in the logs I see



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.


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



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










share|improve this question



























    1















    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 https://kubernetes.github.io/ingress-nginx/deploy/



    I also deployed a simple hello-world app which listens on port 8080



    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


    And created a service for it



    kind: Service
    apiVersion: v1
    metadata:
    namespace: default
    name: hello-world
    spec:
    selector:
    app: hello-world
    ports:
    - name: server
    port: 8080


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



    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


    However, I am unable to ever reach my application, and in the logs I see



    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.


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



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










    share|improve this question

























      1












      1








      1








      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 https://kubernetes.github.io/ingress-nginx/deploy/



      I also deployed a simple hello-world app which listens on port 8080



      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


      And created a service for it



      kind: Service
      apiVersion: v1
      metadata:
      namespace: default
      name: hello-world
      spec:
      selector:
      app: hello-world
      ports:
      - name: server
      port: 8080


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



      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


      However, I am unable to ever reach my application, and in the logs I see



      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.


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



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










      share|improve this question














      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 https://kubernetes.github.io/ingress-nginx/deploy/



      I also deployed a simple hello-world app which listens on port 8080



      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


      And created a service for it



      kind: Service
      apiVersion: v1
      metadata:
      namespace: default
      name: hello-world
      spec:
      selector:
      app: hello-world
      ports:
      - name: server
      port: 8080


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



      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


      However, I am unable to ever reach my application, and in the logs I see



      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.


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



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







      nginx kubernetes kubernetes-ingress nginx-ingress






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 3 at 19:26









      cookandycookandy

      517




      517
























          1 Answer
          1






          active

          oldest

          votes


















          1














          I discovered what I was doing wrong. In my application definition I was using name as my selector



            selector:
          matchLabels:
          name: hello-world
          template:
          metadata:
          labels:
          name: hello-world


          Whereas in my service I was using app



            selector:
          app: hello-world


          After updating my service to use app, it worked



            selector:
          matchLabels:
          app: hello-world
          template:
          metadata:
          labels:
          app: hello-world





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54028596%2fkubernetes-nginx-ingress-not-finding-service-endpoint%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            I discovered what I was doing wrong. In my application definition I was using name as my selector



              selector:
            matchLabels:
            name: hello-world
            template:
            metadata:
            labels:
            name: hello-world


            Whereas in my service I was using app



              selector:
            app: hello-world


            After updating my service to use app, it worked



              selector:
            matchLabels:
            app: hello-world
            template:
            metadata:
            labels:
            app: hello-world





            share|improve this answer




























              1














              I discovered what I was doing wrong. In my application definition I was using name as my selector



                selector:
              matchLabels:
              name: hello-world
              template:
              metadata:
              labels:
              name: hello-world


              Whereas in my service I was using app



                selector:
              app: hello-world


              After updating my service to use app, it worked



                selector:
              matchLabels:
              app: hello-world
              template:
              metadata:
              labels:
              app: hello-world





              share|improve this answer


























                1












                1








                1







                I discovered what I was doing wrong. In my application definition I was using name as my selector



                  selector:
                matchLabels:
                name: hello-world
                template:
                metadata:
                labels:
                name: hello-world


                Whereas in my service I was using app



                  selector:
                app: hello-world


                After updating my service to use app, it worked



                  selector:
                matchLabels:
                app: hello-world
                template:
                metadata:
                labels:
                app: hello-world





                share|improve this answer













                I discovered what I was doing wrong. In my application definition I was using name as my selector



                  selector:
                matchLabels:
                name: hello-world
                template:
                metadata:
                labels:
                name: hello-world


                Whereas in my service I was using app



                  selector:
                app: hello-world


                After updating my service to use app, it worked



                  selector:
                matchLabels:
                app: hello-world
                template:
                metadata:
                labels:
                app: hello-world






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 3 at 22:25









                cookandycookandy

                517




                517
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54028596%2fkubernetes-nginx-ingress-not-finding-service-endpoint%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas