Re:Kubernetes Networking: Behind the Scenes
by justinsaccount on Wednesday October 16, 2019 @12:42PM
(#21272401)
That is basically how consul connect works: https://www.consul.io/docs/connect/native/go.html
[ Parent
| on HN ]
Re:Kubernetes Networking: Behind the Scenes
by atombender on Wednesday October 16, 2019 @01:48PM
(#21273176)
Not as I understand it. It uses DNS resolution, so you connect to something like foo.web.service.consul. Kubernetes's KubeDNS works exactly the same way with Kubernetes service objects.
Re:Kubernetes Networking: Behind the Scenes
by justinsaccount on Wednesday October 16, 2019 @03:09PM
(#21274187)
From that page:
// Create an instance representing this service. "my-service" is the
// name of _this_ service. The service should be cleaned up via Close.
svc, _ := connect.NewService("my-service", client)
and when http is used:> The hostname used in the request URL is used to identify the logical service discovery mechanism for the target. It's not actually resolved via DNS but used as a logical identifier for a Consul service discovery mechanism. It has the following specific limitations:
Re:Kubernetes Networking: Behind the Scenes
by atombender on Wednesday October 16, 2019 @03:32PM
(#21274495)
Ah, I see. That's presumably possible because Go has its own DNS resolver, and it (net.DefaultResolver) can be overridden by libraries; no LD_PRELOAD needed.
Re:Kubernetes Networking: Behind the Scenes
by justinsaccount on Wednesday October 16, 2019 @04:06PM
(#21274887)
it's because connect.NewService is the consul client, not something like net.DialTCP
Re:Kubernetes Networking: Behind the Scenes
by atombender on Wednesday October 16, 2019 @04:25PM
(#21275128)
Oh, they require all TCP connections to go through that. That's a bit heavy-handed — requires rewriting all client code to adapt to that pattern. The nice thing about KubeDNS is that you don't have to. Same with Istio.
Re:Kubernetes Networking: Behind the Scenes
by justinsaccount on Wednesday October 16, 2019 @05:29PM
(#21275997)
I brought up the native client because you mentioned "they should have defined a new API".
Re:Kubernetes Networking: Behind the Scenes
by atombender on Wednesday October 16, 2019 @05:33PM
(#21276036)
That wasn't me. I'd argue the opposite. Though I'd also maybe argue that SRV records is what we should have standardized on for this stuff a long time ago.
Re:Kubernetes Networking: Behind the Scenes
by peterwwillis on Wednesday October 16, 2019 @05:29PM
(#21275989)
Integrating with app code is optional. The default is to use a sidecar.