Merge pull request #30090 from mtaufen/dynamic-kubelet-restart

Automatic merge from submit-queue

[Kubelet] Optionally consume configuration from <node-name> named config maps

This extends the Kubelet to check the API server for new node-specific config, and exit when it finds said new config.

/cc @kubernetes/sig-node @mikedanese @timstclair @vishh

**Release note**:
```
Extends Kubelet with Alpha Dynamic Kubelet Configuration. Please note that this alpha feature does not currently work with cloud provider auto-detection.
```
This commit is contained in:
Kubernetes Submit Queue
2016-08-23 09:25:22 -07:00
committed by GitHub
4 changed files with 495 additions and 25 deletions

View File

@@ -38,14 +38,16 @@ const (
// specification of gates. Examples:
// AllAlpha=false,NewFeature=true will result in newFeature=true
// AllAlpha=true,NewFeature=false will result in newFeature=false
allAlphaGate = "AllAlpha"
allAlphaGate = "AllAlpha"
dynamicKubeletConfig = "DynamicKubeletConfig"
)
var (
// Default values for recorded features. Every new feature gate should be
// represented here.
knownFeatures = map[string]featureSpec{
allAlphaGate: {false, alpha},
allAlphaGate: {false, alpha},
dynamicKubeletConfig: {false, alpha},
}
// Special handling for a few gates.
@@ -86,6 +88,7 @@ type FeatureGate interface {
// MyFeature() bool
// TODO: Define accessors for each non-API alpha feature.
DynamicKubeletConfig() bool
}
// featureGate implements FeatureGate as well as pflag.Value for flag parsing.
@@ -154,6 +157,11 @@ func (f *featureGate) Type() string {
return "mapStringBool"
}
// DynamicKubeletConfig returns value for dynamicKubeletConfig
func (f *featureGate) DynamicKubeletConfig() bool {
return f.lookup(dynamicKubeletConfig)
}
func (f *featureGate) lookup(key string) bool {
defaultValue := f.known[key].enabled
if f.enabled != nil {