mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Add feature gate for kubelet plugin watcher
This commit is contained in:
parent
0ea07c4030
commit
f2eeb087e9
@ -304,6 +304,13 @@ const (
|
|||||||
// Allow subpath environment variable substitution
|
// Allow subpath environment variable substitution
|
||||||
// Only applicable if the VolumeSubpath feature is also enabled
|
// Only applicable if the VolumeSubpath feature is also enabled
|
||||||
VolumeSubpathEnvExpansion utilfeature.Feature = "VolumeSubpathEnvExpansion"
|
VolumeSubpathEnvExpansion utilfeature.Feature = "VolumeSubpathEnvExpansion"
|
||||||
|
|
||||||
|
// owner: @vikaschoudhary16
|
||||||
|
// alpha: v1.11
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Enable probe based plugin watcher utility for discovering Kubelet plugins
|
||||||
|
KubeletPluginsWatcher utilfeature.Feature = "KubeletPluginsWatcher"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -356,6 +363,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
|
|||||||
BalanceAttachedNodeVolumes: {Default: false, PreRelease: utilfeature.Alpha},
|
BalanceAttachedNodeVolumes: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
DynamicProvisioningScheduling: {Default: false, PreRelease: utilfeature.Alpha},
|
DynamicProvisioningScheduling: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
VolumeSubpathEnvExpansion: {Default: false, PreRelease: utilfeature.Alpha},
|
VolumeSubpathEnvExpansion: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
|
KubeletPluginsWatcher: {Default: false, PreRelease: utilfeature.Alpha},
|
||||||
|
|
||||||
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
|
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
|
||||||
// unintentionally on either side:
|
// unintentionally on either side:
|
||||||
|
@ -540,6 +540,7 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
experimentalHostUserNamespaceDefaulting: utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalHostUserNamespaceDefaultingGate),
|
experimentalHostUserNamespaceDefaulting: utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalHostUserNamespaceDefaultingGate),
|
||||||
keepTerminatedPodVolumes: keepTerminatedPodVolumes,
|
keepTerminatedPodVolumes: keepTerminatedPodVolumes,
|
||||||
nodeStatusMaxImages: nodeStatusMaxImages,
|
nodeStatusMaxImages: nodeStatusMaxImages,
|
||||||
|
enablePluginsWatcher: utilfeature.DefaultFeatureGate.Enabled(features.KubeletPluginsWatcher),
|
||||||
}
|
}
|
||||||
|
|
||||||
if klet.cloud != nil {
|
if klet.cloud != nil {
|
||||||
@ -1172,6 +1173,9 @@ type Kubelet struct {
|
|||||||
|
|
||||||
// This flag sets a maximum number of images to report in the node status.
|
// This flag sets a maximum number of images to report in the node status.
|
||||||
nodeStatusMaxImages int32
|
nodeStatusMaxImages int32
|
||||||
|
|
||||||
|
// This flag indicates that kubelet should start plugin watcher utility server for discovering Kubelet plugins
|
||||||
|
enablePluginsWatcher bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func allGlobalUnicastIPs() ([]net.IP, error) {
|
func allGlobalUnicastIPs() ([]net.IP, error) {
|
||||||
@ -1285,10 +1289,11 @@ func (kl *Kubelet) initializeModules() error {
|
|||||||
glog.Errorf("Failed to create directory %q: %v", ContainerLogsDir, err)
|
glog.Errorf("Failed to create directory %q: %v", ContainerLogsDir, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if kl.enablePluginsWatcher {
|
||||||
// Start the plugin watcher
|
// Start the plugin watcher
|
||||||
if err := kl.pluginWatcher.Start(); err != nil {
|
if err := kl.pluginWatcher.Start(); err != nil {
|
||||||
return fmt.Errorf("failed to start Plugin Watcher. err: %v", err)
|
return fmt.Errorf("failed to start Plugin Watcher. err: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the image manager.
|
// Start the image manager.
|
||||||
|
Loading…
Reference in New Issue
Block a user