mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Migrate FeatureGates type of kube-proxy from string to map[string]bool
This commit is contained in:
parent
317853c90c
commit
57071d85ee
@ -193,7 +193,7 @@ func (o *Options) Complete() error {
|
|||||||
} else {
|
} else {
|
||||||
o.config = c
|
o.config = c
|
||||||
// Make sure we apply the feature gate settings in the config file.
|
// Make sure we apply the feature gate settings in the config file.
|
||||||
utilfeature.DefaultFeatureGate.Set(o.config.FeatureGates)
|
utilfeature.DefaultFeatureGate.SetFromMap(o.config.FeatureGates)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/util/diff"
|
"k8s.io/apimachinery/pkg/util/diff"
|
||||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||||
api "k8s.io/kubernetes/pkg/apis/core"
|
api "k8s.io/kubernetes/pkg/apis/core"
|
||||||
|
"k8s.io/kubernetes/pkg/features"
|
||||||
"k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"
|
"k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"
|
||||||
"k8s.io/kubernetes/pkg/proxy/ipvs"
|
"k8s.io/kubernetes/pkg/proxy/ipvs"
|
||||||
"k8s.io/kubernetes/pkg/util/configz"
|
"k8s.io/kubernetes/pkg/util/configz"
|
||||||
@ -413,7 +414,8 @@ conntrack:
|
|||||||
min: 1
|
min: 1
|
||||||
tcpCloseWaitTimeout: 10s
|
tcpCloseWaitTimeout: 10s
|
||||||
tcpEstablishedTimeout: 20s
|
tcpEstablishedTimeout: 20s
|
||||||
featureGates: "all"
|
featureGates:
|
||||||
|
SupportIPVSProxyMode: true
|
||||||
healthzBindAddress: "%s"
|
healthzBindAddress: "%s"
|
||||||
hostnameOverride: "foo"
|
hostnameOverride: "foo"
|
||||||
iptables:
|
iptables:
|
||||||
@ -524,7 +526,7 @@ udpIdleTimeout: 123ms
|
|||||||
TCPCloseWaitTimeout: &metav1.Duration{Duration: 10 * time.Second},
|
TCPCloseWaitTimeout: &metav1.Duration{Duration: 10 * time.Second},
|
||||||
TCPEstablishedTimeout: &metav1.Duration{Duration: 20 * time.Second},
|
TCPEstablishedTimeout: &metav1.Duration{Duration: 20 * time.Second},
|
||||||
},
|
},
|
||||||
FeatureGates: "all",
|
FeatureGates: map[string]bool{string(features.SupportIPVSProxyMode): true},
|
||||||
HealthzBindAddress: tc.healthzBindAddress,
|
HealthzBindAddress: tc.healthzBindAddress,
|
||||||
HostnameOverride: "foo",
|
HostnameOverride: "foo",
|
||||||
IPTables: kubeproxyconfig.KubeProxyIPTablesConfiguration{
|
IPTables: kubeproxyconfig.KubeProxyIPTablesConfiguration{
|
||||||
|
@ -97,14 +97,8 @@ type KubeProxyConntrackConfiguration struct {
|
|||||||
type KubeProxyConfiguration struct {
|
type KubeProxyConfiguration struct {
|
||||||
metav1.TypeMeta
|
metav1.TypeMeta
|
||||||
|
|
||||||
// TODO FeatureGates really should be a map but that requires refactoring all
|
// featureGates is a map of feature names to bools that enable or disable alpha/experimental features.
|
||||||
// components to use config files because local-up-cluster.sh only supports
|
FeatureGates map[string]bool
|
||||||
// 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
|
|
||||||
|
|
||||||
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
|
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
|
||||||
// for all interfaces)
|
// for all interfaces)
|
||||||
|
@ -116,4 +116,7 @@ func SetDefaults_KubeProxyConfiguration(obj *KubeProxyConfiguration) {
|
|||||||
if obj.ClientConnection.Burst == 0 {
|
if obj.ClientConnection.Burst == 0 {
|
||||||
obj.ClientConnection.Burst = 10
|
obj.ClientConnection.Burst = 10
|
||||||
}
|
}
|
||||||
|
if obj.FeatureGates == nil {
|
||||||
|
obj.FeatureGates = make(map[string]bool)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,14 +93,8 @@ type KubeProxyConntrackConfiguration struct {
|
|||||||
type KubeProxyConfiguration struct {
|
type KubeProxyConfiguration struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
// TODO FeatureGates really should be a map but that requires refactoring all
|
// featureGates is a map of feature names to bools that enable or disable alpha/experimental features.
|
||||||
// components to use config files because local-up-cluster.sh only supports
|
FeatureGates map[string]bool `json:"featureGates,omitempty"`
|
||||||
// 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"`
|
|
||||||
|
|
||||||
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
|
// bindAddress is the IP address for the proxy server to serve on (set to 0.0.0.0
|
||||||
// for all interfaces)
|
// for all interfaces)
|
||||||
|
Loading…
Reference in New Issue
Block a user