Kompose doesn't bring up localhost for openzipkin and Elastic

6/18/2019

I am new to K8s and I am trying to migrate my service (which currently utilizes docker-compose.yml) to k8s. My service

deploys zipkin and elasticsearch

and these can be accessed at 'localhost:9411' and 'localhost:9200' respectively.

The most commonly used solution I found online was 'kompose' and I tried to run,

  1. kompose up

kompose convert

kubectl apply -f *****-deployment.yaml, ****-service.yaml

Once I finish this, I run kubectl get pods and I can see my deployments, but elasticsearch and zipkin are no more responsive on their respective localhost ports.

Ouput of 'kubectl get pods'

<code>kubectl get pods</code>  (ignore migration)

Output of 'docker ps'

<code>docker ps</code>  (ignore migration)

Output of curl http://localhost:9200

enter image description here

Can someone tell me why this is happening and how to debug?

-- Gauraang Khurana
docker-compose
kompose
kubernetes

2 Answers

6/18/2019

It is solved now; all I had to do was port forwarding.

kubectl port-forward zipkin-774cc77659-g929n 9411:9411

Thanks,

-- Gauraang Khurana
Source: StackOverflow

6/24/2019

By default you service is exposed as ClusterIP, in this case your service will be accessible from within your cluster.

You can use port forwarding "With this connection in place you can use your local workstation to debug your application that is running in the pod" as described in the answer above.

Another approach is to use other "service types" like NodePort.

You can find more information here Publishing services (ServiceTypes)

-- Hanx
Source: StackOverflow