How to access port forward services on gke

1/2/2019

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?

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

2 Answers

1/2/2019

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

-- Asif Tanwir
Source: StackOverflow

1/2/2019

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.

-- J.Rojas
Source: StackOverflow