Remove special support for ExternalName services#764
Conversation
After this was implemented we found that ExternalName services are represented in DNS as CNAMEs, which means that the proxy's DNS fallback logic can be used instead of doing DNS in the control plane. Besides simplifying the controller, this will also increase fidelity with the proxied pods' DNS configuration (improve transparency). Signed-off-by: Brian Smith <brian@briansmith.org>
|
@klingerf In Slack discussion @olix0r mentioned the idea of using an ExternalName service to alias another service within the cluster, to test this. In the test framework we have, where can I find an example of creating a service completely internal to the cluster? The egress_test.go tests all reference services that make requests outside the cluster to httpbin.org. |
|
@briansmith Checkout the smoke test config that we use to verify that inject is working: https://github.com/runconduit/conduit/blob/master/test/testdata/smoke_test.yaml |
Signed-off-by: Brian Smith <brian@briansmith.org>
6bc5e7a to
79a6d2a
Compare
Signed-off-by: Brian Smith <brian@briansmith.org>
| } | ||
| }) | ||
|
|
||
| //TODO: Resolve name using DNS similar to Kubernetes' ClusterFirst |
There was a problem hiding this comment.
Would you mind removing this TODO as well as part of this branch?
There was a problem hiding this comment.
Would you mind removing this TODO as well as part of this branch?
I am going to remove it, and other similar things, in a separate PR.
There was a problem hiding this comment.
You're removing the original comment from which this comment was copied (line 51, k8s_resolver.go) as part of this branch. I think it makes sense to also remove this comment simultaneously.
| log.Infof("Adding k8s name resolver") | ||
|
|
||
| return []streamingDestinationResolver{ipResolver, k8sResolver}, nil | ||
| return []streamingDestinationResolver{k8sResolver}, nil |
There was a problem hiding this comment.
Did you mean to remove the echoIpV4Resolver as part of this branch? That seems unrelated to removing external name support. I'm not sure what the proxy uses the ip resolver for, but functionally, if the path to be resolved is an ipv4 address, this resolver sends it back as an Add event. On master, it looks like this:
$ bin/go-run controller/script/destination-client -path 1.2.3.4:80
INFO[0000] Add:
INFO[0000] metric_labels: map[]
INFO[0000] - 1.2.3.4:80 - map[]
INFO[0000]
Whereas on this branch, I get:
$ bin/go-run controller/script/destination-client -path 1.2.3.4:80
FATA[0000] rpc error: code = Unknown desc = resolver [&{k8sDNSZoneLabels:[] endpointsWatcher:0xc4201b0420}] found error resolving host [1.2.3.4] port[80]: DNS name cannot only contain digits and hyphens: 1.2.3.4
There was a problem hiding this comment.
Did you mean to remove the echoIpV4Resolver as part of this branch?
I should have removed it in an earlier branch. The proxy never sends IP addresses to the controller any more. I think even in 0.3.1 it was that way.
There was a problem hiding this comment.
Ok, in that case can you also remove the echoIpV4Resolver struct and associated methods and tests? I think that controller/destination/resolver_test.go can go away entirely.
There was a problem hiding this comment.
Ok, in that case can you also remove the echoIpV4Resolver struct and associated methods and tests? I think that controller/destination/resolver_test.go can go away entirely.
Done.
Signed-off-by: Brian Smith <brian@briansmith.org>
Signed-off-by: Brian Smith <brian@briansmith.org>
klingerf
left a comment
There was a problem hiding this comment.
⭐️ Great, thanks for updating.
|
I believe there may be a correctness issue with this branch. I'll reproduce the issue and describe here. |
Configs are here |
olix0r
left a comment
There was a problem hiding this comment.
appears to cause some connectivity issues in a test i ran
|
Thanks @olix0r for providing detailed testing instructions. Sorry I didn't indicate when I submitted the PR that it wasn't yet working. The problem is that the abstract_ns/ns_dns_tokio/domain crates don't support CNAME entries. There are other limitations of those crates, e.g. they don't support /etc/hosts either. I have a PR that switches the DNS resolution in the proxy from the |
trust-dns-resolver is a more complete implementation. In particular, it supports CNAMES correctly, which is needed for PR #764. It also supports /etc/hosts, which will help with issue #62. Use the 0.8.2 pre-release since it hasn't been released yet. It was created at our request. Signed-off-by: Brian Smith <brian@briansmith.org>
trust-dns-resolver is a more complete implementation. In particular, it supports CNAMES correctly, which is needed for PR #764. It also supports /etc/hosts, which will help with issue #62. Use the 0.8.2 pre-release since it hasn't been released yet. It was created at our request. Signed-off-by: Brian Smith <brian@briansmith.org>
Signed-off-by: Brian Smith <brian@briansmith.org>
Signed-off-by: Brian Smith <brian@briansmith.org>
After this was implemented we found that ExternalName services are
represented in DNS as CNAMEs, which means that the proxy's DNS
fallback logic can be used instead of doing DNS in the control
plane. Besides simplifying the controller, this will also increase
fidelity with the proxied pods' DNS configuration (improve
transparency).
Signed-off-by: Brian Smith brian@briansmith.org