-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine desired and correct "service" discovery mode behavior #5269
Comments
FWIW, I initially wrote this as a response to #3934 before determining it needed a new issue. The original writeup had some examples that are omitted above.
Though not shown, adding actual configuration, scaling/restarting, and non-default namespaces all worked fine. The
This address format looks unusual, however. While the Pod DNS spec does indicate that it includes the IP prefix, the Service DNS spec does not, and instead says that you should only see a single
The format with IP subdomains is of unclear origin. Is it something extra CoreDNS provides? This format is still in use, but I'm no longer sure where it should work. Although we mentioned CoreDNS, |
Review of the tunneling optionsGeneral notes
#5295 has a mostly working PoC. Something weird is broken with Postgres and it hacks away the problems above. InletsThe OSS options and their feature set isn't quite clear. It seems that the server and management app have MIT licensed options, but the client has only paid options? Also not clear if it offers a simple network device and route manipulation option for transparent L3 routing, which is what we want. Docs suggest it requires a TCP proxy with a listen on the client host, so you would have to connect to that instead of Pod IPs. kt-connectVery not product-ized and likely to remain that way given Alibaba Cloud's market. However, it is GPLv3. This shouldn't matter as it's being used to manipulate the environment and would not ever be imported into Go packages, but that may still create an extra wrinkle. Somewhat hampered by basically all issue discussion being in Chinese. TelepresenceSomewhat product-ized. The original feature set (what we need) was available via a standalone application, but Ambassador have recently made the readily available binaries require an account regardless of whether you'd need one to push paid features. No-account installsThe binaries from the GitHub releases page do not have this limitation, but are not distributed via package managers (namely Homebrew) or Actions (they're hardcoded to the nag version). The actions fortunately aren't necessary (simply downloading the binary and running
and I can't see what else I should install instead, if anything is available. I suppose we could detect OS and pull binaries from the release page somehow via the Makefile. KTF chicken egg problemsTelepresence cannot install its egress point without a running cluster. The integration test harness generally wants to create its own cluster from scratch and start running tests immediately. We can use kind-action or similar to set one up in advance (and subsequent addons, such as metallb, are generally fine with this), but it may miss some settings. A somewhat comedic option is to integrate Telepresence into KTF. There is, AFAIK, no reason we can't make an addon wrapper to function as a pseudo-CLI replacement, which would allow it to run as part of a KTF environment create and solve the distribution problem (no Go install? no problem!) in one go. Container magicIf we only care about KIND (ideally we don't rule out integration tests against other platforms), we don't strictly need tunnels, as Docker networks all exist on the same host and can be routed in kernel. This should be viable according to the KIND devs but only on Linux, since other platform Docker is not integrated into the host OS the same way:
|
Another KIND user mentioned https://sshuttle.readthedocs.io/en/stable/usage.html#usage as an option. It looks like it satisfies the client-side criteria (just exposes IP ranges). |
You won't be able to use As for the
Which is known to not work on GKE's kube-dns. Some more findings on this one: #4065 (comment) |
Have you considered mirrord? It's MIT license |
This tool as far as I remember when I used it last time is meant to wrap the running binary by starting As a side effect this approach will also make debugging practically impossible ( at least I'm not aware of a method of making it work this way ). BTW: I've just found an issue that I created a couple of months ago for integration tests using GD: #3631 |
The hostname scheme used for the
service
gateway discovery mode appears incorrect. The Service DNS specification uses a single hostname that points to the Service IP, or Pod IPs in headless mode. KIC 3.0 uses multiple hostnames, prepending a Pod IP subdomain to the Service hostname.While the Pod hostname spec does use IP subdomains, the Service spec does not.
The original goal of this feature was to support TLS, with the (mostly correct) expectation that users would not have certificates with Pod IP SANs available. We should clarify which hostnames we expect in practice and why. While we can reliably expect that the short Service name (without the
.cluster.local
or whatever cluster domain suffix) will resolve, users with certificate issuance systems will possibly use arbitrary hostnames.The currently working mode (
pod
) expects proxy instances to present a certificate matching the Pod hostname. Because each replica must mount the same certificate, it likely requires a wildcard SAN to match any IP subdomain. This is not ideal: Pod hostnames use a<IP>.<Namespace>.pod.cluster.local
format, so a valid certificate for any proxy Pod would also be valid for any other Pod in the same namespace.Presenting a certificate valid for the full Service hostname (no wildcard) is not overly broad, but does not really fit with the current discovery implementation. There are no Service-based hostnames that point to a specific endpoint only, so there's no way we can construct a list of hostnames that covers every replica. We would likely need to build the list of IPs to contact (as in the
ip
strategy), loop over those, and dynamically build a client with local DNS overrides for each, so that we can remap<service>.<namespace>.svc.cluster.local
hostnames to a each endpoint IP in order. This also satisfies the arbitrary hostname case.Rough acceptance:
service
discovery mode uses the hostname format from https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#a-aaaa-records when connecting to Pods.Dunno really how best to phrase those, but whatever.
The text was updated successfully, but these errors were encountered: