Using kube-ui and Weave Scope with Google Container Engine
Recently, I’ve had a few people tell me they were struggling to access kube-ui when running a kubernetes cluster on Google Container Engine.
The official documentation tells us to visit
https://<kubernetes-master>/ui
However, using this means you have to memorize the master’s IP address, as well as the username and password. Plus, because it is using a self-signed SSL certificate, you get an ugly warning message when you visit the page. That doesn’t sound fun to me…
So here is a better way to do it:
Step 1: Auth
Get access to your cluster:
$ gcloud container clusters get-credentials <CLUSTER-NAME>
Now “log in” to the kubernetes master using the proxy command. This will run a webserver on port 8080.
$ kubectl proxy -p 8080
Step 2: Open the UI
http://localhost:8080/ui
Done.
Can we do better?
In my opinion, the standard kube-ui is pretty spartan. It doesn’t really give me a good overview of what is going on in my cluster.
Weave Scope is an open source tool that helps you monitor and visualize your cluster. It is currently very beta, but I think it has a lot of potential!
Running it is also super easy.
Step 1: Deploy
$ kubectl apply -f \
'https://scope.weave.works/launch/k8s/weavescope.yaml'
Step 2: Connect
$ kubectl port-forward \
$(kubectl get pod \
--selector=weave-scope-component=app -o \
jsonpath={.items..metadata.name}) 4040
Step 3: Open
http://localhost:4040/
You can use both Weave Scope and kube-ui at the same time! Happy kubeing!