-
Notifications
You must be signed in to change notification settings - Fork 40k
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
kubelet with --kubeconfig=... still requires --api-servers=... #30515
Comments
cc @mikedanese |
Ya I noticed this one time and it annoyed me. I think you mean --kubeconfig and not --config? |
The problem with fixing this is that |
I just noticed this in #29216 and I agree - clients of the API should use On Fri, Aug 12, 2016 at 1:47 PM, Mike Danese notifications@github.com
|
I guess one thing we could do is add a |
Certainly we need a new flag. It seem like adding |
Going to try to take a look at fixing this. Does it sound ok to do the following:
|
Or maybe you can explain how the proposal you just made is better than #30616? Thanks! |
My mistake, thought we needed a fix here. Looking now. |
Ok, to summarize:
To fix this, we need to introduce a new flag. I would generally prefer we crash-loop with a very succinct and clean message, because we use that across the project consistently, and it is predictable and consistent with other tools in the space. Here are some options:
Either way, we'd also want to have the error checking try to print a nice succinct error. I lean slightly towards the latter flag because if the vast majority of users want a specific behavior (error out if my config is wrong) then having to specify two flags means users will forget to specify the second flag, which means they will silently not get the behavior the expect. If we instead teach them to use the new flag, they always get the behavior they expect. |
I think I prefer |
Thanks @smarterclayton! So to be clear |
Yes I think so. |
Bumping to p1 because this blocks lifecycle having a path forward. |
Since I reviewed @erictune's original code here and I consider this my fault I'm opening a PR. |
@mtaufen this probably intersects with your changes - was that slated for merge today? |
Are you planning on doing this for all components? |
No, just for Kubelet. Controller manager and scheduler already exit if the kube config is invalid (can double check the others) |
Kubelet is the only one that must remain backwards compatible. |
Can we just action-required release note and kubernetes-announce, and actually fix this? Kubelet should handle kubeconfig like all others components, including a continuous command line flag API. The fact that this is not the case is a bug. I imagine that this behavior is little traveled and this is gross.
There is no invalid. Using the default loader you get a http://localhost:8080 kubeconfig |
I thought we fixed it so that the NonInteractive did not have that value? That's terrible if so. |
|
Very useful... |
Yes, I recall there was a bit of mixed behaviour, but couldn't remember what it was exactly. Adding a |
Here's the first draft:
|
If people would like a better message for the "hot-loop" case please let me know |
LGTM @smarterclayton |
@smarterclayton I have higher priorities today, so if #30798 merges first no worries. I'll rebase in the morning if necessary. Don't block on me. |
Automatic merge from submit-queue Allow a flag that forces kubelet to have a valid kubeconfig `--require-kubeconfig` forces the kubelet to use the kubeconfig for all APIserver communication, and exit cleanly. Allows cluster lifecycle to loop waiting for config to be available. Fixes #30515 A follow up PR will handle the issue discovered where the DefaultCluster rules applied to kubeconfig allow a malicious party who can bind to localhost:8080 to take advantage of an admin misconfiguration. @lukemarsden @mikedanese ```release-note The Kubelet now supports the `--force-kubeconfig` option which reads all client config from the provided `--kubeconfig` file and will cause the Kubelet to exit with error code 1 on error. It also forces the Kubelet to use the server URL from the kubeconfig file rather than the `--api-servers` flag. Without this flag set, a failure to read the kubeconfig file would only result in a warning message. In a future release, the value of this flag will be defaulted to `true`. ```
For the work we are doing at @kubernetes/sig-cluster-lifecycle (#30360), it'd make things much easier if we could make kubelet wait for the config file when it's not there and expect to find the API server URL in that file, rather then expect
--api-servers=...
like it does right now.The text was updated successfully, but these errors were encountered: