apiserver: set APF featuregate to ga
Kubernetes-commit: c7fcef187562e1b3ffdaa2e2109c65d800b8f5d5
This commit is contained in:
parent
c6b93e573e
commit
b3499eec62
|
@ -63,6 +63,7 @@ const (
|
||||||
// owner: @MikeSpreitzer @yue9944882
|
// owner: @MikeSpreitzer @yue9944882
|
||||||
// alpha: v1.18
|
// alpha: v1.18
|
||||||
// beta: v1.20
|
// beta: v1.20
|
||||||
|
// stable: 1.29
|
||||||
//
|
//
|
||||||
// Enables managing request concurrency with prioritization and fairness at each server.
|
// Enables managing request concurrency with prioritization and fairness at each server.
|
||||||
// The FeatureGate was introduced in release 1.15 but the feature
|
// The FeatureGate was introduced in release 1.15 but the feature
|
||||||
|
@ -276,7 +277,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
||||||
|
|
||||||
APIListChunking: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
|
APIListChunking: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.32
|
||||||
|
|
||||||
APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta},
|
APIPriorityAndFairness: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.31
|
||||||
|
|
||||||
APIResponseCompression: {Default: true, PreRelease: featuregate.Beta},
|
APIResponseCompression: {Default: true, PreRelease: featuregate.Beta},
|
||||||
|
|
||||||
|
|
|
@ -1084,7 +1084,7 @@ func installAPI(s *GenericAPIServer, c *Config) {
|
||||||
s.Handler.GoRestfulContainer.Add(s.DiscoveryGroupManager.WebService())
|
s.Handler.GoRestfulContainer.Add(s.DiscoveryGroupManager.WebService())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c.FlowControl != nil && utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIPriorityAndFairness) {
|
if c.FlowControl != nil {
|
||||||
c.FlowControl.Install(s.Handler.NonGoRestfulMux)
|
c.FlowControl.Install(s.Handler.NonGoRestfulMux)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,7 @@ import (
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||||
"k8s.io/apiserver/pkg/features"
|
|
||||||
"k8s.io/apiserver/pkg/server"
|
"k8s.io/apiserver/pkg/server"
|
||||||
"k8s.io/apiserver/pkg/util/feature"
|
|
||||||
utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol"
|
utilflowcontrol "k8s.io/apiserver/pkg/util/flowcontrol"
|
||||||
"k8s.io/client-go/informers"
|
"k8s.io/client-go/informers"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
|
@ -60,7 +58,7 @@ func (o *FeatureOptions) AddFlags(fs *pflag.FlagSet) {
|
||||||
fs.StringVar(&o.DebugSocketPath, "debug-socket-path", o.DebugSocketPath,
|
fs.StringVar(&o.DebugSocketPath, "debug-socket-path", o.DebugSocketPath,
|
||||||
"Use an unprotected (no authn/authz) unix-domain socket for profiling with the given path")
|
"Use an unprotected (no authn/authz) unix-domain socket for profiling with the given path")
|
||||||
fs.BoolVar(&o.EnablePriorityAndFairness, "enable-priority-and-fairness", o.EnablePriorityAndFairness, ""+
|
fs.BoolVar(&o.EnablePriorityAndFairness, "enable-priority-and-fairness", o.EnablePriorityAndFairness, ""+
|
||||||
"If true and the APIPriorityAndFairness feature gate is enabled, replace the max-in-flight handler with an enhanced one that queues and dispatches with priority and fairness")
|
"If true, replace the max-in-flight handler with an enhanced one that queues and dispatches with priority and fairness")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *FeatureOptions) ApplyTo(c *server.Config, clientset kubernetes.Interface, informers informers.SharedInformerFactory) error {
|
func (o *FeatureOptions) ApplyTo(c *server.Config, clientset kubernetes.Interface, informers informers.SharedInformerFactory) error {
|
||||||
|
@ -72,7 +70,7 @@ func (o *FeatureOptions) ApplyTo(c *server.Config, clientset kubernetes.Interfac
|
||||||
c.DebugSocketPath = o.DebugSocketPath
|
c.DebugSocketPath = o.DebugSocketPath
|
||||||
c.EnableContentionProfiling = o.EnableContentionProfiling
|
c.EnableContentionProfiling = o.EnableContentionProfiling
|
||||||
|
|
||||||
if o.EnablePriorityAndFairness && feature.DefaultFeatureGate.Enabled(features.APIPriorityAndFairness) {
|
if o.EnablePriorityAndFairness {
|
||||||
if c.MaxRequestsInFlight+c.MaxMutatingRequestsInFlight <= 0 {
|
if c.MaxRequestsInFlight+c.MaxMutatingRequestsInFlight <= 0 {
|
||||||
return fmt.Errorf("invalid configuration: MaxRequestsInFlight=%d and MaxMutatingRequestsInFlight=%d; they must add up to something positive", c.MaxRequestsInFlight, c.MaxMutatingRequestsInFlight)
|
return fmt.Errorf("invalid configuration: MaxRequestsInFlight=%d and MaxMutatingRequestsInFlight=%d; they must add up to something positive", c.MaxRequestsInFlight, c.MaxMutatingRequestsInFlight)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue