-
Notifications
You must be signed in to change notification settings - Fork 39k
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
Mark Kubelet --cloud-provider and --cloud-config deprecated #90408
Conversation
Hi @knabben. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/lgtm |
/assign @liggitt |
pkg/kubelet/apis/config/types.go
Outdated
@@ -100,6 +100,8 @@ type KubeletConfiguration struct { | |||
// volumePluginDir is the full path of the directory in which to search | |||
// for additional third party volume plugins. | |||
VolumePluginDir string | |||
// cloudProvider is the provider for cloud services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy the flag documentation here (meaning of empty string, etc), and maybe also call out the special "external" value?
@@ -304,6 +304,9 @@ type KubeletConfiguration struct { | |||
// Default: "4h" | |||
// +optional | |||
StreamingConnectionIdleTimeout metav1.Duration `json:"streamingConnectionIdleTimeout,omitempty"` | |||
// cloudProvider is the provider for cloud services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy the flag documentation here (meaning of empty string, etc), and maybe also call out the special "external" value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should include the same details as the flag help, e.g.:
"Specify empty string for running with no cloud provider. If set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used)."
cmd/kubelet/app/options/options.go
Outdated
@@ -368,7 +364,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) { | |||
fs.StringVar(&f.CertDirectory, "cert-dir", f.CertDirectory, "The directory where the TLS certs are located. "+ | |||
"If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored.") | |||
|
|||
fs.StringVar(&f.CloudProvider, "cloud-provider", f.CloudProvider, "The provider for cloud services. Specify empty string for running with no cloud provider. If set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used).") | |||
fs.StringVar(&f.CloudConfigFile, "cloud-config", f.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expected cloud-provider and cloud-config to move together to stay coherent
pkg/kubelet/apis/config/types.go
Outdated
@@ -100,6 +100,8 @@ type KubeletConfiguration struct { | |||
// volumePluginDir is the full path of the directory in which to search | |||
// for additional third party volume plugins. | |||
VolumePluginDir string | |||
// cloudProvider is the provider for cloud services. | |||
CloudProvider string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any validation needed in ValidateKubeletConfiguration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the validation is made on InitCloudProvider, not in the flag, should it be moved to the ValidateKubeletConfiguration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything that can be changed via the config file should be validated as much as possible in ValidateKubeletConfiguration... that is what protects us from picking up a bad config value in an dynamic config update. cc @mtaufen
edit: the validation should be limited to syntactic errors in the config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @cheftako
for opinion on what we should validate up-front and what should be left to the cloud-provider integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary opinion is that we should deprecate this. The goal is to get rid of it in a year (From Kubelet, Kube API Server and Kube Controller Manager).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I believe the format of the config file is dependent upon the cloud provider implementation. So we could see what it would take to call add and call a validate method from kubelet's validate. Given that its deprecated, that may be overkill.
35e484f
to
8f63e55
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: knabben, liggitt, mtaufen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
/retest |
1 similar comment
/retest |
As far as I can tell, |
The code executed under the --cloud-provider=external case should become the only option for Kubelet, KCM and KAS. There exist today valid configurations of these where cloud provider is set to something other than external. However we are hoping that soon that will no longer be true in a few more releases. Once external is the only valid configuration; any other configuration would be an error. We would like to be able to delete the flag once it can only have 1 legal value but to do that the flag has to have been deprecated for at least a year. |
Thanks for the clarification @cheftako. |
@cheftako the kubelet should be able to run in two modes, standalone or cloud-provider, how is kubelet supposed to decide which mode is going to use if we remove the flag? |
The description of this PR says it was deprecated in favor of the config file, but there's no config file field to specify an external cloud provider. |
There will not be only one legal value. As @aojea mentioned, there is standalone mode and external cloud provider mode. |
this will break a lot of installers, I suggest we remove the deprecation notice, seems the least resistance path |
Opened #121367 to drop the deprecation notice from
|
Our goal is to run without any cloud-provider code compiled into the Kubelet, KCM or KAS. The cloud-provider=external is meant to emulate that scenario. So I would hope that standalone is equivalent (or at least orthoganol) to cloud-provider=external. Once that is true we should be able to remove the flag and stop compiling cloud provider into these binaries. |
You'll still need a way to tell the kubelet something external is responsible for its addresses and initial readiness, everyone is already using |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Moving Kubelet flags to configuration file.
/area kubelet
/area kubelet-api
Which issue(s) this PR fixes:
Refs #86843
Special notes for your reviewer:
Does this PR introduce a user-facing change?: