How to access port forward services on gke












1















I'm new to gke/gcp and this is my first project.
I'm setting up istio using https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/ tutorial.



I've exposed grafana as shown in the post using:
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &



curl http://localhost:3000/dashboard/db/istio-dashboard
gives me http page on terminal, to access it from the browser I'm using master ip I get after executing kubectl cluster-info.



http://{master-ip}:3000/dashboard/db/istio-dashboard is not accessible.



How do I access services using port-forward on gke?










share|improve this question





























    1















    I'm new to gke/gcp and this is my first project.
    I'm setting up istio using https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/ tutorial.



    I've exposed grafana as shown in the post using:
    kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &



    curl http://localhost:3000/dashboard/db/istio-dashboard
    gives me http page on terminal, to access it from the browser I'm using master ip I get after executing kubectl cluster-info.



    http://{master-ip}:3000/dashboard/db/istio-dashboard is not accessible.



    How do I access services using port-forward on gke?










    share|improve this question



























      1












      1








      1








      I'm new to gke/gcp and this is my first project.
      I'm setting up istio using https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/ tutorial.



      I've exposed grafana as shown in the post using:
      kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &



      curl http://localhost:3000/dashboard/db/istio-dashboard
      gives me http page on terminal, to access it from the browser I'm using master ip I get after executing kubectl cluster-info.



      http://{master-ip}:3000/dashboard/db/istio-dashboard is not accessible.



      How do I access services using port-forward on gke?










      share|improve this question
















      I'm new to gke/gcp and this is my first project.
      I'm setting up istio using https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/ tutorial.



      I've exposed grafana as shown in the post using:
      kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}') 3000:3000 &



      curl http://localhost:3000/dashboard/db/istio-dashboard
      gives me http page on terminal, to access it from the browser I'm using master ip I get after executing kubectl cluster-info.



      http://{master-ip}:3000/dashboard/db/istio-dashboard is not accessible.



      How do I access services using port-forward on gke?







      kubernetes google-cloud-platform google-kubernetes-engine istio






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 2 at 8:45









      Cœur

      19k9113155




      19k9113155










      asked Jan 2 at 8:02









      prranayprranay

      388618




      388618
























          2 Answers
          2






          active

          oldest

          votes


















          2














          First grab the name of the Pod



          $ kubectl get pod


          and then use the port-forward command.



          $ kubectl port-forward <pod-name> 3000:3000


          It worked for me, I've found it from this nice website also explained on detail how to do it. Hope it can be useful.






          share|improve this answer


























          • port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

            – prranay
            Jan 2 at 9:50



















          0














          What (exact) http page is returned by the curl command? Both of these docs [1]&[2] suggest using the url (with localhost) in the browser after setting up a tunnel to Grafana: http://localhost:3000/dashboard/db/istio-dashboard



          Alternatively, have you tried with istio-ingressgateway IP address?



          [1] https://github.com/GoogleCloudPlatform/gke-istio-telemetry-demo#view-grafana-ui



          [2] https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/#grafana






          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%2f54003047%2fhow-to-access-port-forward-services-on-gke%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            First grab the name of the Pod



            $ kubectl get pod


            and then use the port-forward command.



            $ kubectl port-forward <pod-name> 3000:3000


            It worked for me, I've found it from this nice website also explained on detail how to do it. Hope it can be useful.






            share|improve this answer


























            • port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

              – prranay
              Jan 2 at 9:50
















            2














            First grab the name of the Pod



            $ kubectl get pod


            and then use the port-forward command.



            $ kubectl port-forward <pod-name> 3000:3000


            It worked for me, I've found it from this nice website also explained on detail how to do it. Hope it can be useful.






            share|improve this answer


























            • port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

              – prranay
              Jan 2 at 9:50














            2












            2








            2







            First grab the name of the Pod



            $ kubectl get pod


            and then use the port-forward command.



            $ kubectl port-forward <pod-name> 3000:3000


            It worked for me, I've found it from this nice website also explained on detail how to do it. Hope it can be useful.






            share|improve this answer















            First grab the name of the Pod



            $ kubectl get pod


            and then use the port-forward command.



            $ kubectl port-forward <pod-name> 3000:3000


            It worked for me, I've found it from this nice website also explained on detail how to do it. Hope it can be useful.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 2 at 10:45

























            answered Jan 2 at 9:11









            J.RojasJ.Rojas

            10916




            10916













            • port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

              – prranay
              Jan 2 at 9:50



















            • port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

              – prranay
              Jan 2 at 9:50

















            port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

            – prranay
            Jan 2 at 9:50





            port forwarding is working fine for me. As curl localhost:3000/dashboard/db/istio-dashboard is giving the result. Since I'm running this on google kubernetes engine, I want to know how can I access it in browser. One way I can think of is http://{master-ip}:3000/dashboard/db/istio-dashboard , but it is not working for me.

            – prranay
            Jan 2 at 9:50













            0














            What (exact) http page is returned by the curl command? Both of these docs [1]&[2] suggest using the url (with localhost) in the browser after setting up a tunnel to Grafana: http://localhost:3000/dashboard/db/istio-dashboard



            Alternatively, have you tried with istio-ingressgateway IP address?



            [1] https://github.com/GoogleCloudPlatform/gke-istio-telemetry-demo#view-grafana-ui



            [2] https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/#grafana






            share|improve this answer




























              0














              What (exact) http page is returned by the curl command? Both of these docs [1]&[2] suggest using the url (with localhost) in the browser after setting up a tunnel to Grafana: http://localhost:3000/dashboard/db/istio-dashboard



              Alternatively, have you tried with istio-ingressgateway IP address?



              [1] https://github.com/GoogleCloudPlatform/gke-istio-telemetry-demo#view-grafana-ui



              [2] https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/#grafana






              share|improve this answer


























                0












                0








                0







                What (exact) http page is returned by the curl command? Both of these docs [1]&[2] suggest using the url (with localhost) in the browser after setting up a tunnel to Grafana: http://localhost:3000/dashboard/db/istio-dashboard



                Alternatively, have you tried with istio-ingressgateway IP address?



                [1] https://github.com/GoogleCloudPlatform/gke-istio-telemetry-demo#view-grafana-ui



                [2] https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/#grafana






                share|improve this answer













                What (exact) http page is returned by the curl command? Both of these docs [1]&[2] suggest using the url (with localhost) in the browser after setting up a tunnel to Grafana: http://localhost:3000/dashboard/db/istio-dashboard



                Alternatively, have you tried with istio-ingressgateway IP address?



                [1] https://github.com/GoogleCloudPlatform/gke-istio-telemetry-demo#view-grafana-ui



                [2] https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/#grafana







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 2 at 19:16









                Asif TanwirAsif Tanwir

                1036




                1036






























                    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%2f54003047%2fhow-to-access-port-forward-services-on-gke%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

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith