Skip to content
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

use cluster dns to reach apiserver for rustls - for #587 #597

Merged
merged 2 commits into from Jul 26, 2021

Conversation

clux
Copy link
Member

@clux clux commented Jul 21, 2021

untested based on suggestion in #587 to fix #153

@nightkr
Copy link
Member

nightkr commented Jul 21, 2021

FWIW, you still need to use the environment variable when implementing a custom DNS server...

@clux
Copy link
Member Author

clux commented Jul 21, 2021

Do we? I thought that was the whole point to rely on DNS, rather than use the evars. Bumped PR.

@clux
Copy link
Member Author

clux commented Jul 21, 2021

This passed integration tests on k3d now.

kube/src/config/mod.rs Outdated Show resolved Hide resolved
@clux clux marked this pull request as ready for review July 24, 2021 12:16
@nightkr
Copy link
Member

nightkr commented Jul 24, 2021

Do we? I thought that was the whole point to rely on DNS, rather than use the evars. Bumped PR.

Yeah, but the DNS server itself needs to have some way to reach the apiserver as well (chicken-and-egg problem :p). Not contesting that this is the correct solution for 99% of applications though.

@clux
Copy link
Member Author

clux commented Jul 24, 2021

Ohh, when implementing a DNS server yeah. I get you. Yeah, I guess we need to expose a (probably non-default) way to decide what method to use when using incluster config.

@MikailBag
Copy link
Contributor

I think kube-rs should just expose a way to completely override apiserver address (after all, it is perfectly valid for a Kubernetes pod to access apiserver from another cluster). And then user can read environment variables, some configs, etc.

@clux
Copy link
Member Author

clux commented Jul 24, 2021

I think kube-rs should just expose a way to completely override apiserver address (after all, it is perfectly valid for a Kubernetes pod to access apiserver from another cluster). And then user can read environment variables, some configs, etc.

This is actually supported out of the box already:

let mut cfg = Config::from_cluster_env(); // or Config::infer
cfg.cluster_url = some_uri;

@clux clux changed the title try using cluster dns to reach apiserver - for #587 use cluster dns to reach apiserver for rustls - for #587 Jul 24, 2021
@clux
Copy link
Member Author

clux commented Jul 26, 2021

Going to merge this, tested this locally with controller-rs against a cluster running rustls for sanity so going to speculatively close the related issues. If it turns out to be positive, then we can discuss whether to swap out the default for non-rustls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants