mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
Merge pull request #35567 from mwielgus/allowed_disruptions_b2
Automatic merge from submit-queue Switch DisruptionBudget api from bool to int allowed disruptions [only v1beta1] Continuation of #34546. Apparently it there is some bug that prevents us from having 2 different incompatibile version of API in integration tests. So in this PR v1alpha1 is removed until testing infrastructure is fixed. Base PR comment: Currently there is a single bool in disruption budget api that denotes whether 1 pod can be deleted or not. Every time a pod is deleted the apiserver filps the bool to false and the disruptionbudget controller sets it to true if more deletions are allowed. This works but it is far from optimal when the user wants to delete multiple pods (for example, by decreasing replicaset size from 10000 to 8000). This PR adds a new api version v1beta1 and changes bool to int which contains a number of pods that can be deleted at once. cc: @davidopp @mml @wojtek-t @fgrzadkowski @caesarxuchao
This commit is contained in:
@@ -5186,11 +5186,11 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"disruptionAllowed": {
|
||||
"disruptionsAllowed": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Whether or not a disruption is currently allowed.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
Description: "Number of pod disruptions that are currently allowed.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"currentHealthy": {
|
||||
@@ -5215,7 +5215,7 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"disruptionAllowed", "currentHealthy", "desiredHealthy", "expectedPods"},
|
||||
Required: []string{"disruptionsAllowed", "currentHealthy", "desiredHealthy", "expectedPods"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{},
|
||||
@@ -13459,29 +13459,6 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
Dependencies: []string{
|
||||
"unversioned.ListMeta", "v1alpha1.ClusterRole"},
|
||||
},
|
||||
"v1alpha1.Eviction": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/<pod name>/eviction.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ObjectMeta describes the pod that is being evicted.",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1.ObjectMeta"),
|
||||
},
|
||||
},
|
||||
"deleteOptions": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "DeleteOptions may be provided",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1.DeleteOptions"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"v1.DeleteOptions", "v1.ObjectMeta"},
|
||||
},
|
||||
"v1alpha1.ImageReview": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -14829,125 +14806,6 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
Dependencies: []string{
|
||||
"unversioned.Duration"},
|
||||
},
|
||||
"v1alpha1.PodDisruptionBudget": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods",
|
||||
Properties: map[string]spec.Schema{
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Ref: spec.MustCreateRef("#/definitions/v1.ObjectMeta"),
|
||||
},
|
||||
},
|
||||
"spec": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Specification of the desired behavior of the PodDisruptionBudget.",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1alpha1.PodDisruptionBudgetSpec"),
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Most recently observed status of the PodDisruptionBudget.",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1alpha1.PodDisruptionBudgetStatus"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"v1.ObjectMeta", "v1alpha1.PodDisruptionBudgetSpec", "v1alpha1.PodDisruptionBudgetStatus"},
|
||||
},
|
||||
"v1alpha1.PodDisruptionBudgetList": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Ref: spec.MustCreateRef("#/definitions/unversioned.ListMeta"),
|
||||
},
|
||||
},
|
||||
"items": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Ref: spec.MustCreateRef("#/definitions/v1alpha1.PodDisruptionBudget"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"items"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"unversioned.ListMeta", "v1alpha1.PodDisruptionBudget"},
|
||||
},
|
||||
"v1alpha1.PodDisruptionBudgetSpec": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"minAvailable": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".",
|
||||
Ref: spec.MustCreateRef("#/definitions/intstr.IntOrString"),
|
||||
},
|
||||
},
|
||||
"selector": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Label query over pods whose evictions are managed by the disruption budget.",
|
||||
Ref: spec.MustCreateRef("#/definitions/unversioned.LabelSelector"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"intstr.IntOrString", "unversioned.LabelSelector"},
|
||||
},
|
||||
"v1alpha1.PodDisruptionBudgetStatus": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"disruptionAllowed": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Whether or not a disruption is currently allowed.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"currentHealthy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "current number of healthy pods",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"desiredHealthy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "minimum desired number of healthy pods",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"expectedPods": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "total number of pods counted by this disruption budget",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"disruptionAllowed", "currentHealthy", "desiredHealthy", "expectedPods"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{},
|
||||
},
|
||||
"v1alpha1.PolicyRule": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -15983,6 +15841,30 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
Dependencies: []string{
|
||||
"v1beta1.RollingUpdateDeployment"},
|
||||
},
|
||||
"v1beta1.Eviction": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/<pod name>/evictions.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "ObjectMeta describes the pod that is being evicted.",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1.ObjectMeta"),
|
||||
},
|
||||
},
|
||||
"deleteOptions": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "DeleteOptions may be provided",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1.DeleteOptions"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"metadata", "deleteOptions"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"v1.DeleteOptions", "v1.ObjectMeta"},
|
||||
},
|
||||
"v1beta1.ExportOptions": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -16931,6 +16813,127 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
||||
},
|
||||
Dependencies: []string{},
|
||||
},
|
||||
"v1beta1.PodDisruptionBudget": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods",
|
||||
Properties: map[string]spec.Schema{
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Ref: spec.MustCreateRef("#/definitions/v1.ObjectMeta"),
|
||||
},
|
||||
},
|
||||
"spec": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Specification of the desired behavior of the PodDisruptionBudget.",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1beta1.PodDisruptionBudgetSpec"),
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Most recently observed status of the PodDisruptionBudget.",
|
||||
Ref: spec.MustCreateRef("#/definitions/v1beta1.PodDisruptionBudgetStatus"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"metadata", "spec", "status"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"v1.ObjectMeta", "v1beta1.PodDisruptionBudgetSpec", "v1beta1.PodDisruptionBudgetStatus"},
|
||||
},
|
||||
"v1beta1.PodDisruptionBudgetList": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetList is a collection of PodDisruptionBudgets.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"metadata": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Ref: spec.MustCreateRef("#/definitions/unversioned.ListMeta"),
|
||||
},
|
||||
},
|
||||
"items": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Ref: spec.MustCreateRef("#/definitions/v1beta1.PodDisruptionBudget"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"metadata", "items"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"unversioned.ListMeta", "v1beta1.PodDisruptionBudget"},
|
||||
},
|
||||
"v1beta1.PodDisruptionBudgetSpec": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"minAvailable": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "An eviction is allowed if at least \"minAvailable\" pods selected by \"selector\" will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying \"100%\".",
|
||||
Ref: spec.MustCreateRef("#/definitions/intstr.IntOrString"),
|
||||
},
|
||||
},
|
||||
"selector": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Label query over pods whose evictions are managed by the disruption budget.",
|
||||
Ref: spec.MustCreateRef("#/definitions/unversioned.LabelSelector"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"minAvailable", "selector"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"intstr.IntOrString", "unversioned.LabelSelector"},
|
||||
},
|
||||
"v1beta1.PodDisruptionBudgetStatus": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.",
|
||||
Properties: map[string]spec.Schema{
|
||||
"disruptionsAllowed": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Number of pod disruptions that are currently allowed.",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"currentHealthy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "current number of healthy pods",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"desiredHealthy": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "minimum desired number of healthy pods",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
"expectedPods": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "total number of pods counted by this disruption budget",
|
||||
Type: []string{"integer"},
|
||||
Format: "int32",
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"disruptionsAllowed", "currentHealthy", "desiredHealthy", "expectedPods"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{},
|
||||
},
|
||||
"v1beta1.PodSecurityPolicy": {
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
|
||||
Reference in New Issue
Block a user