[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Pod unable to connect with service IP



Thanks for the reply.

Here is my setup
# oc get svc
NAME                CLUSTER-IP      EXTERNAL-IP                     PORT(S)    AGE
couchbase-cluster   172.30.138.16   172.46.243.177,172.46.243.177   8091/TCP   4m

# oc get pods
NAME                         READY     STATUS    RESTARTS   AGE
couchbase-cluster-rc-6ulm8   1/1       Running   0          5m
couchbase-index-rc-wj46z     1/1       Running   0          3m

couchbase-cluster-rc-6ulm8 is the first pod (172.17.0.20) and is defined as part of service couchbase-cluster. couchbase-index-rc-wj46z is the second pod (172.17.0.19) and not part of the service. To add the second pod the couchbase-cluster, I am trying to access Service IP of couchbase-cluster from second pod.

# oc get endpoints
NAME                ENDPOINTS          AGE
couchbase-cluster   172.17.0.19:8091   6m

The big picture of this setup is explained here http://blog.kubernetes.io/2016/08/create-couchbase-cluster-using-kubernetes.html Though blog uses raw Kubernetes, I am trying it in an openshift setup.

Any help is appreciated.

Thanks
Vignesh




On Mon, Mar 6, 2017 at 9:15 AM, Clayton Coleman <ccoleman redhat com> wrote:
Has the pod showed up in the service endpoints list?

  oc get endpoints

Should return at least one ip+port combo.

The other steps look correct (the dns name is likely resolving correctly, you don't have to use the env var for the ip)

On Mar 6, 2017, at 6:07 AM, Vignesh M.P.N. <vigneshb4u gmail com> wrote:

Thanks for the response. That explains why the service IP was not pingable.

I would like to step up and ask the original problem I am facing here. I am trying to setup a couchbase cluster on openshift, I have deployed a pod, service (name: couchbase-master-service) and route in openshift environment following the example provided here https://github.com/arun-gupta/couchbase-kubernetes/tree/master/cluster

I create another pod, which is not part of the service and in the Dockerfile of the pod, I have a command that refers to the service using Service Name. To be specific, I am trying to add the second pod to the couchbase cluster instance of the first pod. I won't be aware of the first Pod IP address or the Service IP address. Hence referring by the service name, hoping to resolve it to the right IP address. The command goes like this

couchbase-cli server-add --cluster=couchbase-master-service:8091

Here is the script being invoked by Dockerfile (https://github.com/arun-gupta/couchbase-kubernetes/blob/master/cluster/configure-node.sh)

But during the pod creation I get this error:
Unable to connect to host at http://couchbase-master-service:8091

Initially I thought the Service Name "couchbase-master-service" was not resolving correctly to the service IP by openshift's built-in DNS cluster add-on. So I tried to troubleshoot using ping. But I did notice the pod was able to resolve the Service IP address but it was unable to reach the host. As you explained, that was not the right way to troubleshoot this issue.

Is there any alternative approach on how I could refer to an existing service without using it Service IP?

Thanks
Vignesh

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]