diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index ff0b18e74a6..fa2c6b2b821 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -51580,6 +51580,19 @@ } } }, + "io.k8s.kubernetes.pkg.apis.apps.v1beta1.PartitionStatefulSetStrategy": { + "description": "PartitionStatefulSetStrategy contains the parameters used with the PartitionStatefulSetStrategyType.", + "required": [ + "ordinal" + ], + "properties": { + "ordinal": { + "description": "Ordinal indicates the ordinal at which the StatefulSet should be partitioned.", + "type": "integer", + "format": "int32" + } + } + }, "io.k8s.kubernetes.pkg.apis.apps.v1beta1.RollbackConfig": { "properties": { "revision": { @@ -51747,6 +51760,11 @@ "type": "integer", "format": "int32" }, + "revisionHistoryLimit": { + "description": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.", + "type": "integer", + "format": "int32" + }, "selector": { "description": "selector is a label query over pods that should match the replica count. If empty, defaulted to labels on the pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector" @@ -51759,6 +51777,10 @@ "description": "template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet.", "$ref": "#/definitions/io.k8s.kubernetes.pkg.api.v1.PodTemplateSpec" }, + "updateStrategy": { + "description": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.", + "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.apps.v1beta1.StatefulSetUpdateStrategy" + }, "volumeClaimTemplates": { "description": "volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name.", "type": "array", @@ -51774,15 +51796,51 @@ "replicas" ], "properties": { + "currentReplicas": { + "description": "currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.", + "type": "integer", + "format": "int32" + }, + "currentRevision": { + "description": "currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).", + "type": "string" + }, "observedGeneration": { - "description": "observedGeneration is the most recent generation observed by this StatefulSet.", + "description": "observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet's generation, which is updated on mutation by the API Server.", "type": "integer", "format": "int64" }, - "replicas": { - "description": "replicas is the number of actual replicas.", + "readyReplicas": { + "description": "readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.", "type": "integer", "format": "int32" + }, + "replicas": { + "description": "replicas is the number of Pods created by the StatefulSet controller.", + "type": "integer", + "format": "int32" + }, + "updateRevision": { + "description": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)", + "type": "string" + }, + "updatedReplicas": { + "description": "updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.", + "type": "integer", + "format": "int32" + } + } + }, + "io.k8s.kubernetes.pkg.apis.apps.v1beta1.StatefulSetUpdateStrategy": { + "description": "StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.", + "properties": { + "partition": { + "description": "Partition is used to communicate the ordinal at which to partition the StatefulSet when Type is PartitionStatefulSetStrategyType. This value must be set when Type is PartitionStatefulSetStrategyType, and it must be nil otherwise.", + "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.apps.v1beta1.PartitionStatefulSetStrategy" + }, + "type": { + "description": "Type indicates the type of the StatefulSetUpdateStrategy.", + "type": "string" } } }, diff --git a/api/swagger-spec/apps_v1beta1.json b/api/swagger-spec/apps_v1beta1.json index 704fe935d67..223ea8cd089 100644 --- a/api/swagger-spec/apps_v1beta1.json +++ b/api/swagger-spec/apps_v1beta1.json @@ -5915,6 +5915,15 @@ "podManagementPolicy": { "type": "string", "description": "podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once." + }, + "updateStrategy": { + "$ref": "v1beta1.StatefulSetUpdateStrategy", + "description": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template." + }, + "revisionHistoryLimit": { + "type": "integer", + "format": "int32", + "description": "revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10." } } }, @@ -5998,6 +6007,34 @@ } } }, + "v1beta1.StatefulSetUpdateStrategy": { + "id": "v1beta1.StatefulSetUpdateStrategy", + "description": "StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.", + "properties": { + "type": { + "type": "string", + "description": "Type indicates the type of the StatefulSetUpdateStrategy." + }, + "partition": { + "$ref": "v1beta1.PartitionStatefulSetStrategy", + "description": "Partition is used to communicate the ordinal at which to partition the StatefulSet when Type is PartitionStatefulSetStrategyType. This value must be set when Type is PartitionStatefulSetStrategyType, and it must be nil otherwise." + } + } + }, + "v1beta1.PartitionStatefulSetStrategy": { + "id": "v1beta1.PartitionStatefulSetStrategy", + "description": "PartitionStatefulSetStrategy contains the parameters used with the PartitionStatefulSetStrategyType.", + "required": [ + "ordinal" + ], + "properties": { + "ordinal": { + "type": "integer", + "format": "int32", + "description": "Ordinal indicates the ordinal at which the StatefulSet should be partitioned." + } + } + }, "v1beta1.StatefulSetStatus": { "id": "v1beta1.StatefulSetStatus", "description": "StatefulSetStatus represents the current state of a StatefulSet.", @@ -6008,12 +6045,35 @@ "observedGeneration": { "type": "integer", "format": "int64", - "description": "observedGeneration is the most recent generation observed by this StatefulSet." + "description": "observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet's generation, which is updated on mutation by the API Server." }, "replicas": { "type": "integer", "format": "int32", - "description": "replicas is the number of actual replicas." + "description": "replicas is the number of Pods created by the StatefulSet controller." + }, + "readyReplicas": { + "type": "integer", + "format": "int32", + "description": "readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition." + }, + "currentReplicas": { + "type": "integer", + "format": "int32", + "description": "currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision." + }, + "updatedReplicas": { + "type": "integer", + "format": "int32", + "description": "updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision." + }, + "currentRevision": { + "type": "string", + "description": "currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas)." + }, + "updateRevision": { + "type": "string", + "description": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)" } } }, diff --git a/cmd/kube-controller-manager/app/apps.go b/cmd/kube-controller-manager/app/apps.go index 2d8d722356f..c3e475d940c 100644 --- a/cmd/kube-controller-manager/app/apps.go +++ b/cmd/kube-controller-manager/app/apps.go @@ -33,6 +33,7 @@ func startStatefulSetController(ctx ControllerContext) (bool, error) { ctx.InformerFactory.Core().V1().Pods(), ctx.InformerFactory.Apps().V1beta1().StatefulSets(), ctx.InformerFactory.Core().V1().PersistentVolumeClaims(), + ctx.InformerFactory.Apps().V1beta1().ControllerRevisions(), ctx.ClientBuilder.ClientOrDie("statefulset-controller"), ).Run(1, ctx.Stop) return true, nil diff --git a/docs/api-reference/apps/v1beta1/definitions.html b/docs/api-reference/apps/v1beta1/definitions.html index 06c28a187be..4722d2f3b81 100755 --- a/docs/api-reference/apps/v1beta1/definitions.html +++ b/docs/api-reference/apps/v1beta1/definitions.html @@ -1564,6 +1564,20 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
string
updateStrategy
updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.
false
revisionHistoryLimit
revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet’s revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.
false
integer (int32)
PartitionStatefulSetStrategy contains the parameters used with the PartitionStatefulSetStrategyType.
+Name | +Description | +Required | +Schema | +Default | +
---|---|---|---|---|
ordinal |
+Ordinal indicates the ordinal at which the StatefulSet should be partitioned. |
+true |
+integer (int32) |
++ |
observedGeneration
observedGeneration is the most recent generation observed by this StatefulSet.
observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet’s generation, which is updated on mutation by the API Server.
false
integer (int64)
replicas
replicas is the number of actual replicas.
replicas is the number of Pods created by the StatefulSet controller.
true
integer (int32)
readyReplicas
readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.
false
integer (int32)
currentReplicas
currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.
false
integer (int32)
updatedReplicas
updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.
false
integer (int32)
currentRevision
currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).
false
string
updateRevision
updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)
false
string
StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.
+Name | +Description | +Required | +Schema | +Default | +
---|---|---|---|---|
type |
+Type indicates the type of the StatefulSetUpdateStrategy. |
+false |
+string |
++ |
partition |
+Partition is used to communicate the ordinal at which to partition the StatefulSet when Type is PartitionStatefulSetStrategyType. This value must be set when Type is PartitionStatefulSetStrategyType, and it must be nil otherwise. |
+false |
++ | + |