Ingress not working in google kubernetes engine for multiple services (Spring Boot)












2















I deployed two services in a cluster in google cloud.



When I run: kubectl get services I get->



NAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-java-1 NodePort 10.7.254.204 <none> 8080:31848/TCP 21m
hello-java-2 NodePort 10.7.246.52 <none> 8080:30624/TCP 19m
kubernetes ClusterIP 10.7.240.1 <none> 443/TCP 23m


Now, I followed as per google cloud docs: Ingress and configured the fanout-ingress as:



apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: fanout-ingress
spec:
rules:
- http:
paths:
- path: /product/*
backend:
serviceName: hello-java-1
servicePort: 8080
- path: /list/*
backend:
serviceName: hello-java-2
servicePort: 8080


Now:



$kubectl get ingress fanout-ingress
NAME HOSTS ADDRESS PORTS AGE
fanout-ingress * 35.190.55.204 80 17m


I get these results.



I checked the command: kubectl describe ingress fanout-ingress



The output is:



  *
/product/* hello-java-1:8080 (<none>)
/list/* hello-java-2:8080 (<none>)
Annotations:
ingress.kubernetes.io/backends: {"k8s-be-30624--e761000d52fd1c80":"HEALTHY","k8s-be-31726--e761000d52fd1c80":"HEALTHY","k8s-be-31848--e761000d52fd1c80":"HEALTHY"}
ingress.kubernetes.io/forwarding-rule: k8s-fw-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/target-proxy: k8s-tp-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/url-map: k8s-um-default-fanout-ingress--e761000d52fd1c80
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ADD 18m loadbalancer-controller default/fanout-ingress
Normal CREATE 17m loadbalancer-controller ip: 35.190.55.204
Normal Service 8m (x4 over 17m) loadbalancer-controller no user specified default backend, using system default


Now when I access http://35.190.55.204/product/home I get spring whitelabel error.. but home is defined in the application! Why this happens?










share|improve this question




















  • 1





    looks like similar issue . Can you try the workaround and check. like this. github.com/kubernetes/ingress-nginx/issues/…

    – Shashank Pai
    Oct 29 '18 at 13:26


















2















I deployed two services in a cluster in google cloud.



When I run: kubectl get services I get->



NAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-java-1 NodePort 10.7.254.204 <none> 8080:31848/TCP 21m
hello-java-2 NodePort 10.7.246.52 <none> 8080:30624/TCP 19m
kubernetes ClusterIP 10.7.240.1 <none> 443/TCP 23m


Now, I followed as per google cloud docs: Ingress and configured the fanout-ingress as:



apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: fanout-ingress
spec:
rules:
- http:
paths:
- path: /product/*
backend:
serviceName: hello-java-1
servicePort: 8080
- path: /list/*
backend:
serviceName: hello-java-2
servicePort: 8080


Now:



$kubectl get ingress fanout-ingress
NAME HOSTS ADDRESS PORTS AGE
fanout-ingress * 35.190.55.204 80 17m


I get these results.



I checked the command: kubectl describe ingress fanout-ingress



The output is:



  *
/product/* hello-java-1:8080 (<none>)
/list/* hello-java-2:8080 (<none>)
Annotations:
ingress.kubernetes.io/backends: {"k8s-be-30624--e761000d52fd1c80":"HEALTHY","k8s-be-31726--e761000d52fd1c80":"HEALTHY","k8s-be-31848--e761000d52fd1c80":"HEALTHY"}
ingress.kubernetes.io/forwarding-rule: k8s-fw-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/target-proxy: k8s-tp-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/url-map: k8s-um-default-fanout-ingress--e761000d52fd1c80
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ADD 18m loadbalancer-controller default/fanout-ingress
Normal CREATE 17m loadbalancer-controller ip: 35.190.55.204
Normal Service 8m (x4 over 17m) loadbalancer-controller no user specified default backend, using system default


Now when I access http://35.190.55.204/product/home I get spring whitelabel error.. but home is defined in the application! Why this happens?










share|improve this question




















  • 1





    looks like similar issue . Can you try the workaround and check. like this. github.com/kubernetes/ingress-nginx/issues/…

    – Shashank Pai
    Oct 29 '18 at 13:26
















2












2








2








I deployed two services in a cluster in google cloud.



When I run: kubectl get services I get->



NAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-java-1 NodePort 10.7.254.204 <none> 8080:31848/TCP 21m
hello-java-2 NodePort 10.7.246.52 <none> 8080:30624/TCP 19m
kubernetes ClusterIP 10.7.240.1 <none> 443/TCP 23m


Now, I followed as per google cloud docs: Ingress and configured the fanout-ingress as:



apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: fanout-ingress
spec:
rules:
- http:
paths:
- path: /product/*
backend:
serviceName: hello-java-1
servicePort: 8080
- path: /list/*
backend:
serviceName: hello-java-2
servicePort: 8080


Now:



$kubectl get ingress fanout-ingress
NAME HOSTS ADDRESS PORTS AGE
fanout-ingress * 35.190.55.204 80 17m


I get these results.



I checked the command: kubectl describe ingress fanout-ingress



The output is:



  *
/product/* hello-java-1:8080 (<none>)
/list/* hello-java-2:8080 (<none>)
Annotations:
ingress.kubernetes.io/backends: {"k8s-be-30624--e761000d52fd1c80":"HEALTHY","k8s-be-31726--e761000d52fd1c80":"HEALTHY","k8s-be-31848--e761000d52fd1c80":"HEALTHY"}
ingress.kubernetes.io/forwarding-rule: k8s-fw-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/target-proxy: k8s-tp-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/url-map: k8s-um-default-fanout-ingress--e761000d52fd1c80
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ADD 18m loadbalancer-controller default/fanout-ingress
Normal CREATE 17m loadbalancer-controller ip: 35.190.55.204
Normal Service 8m (x4 over 17m) loadbalancer-controller no user specified default backend, using system default


Now when I access http://35.190.55.204/product/home I get spring whitelabel error.. but home is defined in the application! Why this happens?










share|improve this question
















I deployed two services in a cluster in google cloud.



When I run: kubectl get services I get->



NAME           TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
hello-java-1 NodePort 10.7.254.204 <none> 8080:31848/TCP 21m
hello-java-2 NodePort 10.7.246.52 <none> 8080:30624/TCP 19m
kubernetes ClusterIP 10.7.240.1 <none> 443/TCP 23m


Now, I followed as per google cloud docs: Ingress and configured the fanout-ingress as:



apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: fanout-ingress
spec:
rules:
- http:
paths:
- path: /product/*
backend:
serviceName: hello-java-1
servicePort: 8080
- path: /list/*
backend:
serviceName: hello-java-2
servicePort: 8080


Now:



$kubectl get ingress fanout-ingress
NAME HOSTS ADDRESS PORTS AGE
fanout-ingress * 35.190.55.204 80 17m


I get these results.



I checked the command: kubectl describe ingress fanout-ingress



The output is:



  *
/product/* hello-java-1:8080 (<none>)
/list/* hello-java-2:8080 (<none>)
Annotations:
ingress.kubernetes.io/backends: {"k8s-be-30624--e761000d52fd1c80":"HEALTHY","k8s-be-31726--e761000d52fd1c80":"HEALTHY","k8s-be-31848--e761000d52fd1c80":"HEALTHY"}
ingress.kubernetes.io/forwarding-rule: k8s-fw-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/target-proxy: k8s-tp-default-fanout-ingress--e761000d52fd1c80
ingress.kubernetes.io/url-map: k8s-um-default-fanout-ingress--e761000d52fd1c80
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ADD 18m loadbalancer-controller default/fanout-ingress
Normal CREATE 17m loadbalancer-controller ip: 35.190.55.204
Normal Service 8m (x4 over 17m) loadbalancer-controller no user specified default backend, using system default


Now when I access http://35.190.55.204/product/home I get spring whitelabel error.. but home is defined in the application! Why this happens?







kubernetes google-kubernetes-engine kubernetes-ingress






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 12:09









Cœur

18.4k9109148




18.4k9109148










asked Oct 29 '18 at 12:46









DillzDillz

929




929








  • 1





    looks like similar issue . Can you try the workaround and check. like this. github.com/kubernetes/ingress-nginx/issues/…

    – Shashank Pai
    Oct 29 '18 at 13:26
















  • 1





    looks like similar issue . Can you try the workaround and check. like this. github.com/kubernetes/ingress-nginx/issues/…

    – Shashank Pai
    Oct 29 '18 at 13:26










1




1





looks like similar issue . Can you try the workaround and check. like this. github.com/kubernetes/ingress-nginx/issues/…

– Shashank Pai
Oct 29 '18 at 13:26







looks like similar issue . Can you try the workaround and check. like this. github.com/kubernetes/ingress-nginx/issues/…

– Shashank Pai
Oct 29 '18 at 13:26














1 Answer
1






active

oldest

votes


















3














I got the issue! For the path to be /product/*, all the URL mappings of our first service Requestpath in spring application should start with /product/




ex: /product/list, /product/add, /product/delete etc




Also for Ingress path rule /list/*, all the URL mappings in our second service Requestpath in spring application should start with /list/




ex: /list/sort, /list/add, /list/delete etc







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%2f53045830%2fingress-not-working-in-google-kubernetes-engine-for-multiple-services-spring-bo%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









    3














    I got the issue! For the path to be /product/*, all the URL mappings of our first service Requestpath in spring application should start with /product/




    ex: /product/list, /product/add, /product/delete etc




    Also for Ingress path rule /list/*, all the URL mappings in our second service Requestpath in spring application should start with /list/




    ex: /list/sort, /list/add, /list/delete etc







    share|improve this answer






























      3














      I got the issue! For the path to be /product/*, all the URL mappings of our first service Requestpath in spring application should start with /product/




      ex: /product/list, /product/add, /product/delete etc




      Also for Ingress path rule /list/*, all the URL mappings in our second service Requestpath in spring application should start with /list/




      ex: /list/sort, /list/add, /list/delete etc







      share|improve this answer




























        3












        3








        3







        I got the issue! For the path to be /product/*, all the URL mappings of our first service Requestpath in spring application should start with /product/




        ex: /product/list, /product/add, /product/delete etc




        Also for Ingress path rule /list/*, all the URL mappings in our second service Requestpath in spring application should start with /list/




        ex: /list/sort, /list/add, /list/delete etc







        share|improve this answer















        I got the issue! For the path to be /product/*, all the URL mappings of our first service Requestpath in spring application should start with /product/




        ex: /product/list, /product/add, /product/delete etc




        Also for Ingress path rule /list/*, all the URL mappings in our second service Requestpath in spring application should start with /list/




        ex: /list/sort, /list/add, /list/delete etc








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Oct 29 '18 at 15:12









        Rico

        28.3k94966




        28.3k94966










        answered Oct 29 '18 at 14:48









        DillzDillz

        929




        929
































            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%2f53045830%2fingress-not-working-in-google-kubernetes-engine-for-multiple-services-spring-bo%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