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

Mark Kubelet --cloud-provider and --cloud-config deprecated #90408

Merged
merged 1 commit into from
Jun 4, 2020

Conversation

knabben
Copy link
Member

@knabben knabben commented Apr 23, 2020

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?:

The Kubelet's `--cloud-provider` and `--cloud-config` options are now marked as deprecated.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. area/kubelet size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/kubelet-api cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 23, 2020
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 23, 2020
@fejta-bot
Copy link

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.

@stealthybox
Copy link
Member

/lgtm
This seems like a good addition to the existing KubeletConfiguration UX

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 23, 2020
@knabben
Copy link
Member Author

knabben commented Apr 23, 2020

/assign @liggitt

@@ -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.
Copy link
Member

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.
Copy link
Member

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?

Copy link
Contributor

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)."

@@ -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.")
Copy link
Member

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

@@ -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
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

@liggitt liggitt Apr 28, 2020

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

Copy link
Contributor

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

Copy link
Member

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).

Copy link
Member

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.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 28, 2020
@cheftako
Copy link
Member

cheftako commented Jun 3, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2020
@liggitt
Copy link
Member

liggitt commented Jun 3, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2020
@knabben
Copy link
Member Author

knabben commented Jun 4, 2020

/test all

@knabben
Copy link
Member Author

knabben commented Jun 4, 2020

/retest

1 similar comment
@knabben
Copy link
Member Author

knabben commented Jun 4, 2020

/retest

@k8s-ci-robot k8s-ci-robot merged commit ef1bc41 into kubernetes:master Jun 4, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 4, 2020
@rtheis
Copy link

rtheis commented Aug 4, 2020

As far as I can tell, --cloud-provider=external is still needed for a proper CCM deployment. Should this flag really be deprecated since it is still needed so nodes can be tainted for an external cloud provider?

@cheftako
Copy link
Member

cheftako commented Aug 6, 2020

As far as I can tell, --cloud-provider=external is still needed for a proper CCM deployment. Should this flag really be deprecated since it is still needed so nodes can be tainted for an external cloud provider?

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.

@rtheis
Copy link

rtheis commented Aug 6, 2020

Thanks for the clarification @cheftako.

@aojea
Copy link
Member

aojea commented Oct 19, 2023

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.

@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?

@liggitt
Copy link
Member

liggitt commented Oct 19, 2023

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.

@liggitt
Copy link
Member

liggitt commented Oct 19, 2023

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.

There will not be only one legal value. As @aojea mentioned, there is standalone mode and external cloud provider mode.

@aojea
Copy link
Member

aojea commented Oct 19, 2023

this will break a lot of installers, I suggest we remove the deprecation notice, seems the least resistance path

@liggitt
Copy link
Member

liggitt commented Oct 19, 2023

Opened #121367 to drop the deprecation notice from --cloud-provider

--cloud-config can stay deprecated since that is not used with external cloud providers

@cheftako
Copy link
Member

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.

Walter Fender 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?

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.

@liggitt
Copy link
Member

liggitt commented Oct 19, 2023

So I would hope that standalone is equivalent (or at least orthoganol) to cloud-provider=external.

--cloud-provider=external turns off node reconciliation of its own addresses and adds a taint on self-registration that the cloud provider has to remove before the kubelet is considered ready. I think that's about it. It's primarily about turning off things that make sense for the kubelet to self-report or self-reconcile when it is not running in a cloud environment.

Once that is true we should be able to remove the flag

You'll still need a way to tell the kubelet something external is responsible for its addresses and initial readiness, everyone is already using --cloud-provider=external for that, I don't see a reason to switch to another flag that has the same meaning / semantics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cloudprovider area/kubelet area/kubelet-api cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants