Running dashboard inside play-with-kubernetes

10/24/2017

I'm trying to start a dashboard inside play-with-kubernetes

Commands I'm running:

start admin node

kubeadm init --apiserver-advertise-address $(hostname -i)

start network

kubectl apply -n kube-system -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

allow master to hold nodes(?)

kubectl taint nodes --all node-role.kubernetes.io/master-

Wait until dns is up

kubectl get pods --all-namespaces

join node (copy from admin startup, not from here)

kubeadm join --token 43d52c.d72308004d523ac4 10.0.21.3:6443

download and run dashboard

curl -L -s https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml  | sed 's/targetPort: 8443/targetPort: 8443\n  type: NodePort/' | \
    kubectl apply -f -

Unfortunatelly dashboard is not available. What should I do to correctly deploy it inside play-with-kubernetes?

-- Marcin Szymczak
kubernetes
kubernetes-play

1 Answer

10/24/2017

You need heapster for dashboard to work. So execute these as well:

kubectl apply -f https://github.com/kubernetes/heapster/raw/master/deploy/kube-config/rbac/heapster-rbac.yaml
kubectl apply -f https://github.com/kubernetes/heapster/raw/master/deploy/kube-config/influxdb/heapster.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/influxdb.yaml

Also, unless you want to fiddle with authentication you need to grant dashboard admin privileges with something like this:

kubectl create clusterrolebinding insecure-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard

Eventually a port link will appear (30xxx) but you will need to change the url scheme to https from http - and convince your browser that you don't care about the insecure certificate.

You should have a working dashboard now. Piece of cake ;)

-- Janos Lenart
Source: StackOverflow