Merge pull request #101496 from ahg-g/ahg-nss-beta

Graduate pod affinity NamespaceSelector to Beta
This commit is contained in:
Kubernetes Prow Robot 2021-05-14 08:48:04 -07:00 committed by GitHub
commit 49a60be8ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 9 deletions

View File

@ -7471,7 +7471,7 @@
}, },
"namespaceSelector": { "namespaceSelector": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector", "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector",
"description": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled." "description": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled."
}, },
"namespaces": { "namespaces": {
"description": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"", "description": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"",

View File

@ -2580,7 +2580,7 @@ type PodAffinityTerm struct {
// and the ones listed in the namespaces field. // and the ones listed in the namespaces field.
// null selector and null or empty namespaces list means "this pod's namespace". // null selector and null or empty namespaces list means "this pod's namespace".
// An empty selector ({}) matches all namespaces. // An empty selector ({}) matches all namespaces.
// This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled. // This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.
// +optional // +optional
NamespaceSelector *metav1.LabelSelector NamespaceSelector *metav1.LabelSelector
} }
@ -4887,7 +4887,7 @@ const (
// Match all pod objects that have priority class mentioned // Match all pod objects that have priority class mentioned
ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass"
// Match all pod objects that have cross-namespace pod (anti)affinity mentioned // Match all pod objects that have cross-namespace pod (anti)affinity mentioned
// This is an alpha feature enabled by the PodAffinityNamespaceSelector feature flag. // This is a beta feature enabled by the PodAffinityNamespaceSelector feature flag.
ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity" ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity"
) )

View File

@ -668,6 +668,7 @@ const (
// owner: @ahg-g // owner: @ahg-g
// alpha: v1.21 // alpha: v1.21
// beta: v1.22
// //
// Allow specifying NamespaceSelector in PodAffinityTerm. // Allow specifying NamespaceSelector in PodAffinityTerm.
PodAffinityNamespaceSelector featuregate.Feature = "PodAffinityNamespaceSelector" PodAffinityNamespaceSelector featuregate.Feature = "PodAffinityNamespaceSelector"
@ -820,7 +821,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
RunAsGroup: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22 RunAsGroup: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22
PodDeletionCost: {Default: true, PreRelease: featuregate.Beta}, PodDeletionCost: {Default: true, PreRelease: featuregate.Beta},
TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha}, TopologyAwareHints: {Default: false, PreRelease: featuregate.Alpha},
PodAffinityNamespaceSelector: {Default: false, PreRelease: featuregate.Alpha}, PodAffinityNamespaceSelector: {Default: true, PreRelease: featuregate.Beta},
ServiceLoadBalancerClass: {Default: false, PreRelease: featuregate.Alpha}, ServiceLoadBalancerClass: {Default: false, PreRelease: featuregate.Alpha},
LogarithmicScaleDown: {Default: false, PreRelease: featuregate.Alpha}, LogarithmicScaleDown: {Default: false, PreRelease: featuregate.Alpha},
IngressClassNamespacedParams: {Default: false, PreRelease: featuregate.Alpha}, IngressClassNamespacedParams: {Default: false, PreRelease: featuregate.Alpha},

View File

@ -3019,7 +3019,7 @@ message PodAffinityTerm {
// and the ones listed in the namespaces field. // and the ones listed in the namespaces field.
// null selector and null or empty namespaces list means "this pod's namespace". // null selector and null or empty namespaces list means "this pod's namespace".
// An empty selector ({}) matches all namespaces. // An empty selector ({}) matches all namespaces.
// This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled. // This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 4; optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 4;
} }

View File

@ -2814,7 +2814,7 @@ type PodAffinityTerm struct {
// and the ones listed in the namespaces field. // and the ones listed in the namespaces field.
// null selector and null or empty namespaces list means "this pod's namespace". // null selector and null or empty namespaces list means "this pod's namespace".
// An empty selector ({}) matches all namespaces. // An empty selector ({}) matches all namespaces.
// This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled. // This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.
// +optional // +optional
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,4,opt,name=namespaceSelector"` NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,4,opt,name=namespaceSelector"`
} }
@ -5688,7 +5688,7 @@ const (
// Match all pod objects that have priority class mentioned // Match all pod objects that have priority class mentioned
ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass"
// Match all pod objects that have cross-namespace pod (anti)affinity mentioned. // Match all pod objects that have cross-namespace pod (anti)affinity mentioned.
// This is an alpha feature enabled by the PodAffinityNamespaceSelector feature flag. // This is a beta feature enabled by the PodAffinityNamespaceSelector feature flag.
ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity" ResourceQuotaScopeCrossNamespacePodAffinity ResourceQuotaScope = "CrossNamespacePodAffinity"
) )

View File

@ -1443,7 +1443,7 @@ var map_PodAffinityTerm = map[string]string{
"labelSelector": "A label query over a set of resources, in this case pods.", "labelSelector": "A label query over a set of resources, in this case pods.",
"namespaces": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"", "namespaces": "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\"",
"topologyKey": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", "topologyKey": "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.",
"namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is alpha-level and is only honored when PodAffinityNamespaceSelector feature is enabled.", "namespaceSelector": "A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means \"this pod's namespace\". An empty selector ({}) matches all namespaces. This field is beta-level and is only honored when PodAffinityNamespaceSelector feature is enabled.",
} }
func (PodAffinityTerm) SwaggerDoc() map[string]string { func (PodAffinityTerm) SwaggerDoc() map[string]string {

View File

@ -1419,7 +1419,7 @@ var _ = SIGDescribe("ResourceQuota [Feature:PodPriority]", func() {
}) })
var _ = SIGDescribe("ResourceQuota [Feature:CrossNamespacePodAffinity] [alpha]", func() { var _ = SIGDescribe("ResourceQuota", func() {
f := framework.NewDefaultFramework("cross-namespace-pod-affinity") f := framework.NewDefaultFramework("cross-namespace-pod-affinity")
ginkgo.It("should verify ResourceQuota with cross namespace pod affinity scope using scope-selectors.", func() { ginkgo.It("should verify ResourceQuota with cross namespace pod affinity scope using scope-selectors.", func() {
ginkgo.By("Creating a ResourceQuota with cross namespace pod affinity scope") ginkgo.By("Creating a ResourceQuota with cross namespace pod affinity scope")