Open cbandy opened 7 years ago
@cbandy I am not sure if k8s will generate the correct srv format as etcdctl would expect. We never try to make it work.
Here's what the SRV records look like for the services above:
# dig +nocmd +nostats \
_client._tcp.etcd.default.svc.cluster.local srv \
_peer._tcp.etcd.default.svc.cluster.local srv \
_client._tcp.etcd-client.default.svc.cluster.local srv
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8163
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 3
;; QUESTION SECTION:
;_client._tcp.etcd.default.svc.cluster.local. IN SRV
;; ANSWER SECTION:
_client._tcp.etcd.default.svc.cluster.local. 30 IN SRV 10 33 2379 etcd-0002.etcd.default.svc.cluster.local.
_client._tcp.etcd.default.svc.cluster.local. 30 IN SRV 10 33 2379 etcd-0000.etcd.default.svc.cluster.local.
_client._tcp.etcd.default.svc.cluster.local. 30 IN SRV 10 33 2379 etcd-0001.etcd.default.svc.cluster.local.
;; ADDITIONAL SECTION:
etcd-0002.etcd.default.svc.cluster.local. 30 IN A 10.8.0.15
etcd-0000.etcd.default.svc.cluster.local. 30 IN A 10.8.1.9
etcd-0001.etcd.default.svc.cluster.local. 30 IN A 10.8.2.10
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1093
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 3
;; QUESTION SECTION:
;_peer._tcp.etcd.default.svc.cluster.local. IN SRV
;; ANSWER SECTION:
_peer._tcp.etcd.default.svc.cluster.local. 30 IN SRV 10 33 2380 etcd-0002.etcd.default.svc.cluster.local.
_peer._tcp.etcd.default.svc.cluster.local. 30 IN SRV 10 33 2380 etcd-0000.etcd.default.svc.cluster.local.
_peer._tcp.etcd.default.svc.cluster.local. 30 IN SRV 10 33 2380 etcd-0001.etcd.default.svc.cluster.local.
;; ADDITIONAL SECTION:
etcd-0002.etcd.default.svc.cluster.local. 30 IN A 10.8.0.15
etcd-0000.etcd.default.svc.cluster.local. 30 IN A 10.8.1.9
etcd-0001.etcd.default.svc.cluster.local. 30 IN A 10.8.2.10
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51017
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;_client._tcp.etcd-client.default.svc.cluster.local. IN SRV
;; ANSWER SECTION:
_client._tcp.etcd-client.default.svc.cluster.local. 30 IN SRV 10 100 2379 etcd-client.default.svc.cluster.local.
;; ADDITIONAL SECTION:
etcd-client.default.svc.cluster.local. 30 IN A 10.11.253.157
k8s format: _client._tcp.etcd.default.svc.cluster.local
is different from etcd-srv-discovery format: _etcd-server._tcp.example.com
one has subdomain _client
, one expects etcd-server
or etcd-client
.
k8s format ... is different from etcd-srv-discovery format
Precisely.
one has subdomain
_client
This subdomain comes from the Name
attribute of the port in the service resource:
Submit a PR? (my fault)
This is affecting me too. @cbandy will you submit a PR or would you prefer me to do it?
I'm not setup to test this, so I cannot submit anything for some time.
I understand. That being, I'll take upon it, if you don't mind.
On Qua, 13 de set de 2017, 13:49 Chris Bandy notifications@github.com wrote:
I'm not setup to test this, so I cannot submit anything for some time.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/coreos/etcd-operator/issues/1381#issuecomment-329156853, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQW-D6qnEC_IVRYFG4jcdQgBYPWEmgxks5sh88-gaJpZM4PQAGK .
Thanks @brunomcustodio!
@cbandy Can you tell us your use case first? Specifically, why do you want to SRV discovery instead of k8s service?
I'm using
quay.io/coreos/etcd-operator:v0.5.1
to create the following cluster:I see two services created with ports named
client
andpeer
:I can use the
etcd-client
service as the endpoint and see that the cluster is functional:However, I'm unable to use SRV discovery to connect to those services:
Is that intentional?
If I understand correctly, naming the ports
etcd-server
andetcd-client
will generate the correct SRV records.