2019-01-12 04:58:27 +00:00
|
|
|
/*
|
|
|
|
Copyright 2017 The Kubernetes Authors.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package features
|
|
|
|
|
|
|
|
import (
|
2019-08-30 18:33:25 +00:00
|
|
|
"k8s.io/apimachinery/pkg/util/runtime"
|
|
|
|
|
2019-01-12 04:58:27 +00:00
|
|
|
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
2019-08-30 18:33:25 +00:00
|
|
|
"k8s.io/component-base/featuregate"
|
2019-01-12 04:58:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Every feature gate should add method here following this template:
|
|
|
|
//
|
|
|
|
// // owner: @username
|
|
|
|
// // alpha: v1.4
|
|
|
|
// MyFeature() bool
|
|
|
|
|
|
|
|
// owner: @tallclair
|
|
|
|
// alpha: v1.5
|
|
|
|
// beta: v1.6
|
2020-03-26 21:07:15 +00:00
|
|
|
// deprecated: v1.18
|
2019-01-12 04:58:27 +00:00
|
|
|
//
|
|
|
|
// StreamingProxyRedirects controls whether the apiserver should intercept (and follow)
|
|
|
|
// redirects from the backend (Kubelet) for streaming requests (exec/attach/port-forward).
|
2020-03-26 21:07:15 +00:00
|
|
|
//
|
|
|
|
// This feature is deprecated, and will be removed in v1.22.
|
2019-08-30 18:33:25 +00:00
|
|
|
StreamingProxyRedirects featuregate.Feature = "StreamingProxyRedirects"
|
2019-01-12 04:58:27 +00:00
|
|
|
|
2019-04-07 17:07:55 +00:00
|
|
|
// owner: @tallclair
|
2020-03-26 21:07:15 +00:00
|
|
|
// alpha: v1.12
|
2019-04-07 17:07:55 +00:00
|
|
|
// beta: v1.14
|
|
|
|
//
|
|
|
|
// ValidateProxyRedirects controls whether the apiserver should validate that redirects are only
|
|
|
|
// followed to the same host. Only used if StreamingProxyRedirects is enabled.
|
2019-08-30 18:33:25 +00:00
|
|
|
ValidateProxyRedirects featuregate.Feature = "ValidateProxyRedirects"
|
2019-04-07 17:07:55 +00:00
|
|
|
|
2019-01-12 04:58:27 +00:00
|
|
|
// owner: @tallclair
|
|
|
|
// alpha: v1.7
|
|
|
|
// beta: v1.8
|
|
|
|
// GA: v1.12
|
|
|
|
//
|
|
|
|
// AdvancedAuditing enables a much more general API auditing pipeline, which includes support for
|
|
|
|
// pluggable output backends and an audit policy specifying how different requests should be
|
|
|
|
// audited.
|
2019-08-30 18:33:25 +00:00
|
|
|
AdvancedAuditing featuregate.Feature = "AdvancedAuditing"
|
|
|
|
|
|
|
|
// owner: @ilackams
|
|
|
|
// alpha: v1.7
|
2020-12-01 01:06:26 +00:00
|
|
|
// beta: v1.16
|
2019-08-30 18:33:25 +00:00
|
|
|
//
|
|
|
|
// Enables compression of REST responses (GET and LIST only)
|
|
|
|
APIResponseCompression featuregate.Feature = "APIResponseCompression"
|
2019-01-12 04:58:27 +00:00
|
|
|
|
|
|
|
// owner: @smarterclayton
|
|
|
|
// alpha: v1.8
|
|
|
|
// beta: v1.9
|
|
|
|
//
|
|
|
|
// Allow API clients to retrieve resource lists in chunks rather than
|
|
|
|
// all at once.
|
2019-08-30 18:33:25 +00:00
|
|
|
APIListChunking featuregate.Feature = "APIListChunking"
|
2019-01-12 04:58:27 +00:00
|
|
|
|
|
|
|
// owner: @apelisse
|
|
|
|
// alpha: v1.12
|
|
|
|
// beta: v1.13
|
2020-08-10 17:43:49 +00:00
|
|
|
// stable: v1.18
|
2019-01-12 04:58:27 +00:00
|
|
|
//
|
|
|
|
// Allow requests to be processed but not stored, so that
|
|
|
|
// validation, merging, mutation can be tested without
|
|
|
|
// committing.
|
2019-08-30 18:33:25 +00:00
|
|
|
DryRun featuregate.Feature = "DryRun"
|
|
|
|
|
|
|
|
// owner: @caesarxuchao
|
|
|
|
// alpha: v1.15
|
2020-12-01 01:06:26 +00:00
|
|
|
// beta: v1.16
|
2019-08-30 18:33:25 +00:00
|
|
|
//
|
|
|
|
// Allow apiservers to show a count of remaining items in the response
|
|
|
|
// to a chunking list request.
|
|
|
|
RemainingItemCount featuregate.Feature = "RemainingItemCount"
|
|
|
|
|
|
|
|
// owner: @apelisse, @lavalamp
|
|
|
|
// alpha: v1.14
|
2019-09-27 21:51:53 +00:00
|
|
|
// beta: v1.16
|
2019-08-30 18:33:25 +00:00
|
|
|
//
|
|
|
|
// Server-side apply. Merging happens on the server.
|
|
|
|
ServerSideApply featuregate.Feature = "ServerSideApply"
|
|
|
|
|
|
|
|
// owner: @caesarxuchao
|
|
|
|
// alpha: v1.14
|
|
|
|
// beta: v1.15
|
|
|
|
//
|
|
|
|
// Allow apiservers to expose the storage version hash in the discovery
|
|
|
|
// document.
|
|
|
|
StorageVersionHash featuregate.Feature = "StorageVersionHash"
|
|
|
|
|
2020-12-01 01:06:26 +00:00
|
|
|
// owner: @caesarxuchao @roycaihw
|
|
|
|
// alpha: v1.20
|
|
|
|
//
|
|
|
|
// Enable the storage version API.
|
|
|
|
StorageVersionAPI featuregate.Feature = "StorageVersionAPI"
|
|
|
|
|
2019-08-30 18:33:25 +00:00
|
|
|
// owner: @wojtek-t
|
|
|
|
// alpha: v1.15
|
2019-09-27 21:51:53 +00:00
|
|
|
// beta: v1.16
|
2019-12-12 01:27:03 +00:00
|
|
|
// GA: v1.17
|
2019-08-30 18:33:25 +00:00
|
|
|
//
|
|
|
|
// Enables support for watch bookmark events.
|
|
|
|
WatchBookmark featuregate.Feature = "WatchBookmark"
|
|
|
|
|
|
|
|
// owner: @MikeSpreitzer @yue9944882
|
|
|
|
// alpha: v1.15
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Enables managing request concurrency with prioritization and fairness at each server
|
2019-12-12 01:27:03 +00:00
|
|
|
APIPriorityAndFairness featuregate.Feature = "APIPriorityAndFairness"
|
2019-09-27 21:51:53 +00:00
|
|
|
|
|
|
|
// owner: @wojtek-t
|
|
|
|
// alpha: v1.16
|
2020-12-01 01:06:26 +00:00
|
|
|
// beta: v1.20
|
2019-09-27 21:51:53 +00:00
|
|
|
//
|
|
|
|
// Deprecates and removes SelfLink from ObjectMeta and ListMeta.
|
|
|
|
RemoveSelfLink featuregate.Feature = "RemoveSelfLink"
|
2020-03-26 21:07:15 +00:00
|
|
|
|
2020-08-10 17:43:49 +00:00
|
|
|
// owner: @shaloulcy, @wojtek-t
|
2020-03-26 21:07:15 +00:00
|
|
|
// alpha: v1.18
|
2020-08-10 17:43:49 +00:00
|
|
|
// beta: v1.19
|
2020-12-01 01:06:26 +00:00
|
|
|
// GA: v1.20
|
2020-03-26 21:07:15 +00:00
|
|
|
//
|
|
|
|
// Allows label and field based indexes in apiserver watch cache to accelerate list operations.
|
|
|
|
SelectorIndex featuregate.Feature = "SelectorIndex"
|
2020-08-10 17:43:49 +00:00
|
|
|
|
|
|
|
// owner: @liggitt
|
|
|
|
// beta: v1.19
|
|
|
|
//
|
|
|
|
// Allows sending warning headers in API responses.
|
|
|
|
WarningHeaders featuregate.Feature = "WarningHeaders"
|
2020-12-01 01:06:26 +00:00
|
|
|
|
|
|
|
// owner: @wojtek-t
|
|
|
|
// alpha: v1.20
|
2021-03-18 22:40:29 +00:00
|
|
|
// beta: v1.21
|
2020-12-01 01:06:26 +00:00
|
|
|
//
|
|
|
|
// Allows for updating watchcache resource version with progress notify events.
|
|
|
|
EfficientWatchResumption featuregate.Feature = "EfficientWatchResumption"
|
|
|
|
|
|
|
|
// owner: @roycaihw
|
|
|
|
// alpha: v1.20
|
|
|
|
//
|
|
|
|
// Assigns each kube-apiserver an ID in a cluster.
|
|
|
|
APIServerIdentity featuregate.Feature = "APIServerIdentity"
|
2019-01-12 04:58:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2019-08-30 18:33:25 +00:00
|
|
|
runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates))
|
2019-01-12 04:58:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.
|
|
|
|
// To add a new feature, define a key for it above and add it here. The features will be
|
|
|
|
// available throughout Kubernetes binaries.
|
2019-08-30 18:33:25 +00:00
|
|
|
var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
|
2020-12-01 01:06:26 +00:00
|
|
|
StreamingProxyRedirects: {Default: true, PreRelease: featuregate.Deprecated},
|
|
|
|
ValidateProxyRedirects: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
AdvancedAuditing: {Default: true, PreRelease: featuregate.GA},
|
|
|
|
APIResponseCompression: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
APIListChunking: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
DryRun: {Default: true, PreRelease: featuregate.GA},
|
|
|
|
RemainingItemCount: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
ServerSideApply: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
StorageVersionHash: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
StorageVersionAPI: {Default: false, PreRelease: featuregate.Alpha},
|
|
|
|
WatchBookmark: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
|
|
|
|
APIPriorityAndFairness: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
RemoveSelfLink: {Default: true, PreRelease: featuregate.Beta},
|
|
|
|
SelectorIndex: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
|
|
|
|
WarningHeaders: {Default: true, PreRelease: featuregate.Beta},
|
2021-03-18 22:40:29 +00:00
|
|
|
EfficientWatchResumption: {Default: true, PreRelease: featuregate.Beta},
|
2020-12-01 01:06:26 +00:00
|
|
|
APIServerIdentity: {Default: false, PreRelease: featuregate.Alpha},
|
2019-01-12 04:58:27 +00:00
|
|
|
}
|