I have set up a 3 node kubernetes host cluster using rancher. I want to use the monitoring-grafana service which is installed by default on the nodes. I change the service type of the monitoring grafana service to Nodeport to expose it to a specific port. However i am still unable to access it. Below are the config details.
port-fowarding should work:
kubectl port-forward -n kube-system "$(kubectl get -n kube-system pod --selector=k8s-app=grafana -o jsonpath='{.items..metadata.name}')" 3000
Hi @jrosengren I ran the above command and it started listening on port 3000, however i was unable to access it using <Rancher_server_IP>:3000
Below is the out put of the kubectl cluster-info command : and also the screenshot of the grafana dashboard when trying to access the mentioned url in the info:
ubuntu@Host3:~$ kubectl cluster-info
Kubernetes master is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443
Heapster is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443/api/v1/namespaces/kube-system/services/kube-dns/proxy
kubernetes-dashboard is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy
monitoring-grafana is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
monitoring-influxdb is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443/api/v1/namespaces/kube-system/services/monitoring-influxdb/proxy
tiller-deploy is running at https://<Rancher_IP>:8080/r/projects/1a5/kubernetes:6443/api/v1/namespaces/kube-system/services/tiller-deploy/proxy
After you create the port-forward through kubectl, you would access via http://localhost:3000
thanks @jrosengren. I exposed the grafana service type as loadbalancer and was able to access the dashboard.