Web UI for openzipkin run from Docker image shows config.json error

10/17/2016

I'm trying to get an openzipkin server running in a k8s cluster, starting with testing in a minikube. I'm beginner with k8s config, but here's what I've done so far:

$ minikube start
$ eval $(minikube docker-env)
$ kubectl run zipkin --image=openzipkin/zipkin --port=9411
$ kubectl expose deployment zipkin --port=9411 --type="NodePort" --name=zipkin-http

What I think I'm doing is starting a new pod and deploying the zipkin image, then exposing the Web UI at port 9411 via zipkin-http. After doing this:

$ kubectl run -i --tty busybox --image=busybox -- sh
$ nslookup zipkin-http
Server:    10.0.0.10
Address 1: 10.0.0.10

Name:      zipkin-http
Address 1: 10.0.0.101
$ wget -qO- zipkin-http:9411
<!DOCTYPE html>
...
$ wget -qO- zipkin-http:9411/config.json
{"environment":"","queryLimit":10,"defaultLookback":3600000,"instrumented":".*"}

Then I run the kubectl proxy so I can access the Web UI from my browser:

$ kubectl proxy --accept-hosts=".*"

Now if I browse to http://localhost:8001/api/v1/proxy/namespaces/default/services/zipkin-http/config.json I get the config file contents:

{"environment":"","queryLimit":10,"defaultLookback":3600000,"instrumented":".*"}

But if I browse to the root at http://localhost:8001/api/v1/proxy/namespaces/default/services/zipkin-http/ I receive an error:

Error loading config.json: undefined

The config.json it's attempting to load is the one at :9411/config.json. The request to load /config.json comes from a JS file that was loaded by the html in the root page.

Since it looks like I can get to the json file directly from both inside and outside the cluster, I'm confused as to why the JS file isn't able to load it. What am I doing wrong here?

Thanks!

-- Steve
kubernetes

1 Answer

10/18/2016

The web app is trying to access config.json at root (accessing as /config.json vs just config.json ) - that is http://localhost:8001/config.json . This would obviously be wrong as it should be http://localhost:8001/api/v1/proxy/namespaces/default/services/zipkin-http/config.json

There is a very simple solution for this - just run:

kubectl port-forward <name of the pod> 9411

Now just go to http://localhost:9411 and the UI should be up (tried and verified.)

You can get the name of the pod by doing kubectl get pods

PS: kubectl proxy is generally meant to access the Kubernetes API, and kube port-forward is the right tool in this case.

-- manojlds
Source: StackOverflow