mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #90126 from smarterclayton/features_default
Promote service exclusion and legacy node role to beta
This commit is contained in:
commit
28c442ee2f
@ -70,11 +70,6 @@ const (
|
|||||||
// in 1.16 when the ServiceNodeExclusion gate is on.
|
// in 1.16 when the ServiceNodeExclusion gate is on.
|
||||||
labelNodeRoleExcludeBalancer = "node.kubernetes.io/exclude-from-external-load-balancers"
|
labelNodeRoleExcludeBalancer = "node.kubernetes.io/exclude-from-external-load-balancers"
|
||||||
|
|
||||||
// labelAlphaNodeRoleExcludeBalancer specifies that the node should be
|
|
||||||
// exclude from load balancers created by a cloud provider. This label is deprecated and will
|
|
||||||
// be removed in 1.18.
|
|
||||||
labelAlphaNodeRoleExcludeBalancer = "alpha.service-controller.kubernetes.io/exclude-balancer"
|
|
||||||
|
|
||||||
// serviceNodeExclusionFeature is the feature gate name that
|
// serviceNodeExclusionFeature is the feature gate name that
|
||||||
// enables nodes to exclude themselves from service load balancers
|
// enables nodes to exclude themselves from service load balancers
|
||||||
// originated from: https://github.com/kubernetes/kubernetes/blob/28e800245e/pkg/features/kube_features.go#L178
|
// originated from: https://github.com/kubernetes/kubernetes/blob/28e800245e/pkg/features/kube_features.go#L178
|
||||||
@ -618,10 +613,6 @@ func getNodeConditionPredicate() NodeConditionPredicate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(serviceNodeExclusionFeature) {
|
if utilfeature.DefaultFeatureGate.Enabled(serviceNodeExclusionFeature) {
|
||||||
// Will be removed in 1.18
|
|
||||||
if _, hasExcludeBalancerLabel := node.Labels[labelAlphaNodeRoleExcludeBalancer]; hasExcludeBalancerLabel {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if _, hasExcludeBalancerLabel := node.Labels[labelNodeRoleExcludeBalancer]; hasExcludeBalancerLabel {
|
if _, hasExcludeBalancerLabel := node.Labels[labelNodeRoleExcludeBalancer]; hasExcludeBalancerLabel {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -1404,13 +1404,11 @@ func Test_getNodeConditionPredicate(t *testing.T) {
|
|||||||
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{}}}},
|
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{}}}},
|
||||||
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
|
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
|
||||||
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
|
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
|
||||||
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelAlphaNodeRoleExcludeBalancer: ""}}}},
|
|
||||||
|
|
||||||
{want: true, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
|
{want: true, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
|
||||||
{want: true, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
|
{want: true, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
|
||||||
|
|
||||||
{want: false, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
|
{want: false, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
|
||||||
{want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelAlphaNodeRoleExcludeBalancer: ""}}}},
|
|
||||||
{want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
|
{want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
@ -146,18 +146,21 @@ const (
|
|||||||
|
|
||||||
// owner @smarterclayton
|
// owner @smarterclayton
|
||||||
// alpha: v1.16
|
// alpha: v1.16
|
||||||
|
// beta: v1.19
|
||||||
//
|
//
|
||||||
// Enable legacy behavior to vary cluster functionality on the node-role.kubernetes.io labels. On by default (legacy), will be turned off in 1.18.
|
// Enable legacy behavior to vary cluster functionality on the node-role.kubernetes.io labels. On by default (legacy), will be turned off in 1.18.
|
||||||
LegacyNodeRoleBehavior featuregate.Feature = "LegacyNodeRoleBehavior"
|
LegacyNodeRoleBehavior featuregate.Feature = "LegacyNodeRoleBehavior"
|
||||||
|
|
||||||
// owner @brendandburns
|
// owner @brendandburns
|
||||||
// alpha: v1.9
|
// alpha: v1.9
|
||||||
|
// beta: v1.19
|
||||||
//
|
//
|
||||||
// Enable nodes to exclude themselves from service load balancers
|
// Enable nodes to exclude themselves from service load balancers
|
||||||
ServiceNodeExclusion featuregate.Feature = "ServiceNodeExclusion"
|
ServiceNodeExclusion featuregate.Feature = "ServiceNodeExclusion"
|
||||||
|
|
||||||
// owner @smarterclayton
|
// owner @smarterclayton
|
||||||
// alpha: v1.16
|
// alpha: v1.16
|
||||||
|
// beta: v1.19
|
||||||
//
|
//
|
||||||
// Enable nodes to exclude themselves from network disruption checks
|
// Enable nodes to exclude themselves from network disruption checks
|
||||||
NodeDisruptionExclusion featuregate.Feature = "NodeDisruptionExclusion"
|
NodeDisruptionExclusion featuregate.Feature = "NodeDisruptionExclusion"
|
||||||
@ -598,8 +601,8 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
CPUManager: {Default: true, PreRelease: featuregate.Beta},
|
CPUManager: {Default: true, PreRelease: featuregate.Beta},
|
||||||
CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha},
|
CPUCFSQuotaPeriod: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
TopologyManager: {Default: true, PreRelease: featuregate.Beta},
|
TopologyManager: {Default: true, PreRelease: featuregate.Beta},
|
||||||
ServiceNodeExclusion: {Default: false, PreRelease: featuregate.Alpha},
|
ServiceNodeExclusion: {Default: true, PreRelease: featuregate.Beta},
|
||||||
NodeDisruptionExclusion: {Default: false, PreRelease: featuregate.Alpha},
|
NodeDisruptionExclusion: {Default: true, PreRelease: featuregate.Beta},
|
||||||
CSIDriverRegistry: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
|
CSIDriverRegistry: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
|
||||||
CSINodeInfo: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
|
CSINodeInfo: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
|
||||||
BlockVolume: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
|
BlockVolume: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
|
||||||
@ -675,5 +678,5 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
|
|||||||
// features that enable backwards compatibility but are scheduled to be removed
|
// features that enable backwards compatibility but are scheduled to be removed
|
||||||
// ...
|
// ...
|
||||||
HPAScaleToZero: {Default: false, PreRelease: featuregate.Alpha},
|
HPAScaleToZero: {Default: false, PreRelease: featuregate.Alpha},
|
||||||
LegacyNodeRoleBehavior: {Default: true, PreRelease: featuregate.Alpha},
|
LegacyNodeRoleBehavior: {Default: true, PreRelease: featuregate.Beta},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user