Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Etcd connectivity from outside kubernetes #996

Closed
mcameron opened this issue Apr 25, 2017 · 4 comments
Closed

Etcd connectivity from outside kubernetes #996

mcameron opened this issue Apr 25, 2017 · 4 comments

Comments

@mcameron
Copy link

I would like to be able to allow etcd clients running outside of kubernetes to access the service.

Version: v0.2.5

I don't believe this is currently possible since clients will be asked to resolve a dns entry provided by the servers which is not available outside of Kubernetes.

I first mentioned this issue here: #964.

etcdctl --endpoints $ETCDCTL_ENDPOINTS ls Error: client: etcd cluster is unavailable or misconfigured; error #0: dial tcp: lookup optest1-0002.optest1.optest1.svc.cluster.local on 192.168.1.9:53: no such host ; error #1: dial tcp: lookup optest1-0000.optest1.optest1.svc.cluster.local on 192.168.1.9:53: no such host ; error #2: dial tcp: lookup optest1-0001.optest1.optest1.svc.cluster.local on 192.168.1.9:53: no such host

error #0: dial tcp: lookup optest1-0002.optest1.optest1.svc.cluster.local on 192.168.1.9:53: no such host
error #1: dial tcp: lookup optest1-0000.optest1.optest1.svc.cluster.local on 192.168.1.9:53: no such host
error #2: dial tcp: lookup optest1-0001.optest1.optest1.svc.cluster.local on 192.168.1.9:53: no such host

@xiang90
Copy link
Collaborator

xiang90 commented Apr 25, 2017

I would like to be able to allow etcd clients running outside of kubernetes to access the service.

do you think creating an kubernetes service with external lb will solve your problem? you can configure it yourself. we could write up a doc about how to fill in the label selector in the service.

@mcameron
Copy link
Author

mcameron commented Apr 25, 2017

I've edited the ${clusterName}-client service to be "LoadBalancer" instead of "ClusterIP", and that allows curl to work with the service perfectly. However with etcdctl or confd, the servers provide a clientUrl, which the clients use to talk to the servers individually. Since this clientUrl is not resolvable, the client process dies, see details above. Ideally I would like to be able to provide a real domain to etcd-operator to use as the clientUrl on each server.

@xiang90
Copy link
Collaborator

xiang90 commented Apr 25, 2017

I've edited the ${clusterName}-client service to be "LoadBalancer" instead of "ClusterIP", and that allows curl to work with the service perfectly. However with etcdctl or confd, the servers provide a clientUrl, which the clients use to talk to the servers individually. Since this clientUrl is not resolvable, the client process dies, see details above.

You can configure etcdctl to not sync with the clusters to update its clientURLs. It should solve the problem. When you use any sort of LB, you should not sync with etcd's clientURLs.

Ideally I would like to be able to provide a real domain to etcd-operator to use as the clientUrl on each server.

Can you give me an example? maybe a step by step configuration you would like to see?

@mcameron
Copy link
Author

mcameron commented Apr 25, 2017

Cool, so the main reason I needed this was for confd, which as it happens looks like they have fixed this no-sync issue in 0.12.0: kelseyhightower/confd#329 (comment). Verified.

I'm sure a doc on creating an external service would be useful.

Many thanks.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants