mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
Add DisableCloudProviders FG
FeatureGate acts as a secondary switch to disable cloud-controller loops in KCM, Kubelet and KAPI. Provide comprehensive logging information to users, so they will be guided in adoption of out-of-tree cloud provider implementation.
This commit is contained in:
@@ -19,7 +19,9 @@ package app
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
|
||||
"k8s.io/client-go/informers"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
@@ -32,6 +34,14 @@ func createCloudProvider(cloudProvider string, externalCloudVolumePlugin string,
|
||||
var cloud cloudprovider.Interface
|
||||
var loopMode ControllerLoopMode
|
||||
var err error
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.DisableCloudProviders) && cloudprovider.IsDeprecatedInternal(cloudProvider) {
|
||||
cloudprovider.DisableWarningForProvider(cloudProvider)
|
||||
return nil, ExternalLoops, fmt.Errorf(
|
||||
"cloud provider %q was specified, but built-in cloud providers are disabled. Please set --cloud-provider=external and migrate to an external cloud provider",
|
||||
cloudProvider)
|
||||
}
|
||||
|
||||
if cloudprovider.IsExternal(cloudProvider) {
|
||||
loopMode = ExternalLoops
|
||||
if externalCloudVolumePlugin == "" {
|
||||
|
Reference in New Issue
Block a user