Migrate FeatureGates type of kube-proxy from string to map[string]bool

pull/6/head
xiangpengzhao 2018-01-08 19:27:46 +08:00
parent 317853c90c
commit 57071d85ee
5 changed files with 12 additions and 19 deletions

View File

@ -193,7 +193,7 @@ func (o *Options) Complete() error {
} else {
o.config = c
// Make sure we apply the feature gate settings in the config file.
utilfeature.DefaultFeatureGate.Set(o.config.FeatureGates)
utilfeature.DefaultFeatureGate.SetFromMap(o.config.FeatureGates)
}
}

View File

@ -30,6 +30,7 @@ import (
"k8s.io/apimachinery/pkg/util/diff"
utilfeature "k8s.io/apiserver/pkg/util/feature"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"
"k8s.io/kubernetes/pkg/proxy/ipvs"
"k8s.io/kubernetes/pkg/util/configz"
@ -413,7 +414,8 @@ conntrack:
min: 1
tcpCloseWaitTimeout: 10s
tcpEstablishedTimeout: 20s
featureGates: "all"
featureGates:
SupportIPVSProxyMode: true
healthzBindAddress: "%s"
hostnameOverride: "foo"
iptables:
@ -524,7 +526,7 @@ udpIdleTimeout: 123ms
TCPCloseWaitTimeout: &metav1.Duration{Duration: 10 * time.Second},
TCPEstablishedTimeout: &metav1.Duration{Duration: 20 * time.Second},
},
FeatureGates: "all",
FeatureGates: map[string]bool{string(features.SupportIPVSProxyMode): true},
HealthzBindAddress: tc.healthzBindAddress,
HostnameOverride: "foo",
IPTables: kubeproxyconfig.KubeProxyIPTablesConfiguration{

View File

@ -97,14 +97,8 @@ type KubeProxyConntrackConfiguration struct {
type KubeProxyConfiguration struct {
metav1.TypeMeta
// TODO FeatureGates really should be a map but that requires refactoring all
// components to use config files because local-up-cluster.sh only supports
// the --feature-gates flag right now, which is comma-separated key=value
// pairs.
//
// featureGates is a comma-separated list of key=value pairs that control
// which alpha/beta features are enabled.
FeatureGates string
// featureGates is a map of feature names to bools that enable or disable alpha/experimental features.
FeatureGates map[string]bool
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
// for all interfaces)

View File

@ -116,4 +116,7 @@ func SetDefaults_KubeProxyConfiguration(obj *KubeProxyConfiguration) {
if obj.ClientConnection.Burst == 0 {
obj.ClientConnection.Burst = 10
}
if obj.FeatureGates == nil {
obj.FeatureGates = make(map[string]bool)
}
}

View File

@ -93,14 +93,8 @@ type KubeProxyConntrackConfiguration struct {
type KubeProxyConfiguration struct {
metav1.TypeMeta `json:",inline"`
// TODO FeatureGates really should be a map but that requires refactoring all
// components to use config files because local-up-cluster.sh only supports
// the --feature-gates flag right now, which is comma-separated key=value
// pairs.
//
// featureGates is a comma-separated list of key=value pairs that control
// which alpha/beta features are enabled.
FeatureGates string `json:"featureGates"`
// featureGates is a map of feature names to bools that enable or disable alpha/experimental features.
FeatureGates map[string]bool `json:"featureGates,omitempty"`
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
// for all interfaces)