diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index e2722b44394..406ac6ea426 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -121,8 +121,12 @@ func NewKubeletFlags() *KubeletFlags { KubeConfig: flag.NewStringFlag("/var/lib/kubelet/kubeconfig"), ContainerRuntimeOptions: *NewContainerRuntimeOptions(), CertDirectory: "/var/run/kubernetes", - CloudProvider: v1alpha1.AutoDetectCloudProvider, RootDirectory: v1alpha1.DefaultRootDir, + // DEPRECATED: auto detecting cloud providers goes against the initiative + // for out-of-tree cloud providers as we'll now depend on cAdvisor integrations + // with cloud providers instead of in the core repo. + // More details here: https://github.com/kubernetes/kubernetes/issues/50986 + CloudProvider: v1alpha1.AutoDetectCloudProvider, } } @@ -220,7 +224,7 @@ func (f *KubeletFlags) AddFlags(fs *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. By default, kubelet will attempt to auto-detect the cloud provider. Specify empty string for running with no cloud provider.") + fs.StringVar(&f.CloudProvider, "cloud-provider", f.CloudProvider, "The provider for cloud services. By default, kubelet will attempt to auto-detect the cloud provider (deprecated). Specify empty string for running with no cloud provider, this will be the default in upcoming releases.") fs.StringVar(&f.CloudConfigFile, "cloud-config", f.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.") fs.StringVar(&f.RootDirectory, "root-dir", f.RootDirectory, "Directory path for managing kubelet files (volume mounts,etc).") diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index edd7f7a5bcd..ddd653bcb6a 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -283,6 +283,10 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) { } } + if s.CloudProvider == kubeletconfigv1alpha1.AutoDetectCloudProvider { + glog.Warning("--cloud-provider=auto-detect is deprecated. The desired cloud provider should be set explicitly") + } + if kubeDeps.Cloud == nil { if !cloudprovider.IsExternal(s.CloudProvider) && s.CloudProvider != kubeletconfigv1alpha1.AutoDetectCloudProvider { cloud, err := cloudprovider.InitCloudProvider(s.CloudProvider, s.CloudConfigFile) diff --git a/pkg/kubelet/apis/kubeletconfig/v1alpha1/defaults.go b/pkg/kubelet/apis/kubeletconfig/v1alpha1/defaults.go index 192da88f3b7..5d82438f94b 100644 --- a/pkg/kubelet/apis/kubeletconfig/v1alpha1/defaults.go +++ b/pkg/kubelet/apis/kubeletconfig/v1alpha1/defaults.go @@ -32,6 +32,10 @@ import ( const ( DefaultRootDir = "/var/lib/kubelet" + // DEPRECATED: auto detecting cloud providers goes against the initiative + // for out-of-tree cloud providers as we'll now depend on cAdvisor integrations + // with cloud providers instead of in the core repo. + // More details here: https://github.com/kubernetes/kubernetes/issues/50986 AutoDetectCloudProvider = "auto-detect" defaultIPTablesMasqueradeBit = 14 diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 65acbcad3eb..9edfabf400c 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -965,7 +965,11 @@ type Kubelet struct { volumeManager volumemanager.VolumeManager // Cloud provider interface. - cloud cloudprovider.Interface + cloud cloudprovider.Interface + // DEPRECATED: auto detecting cloud providers goes against the initiative + // for out-of-tree cloud providers as we'll now depend on cAdvisor integrations + // with cloud providers instead of in the core repo. + // More details here: https://github.com/kubernetes/kubernetes/issues/50986 autoDetectCloudProvider bool // Indicates that the node initialization happens in an external cloud controller externalCloudProvider bool