Commit 1a784ef8 authored by Kenneth Owens's avatar Kenneth Owens

Auto generated code for StatefulSet update

parent cec41717
...@@ -51580,6 +51580,19 @@ ...@@ -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": { "io.k8s.kubernetes.pkg.apis.apps.v1beta1.RollbackConfig": {
"properties": { "properties": {
"revision": { "revision": {
...@@ -51747,6 +51760,11 @@ ...@@ -51747,6 +51760,11 @@
"type": "integer", "type": "integer",
"format": "int32" "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": { "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", "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" "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"
...@@ -51759,6 +51777,10 @@ ...@@ -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.", "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" "$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": { "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.", "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", "type": "array",
...@@ -51774,15 +51796,51 @@ ...@@ -51774,15 +51796,51 @@
"replicas" "replicas"
], ],
"properties": { "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": { "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", "type": "integer",
"format": "int64" "format": "int64"
}, },
"readyReplicas": {
"description": "readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.",
"type": "integer",
"format": "int32"
},
"replicas": { "replicas": {
"description": "replicas is the number of actual replicas.", "description": "replicas is the number of Pods created by the StatefulSet controller.",
"type": "integer", "type": "integer",
"format": "int32" "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"
} }
} }
}, },
...@@ -5915,6 +5915,15 @@ ...@@ -5915,6 +5915,15 @@
"podManagementPolicy": { "podManagementPolicy": {
"type": "string", "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." "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 @@ ...@@ -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": { "v1beta1.StatefulSetStatus": {
"id": "v1beta1.StatefulSetStatus", "id": "v1beta1.StatefulSetStatus",
"description": "StatefulSetStatus represents the current state of a StatefulSet.", "description": "StatefulSetStatus represents the current state of a StatefulSet.",
...@@ -6008,12 +6045,35 @@ ...@@ -6008,12 +6045,35 @@
"observedGeneration": { "observedGeneration": {
"type": "integer", "type": "integer",
"format": "int64", "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": { "replicas": {
"type": "integer", "type": "integer",
"format": "int32", "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)"
} }
} }
}, },
......
...@@ -33,6 +33,7 @@ func startStatefulSetController(ctx ControllerContext) (bool, error) { ...@@ -33,6 +33,7 @@ func startStatefulSetController(ctx ControllerContext) (bool, error) {
ctx.InformerFactory.Core().V1().Pods(), ctx.InformerFactory.Core().V1().Pods(),
ctx.InformerFactory.Apps().V1beta1().StatefulSets(), ctx.InformerFactory.Apps().V1beta1().StatefulSets(),
ctx.InformerFactory.Core().V1().PersistentVolumeClaims(), ctx.InformerFactory.Core().V1().PersistentVolumeClaims(),
ctx.InformerFactory.Apps().V1beta1().ControllerRevisions(),
ctx.ClientBuilder.ClientOrDie("statefulset-controller"), ctx.ClientBuilder.ClientOrDie("statefulset-controller"),
).Run(1, ctx.Stop) ).Run(1, ctx.Stop)
return true, nil return true, nil
......
...@@ -1564,6 +1564,20 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } ...@@ -1564,6 +1564,20 @@ span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; }
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">updateStrategy</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1beta1_statefulsetupdatestrategy">v1beta1.StatefulSetUpdateStrategy</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">revisionHistoryLimit</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet&#8217;s revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>
...@@ -1820,6 +1834,40 @@ When an object is created, the system will populate this list with the current s ...@@ -1820,6 +1834,40 @@ When an object is created, the system will populate this list with the current s
</div> </div>
<div class="sect2"> <div class="sect2">
<h3 id="_v1beta1_partitionstatefulsetstrategy">v1beta1.PartitionStatefulSetStrategy</h3>
<div class="paragraph">
<p>PartitionStatefulSetStrategy contains the parameters used with the PartitionStatefulSetStrategyType.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ordinal</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Ordinal indicates the ordinal at which the StatefulSet should be partitioned.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_azurefilevolumesource">v1.AzureFileVolumeSource</h3> <h3 id="_v1_azurefilevolumesource">v1.AzureFileVolumeSource</h3>
<div class="paragraph"> <div class="paragraph">
<p>AzureFile represents an Azure File Service mount on the host and bind mount to the pod.</p> <p>AzureFile represents an Azure File Service mount on the host and bind mount to the pod.</p>
...@@ -5017,18 +5065,53 @@ Examples:<br> ...@@ -5017,18 +5065,53 @@ Examples:<br>
<tbody> <tbody>
<tr> <tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">observedGeneration</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">observedGeneration</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">observedGeneration is the most recent generation observed by this StatefulSet.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">observedGeneration is the most recent generation observed for this StatefulSet. It corresponds to the StatefulSet&#8217;s generation, which is updated on mutation by the API Server.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int64)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr> <tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">replicas</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">replicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">replicas is the number of actual replicas.</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">replicas is the number of Pods created by the StatefulSet controller.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td> <td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td> <td class="tableblock halign-left valign-top"></td>
</tr> </tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">readyReplicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">currentReplicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">updatedReplicas</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">integer (int32)</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">currentRevision</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">updateRevision</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody> </tbody>
</table> </table>
...@@ -6466,6 +6549,47 @@ Examples:<br> ...@@ -6466,6 +6549,47 @@ Examples:<br>
</div> </div>
<div class="sect2"> <div class="sect2">
<h3 id="_v1beta1_statefulsetupdatestrategy">v1beta1.StatefulSetUpdateStrategy</h3>
<div class="paragraph">
<p>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.</p>
</div>
<table class="tableblock frame-all grid-all" style="width:100%; ">
<colgroup>
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
<col style="width:20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Name</th>
<th class="tableblock halign-left valign-top">Description</th>
<th class="tableblock halign-left valign-top">Required</th>
<th class="tableblock halign-left valign-top">Schema</th>
<th class="tableblock halign-left valign-top">Default</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">type</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Type indicates the type of the StatefulSetUpdateStrategy.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">partition</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">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.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1beta1_partitionstatefulsetstrategy">v1beta1.PartitionStatefulSetStrategy</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_v1_nodeaffinity">v1.NodeAffinity</h3> <h3 id="_v1_nodeaffinity">v1.NodeAffinity</h3>
<div class="paragraph"> <div class="paragraph">
<p>Node affinity is a group of node affinity scheduling rules.</p> <p>Node affinity is a group of node affinity scheduling rules.</p>
...@@ -6614,7 +6738,7 @@ Examples:<br> ...@@ -6614,7 +6738,7 @@ Examples:<br>
</div> </div>
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Last updated 2017-06-06 04:24:56 UTC Last updated 2017-06-06 19:37:03 UTC
</div> </div>
</div> </div>
</body> </body>
......
...@@ -193,6 +193,7 @@ pkg/client/unversioned ...@@ -193,6 +193,7 @@ pkg/client/unversioned
pkg/cloudprovider/providers pkg/cloudprovider/providers
pkg/cloudprovider/providers/azure pkg/cloudprovider/providers/azure
pkg/cloudprovider/providers/cloudstack pkg/cloudprovider/providers/cloudstack
pkg/controller/history
pkg/controller/volume/attachdetach/cache pkg/controller/volume/attachdetach/cache
pkg/controller/volume/attachdetach/populator pkg/controller/volume/attachdetach/populator
pkg/controller/volume/attachdetach/reconciler pkg/controller/volume/attachdetach/reconciler
......
...@@ -224,6 +224,14 @@ message DeploymentStrategy { ...@@ -224,6 +224,14 @@ message DeploymentStrategy {
optional RollingUpdateDeployment rollingUpdate = 2; optional RollingUpdateDeployment rollingUpdate = 2;
} }
// PartitionStatefulSetStrategy contains the parameters used with the
// PartitionStatefulSetStrategyType.
message PartitionStatefulSetStrategy {
// Ordinal indicates the ordinal at which the StatefulSet should be
// partitioned.
optional int32 ordinal = 1;
}
message RollbackConfig { message RollbackConfig {
// The revision to rollback to. If set to 0, rollback to the last revision. // The revision to rollback to. If set to 0, rollback to the last revision.
// +optional // +optional
...@@ -378,15 +386,60 @@ message StatefulSetSpec { ...@@ -378,15 +386,60 @@ message StatefulSetSpec {
// all pods at once. // all pods at once.
// +optional // +optional
optional string podManagementPolicy = 6; optional string podManagementPolicy = 6;
// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
optional StatefulSetUpdateStrategy updateStrategy = 7;
// 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.
optional int32 revisionHistoryLimit = 8;
} }
// StatefulSetStatus represents the current state of a StatefulSet. // StatefulSetStatus represents the current state of a StatefulSet.
message StatefulSetStatus { message StatefulSetStatus {
// 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.
// +optional // +optional
optional int64 observedGeneration = 1; optional int64 observedGeneration = 1;
// replicas is the number of actual replicas. // replicas is the number of Pods created by the StatefulSet controller.
optional int32 replicas = 2; optional int32 replicas = 2;
// readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.
optional int32 readyReplicas = 3;
// currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by currentRevision.
optional int32 currentReplicas = 4;
// updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by updateRevision.
optional int32 updatedReplicas = 5;
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
// sequence [0,currentReplicas).
optional string currentRevision = 6;
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
// [replicas-updatedReplicas,replicas)
optional string updateRevision = 7;
}
// 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.
message StatefulSetUpdateStrategy {
// Type indicates the type of the StatefulSetUpdateStrategy.
optional string type = 1;
// 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.
optional PartitionStatefulSetStrategy partition = 2;
} }
...@@ -137,6 +137,15 @@ func (DeploymentStrategy) SwaggerDoc() map[string]string { ...@@ -137,6 +137,15 @@ func (DeploymentStrategy) SwaggerDoc() map[string]string {
return map_DeploymentStrategy return map_DeploymentStrategy
} }
var map_PartitionStatefulSetStrategy = map[string]string{
"": "PartitionStatefulSetStrategy contains the parameters used with the PartitionStatefulSetStrategyType.",
"ordinal": "Ordinal indicates the ordinal at which the StatefulSet should be partitioned.",
}
func (PartitionStatefulSetStrategy) SwaggerDoc() map[string]string {
return map_PartitionStatefulSetStrategy
}
var map_RollbackConfig = map[string]string{ var map_RollbackConfig = map[string]string{
"revision": "The revision to rollback to. If set to 0, rollback to the last revision.", "revision": "The revision to rollback to. If set to 0, rollback to the last revision.",
} }
...@@ -212,6 +221,8 @@ var map_StatefulSetSpec = map[string]string{ ...@@ -212,6 +221,8 @@ var map_StatefulSetSpec = map[string]string{
"volumeClaimTemplates": "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.", "volumeClaimTemplates": "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.",
"serviceName": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.", "serviceName": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.",
"podManagementPolicy": "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.", "podManagementPolicy": "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": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.",
"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.",
} }
func (StatefulSetSpec) SwaggerDoc() map[string]string { func (StatefulSetSpec) SwaggerDoc() map[string]string {
...@@ -220,12 +231,27 @@ func (StatefulSetSpec) SwaggerDoc() map[string]string { ...@@ -220,12 +231,27 @@ func (StatefulSetSpec) SwaggerDoc() map[string]string {
var map_StatefulSetStatus = map[string]string{ var map_StatefulSetStatus = map[string]string{
"": "StatefulSetStatus represents the current state of a StatefulSet.", "": "StatefulSetStatus represents the current state of a StatefulSet.",
"observedGeneration": "observedGeneration is the most recent generation observed by this StatefulSet.", "observedGeneration": "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": "replicas is the number of actual replicas.", "replicas": "replicas is the number of Pods created by the StatefulSet controller.",
"readyReplicas": "readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.",
"currentReplicas": "currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.",
"updatedReplicas": "updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.",
"currentRevision": "currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).",
"updateRevision": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)",
} }
func (StatefulSetStatus) SwaggerDoc() map[string]string { func (StatefulSetStatus) SwaggerDoc() map[string]string {
return map_StatefulSetStatus return map_StatefulSetStatus
} }
var map_StatefulSetUpdateStrategy = map[string]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.",
"type": "Type indicates the type of the StatefulSetUpdateStrategy.",
"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.",
}
func (StatefulSetUpdateStrategy) SwaggerDoc() map[string]string {
return map_StatefulSetUpdateStrategy
}
// AUTO-GENERATED FUNCTIONS END HERE // AUTO-GENERATED FUNCTIONS END HERE
...@@ -42,6 +42,8 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -42,6 +42,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_apps_ControllerRevision_To_v1beta1_ControllerRevision, Convert_apps_ControllerRevision_To_v1beta1_ControllerRevision,
Convert_v1beta1_ControllerRevisionList_To_apps_ControllerRevisionList, Convert_v1beta1_ControllerRevisionList_To_apps_ControllerRevisionList,
Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList, Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList,
Convert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy,
Convert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy,
Convert_v1beta1_StatefulSet_To_apps_StatefulSet, Convert_v1beta1_StatefulSet_To_apps_StatefulSet,
Convert_apps_StatefulSet_To_v1beta1_StatefulSet, Convert_apps_StatefulSet_To_v1beta1_StatefulSet,
Convert_v1beta1_StatefulSetList_To_apps_StatefulSetList, Convert_v1beta1_StatefulSetList_To_apps_StatefulSetList,
...@@ -50,6 +52,8 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -50,6 +52,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec, Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec,
Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus, Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus,
Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus, Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus,
Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy,
Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy,
) )
} }
...@@ -123,6 +127,26 @@ func Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in *a ...@@ -123,6 +127,26 @@ func Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in *a
return autoConvert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in, out, s) return autoConvert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in, out, s)
} }
func autoConvert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy(in *PartitionStatefulSetStrategy, out *apps.PartitionStatefulSetStrategy, s conversion.Scope) error {
out.Ordinal = in.Ordinal
return nil
}
// Convert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy is an autogenerated conversion function.
func Convert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy(in *PartitionStatefulSetStrategy, out *apps.PartitionStatefulSetStrategy, s conversion.Scope) error {
return autoConvert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy(in, out, s)
}
func autoConvert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy(in *apps.PartitionStatefulSetStrategy, out *PartitionStatefulSetStrategy, s conversion.Scope) error {
out.Ordinal = in.Ordinal
return nil
}
// Convert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy is an autogenerated conversion function.
func Convert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy(in *apps.PartitionStatefulSetStrategy, out *PartitionStatefulSetStrategy, s conversion.Scope) error {
return autoConvert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy(in, out, s)
}
func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error { func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta out.ObjectMeta = in.ObjectMeta
if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil { if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil {
...@@ -208,6 +232,10 @@ func autoConvert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSet ...@@ -208,6 +232,10 @@ func autoConvert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSet
out.VolumeClaimTemplates = *(*[]api.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates)) out.VolumeClaimTemplates = *(*[]api.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates))
out.ServiceName = in.ServiceName out.ServiceName = in.ServiceName
out.PodManagementPolicy = apps.PodManagementPolicyType(in.PodManagementPolicy) out.PodManagementPolicy = apps.PodManagementPolicyType(in.PodManagementPolicy)
if err := Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil {
return err
}
out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit))
return nil return nil
} }
...@@ -222,12 +250,21 @@ func autoConvert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.Statef ...@@ -222,12 +250,21 @@ func autoConvert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.Statef
out.VolumeClaimTemplates = *(*[]api_v1.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates)) out.VolumeClaimTemplates = *(*[]api_v1.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates))
out.ServiceName = in.ServiceName out.ServiceName = in.ServiceName
out.PodManagementPolicy = PodManagementPolicyType(in.PodManagementPolicy) out.PodManagementPolicy = PodManagementPolicyType(in.PodManagementPolicy)
if err := Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil {
return err
}
out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit))
return nil return nil
} }
func autoConvert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { func autoConvert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error {
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
out.Replicas = in.Replicas out.Replicas = in.Replicas
out.ReadyReplicas = in.ReadyReplicas
out.CurrentReplicas = in.CurrentReplicas
out.UpdatedReplicas = in.UpdatedReplicas
out.CurrentRevision = in.CurrentRevision
out.UpdateRevision = in.UpdateRevision
return nil return nil
} }
...@@ -239,6 +276,11 @@ func Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSet ...@@ -239,6 +276,11 @@ func Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSet
func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error {
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
out.Replicas = in.Replicas out.Replicas = in.Replicas
out.ReadyReplicas = in.ReadyReplicas
out.CurrentReplicas = in.CurrentReplicas
out.UpdatedReplicas = in.UpdatedReplicas
out.CurrentRevision = in.CurrentRevision
out.UpdateRevision = in.UpdateRevision
return nil return nil
} }
...@@ -246,3 +288,15 @@ func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.St ...@@ -246,3 +288,15 @@ func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.St
func Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { func Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error {
return autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in, out, s) return autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in, out, s)
} }
func autoConvert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy(in *StatefulSetUpdateStrategy, out *apps.StatefulSetUpdateStrategy, s conversion.Scope) error {
out.Type = apps.StatefulSetUpdateStrategyType(in.Type)
out.Partition = (*apps.PartitionStatefulSetStrategy)(unsafe.Pointer(in.Partition))
return nil
}
func autoConvert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy(in *apps.StatefulSetUpdateStrategy, out *StatefulSetUpdateStrategy, s conversion.Scope) error {
out.Type = StatefulSetUpdateStrategyType(in.Type)
out.Partition = (*PartitionStatefulSetStrategy)(unsafe.Pointer(in.Partition))
return nil
}
...@@ -46,6 +46,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -46,6 +46,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentSpec, InType: reflect.TypeOf(&DeploymentSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentSpec, InType: reflect.TypeOf(&DeploymentSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStatus, InType: reflect.TypeOf(&DeploymentStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStatus, InType: reflect.TypeOf(&DeploymentStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStrategy, InType: reflect.TypeOf(&DeploymentStrategy{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStrategy, InType: reflect.TypeOf(&DeploymentStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PartitionStatefulSetStrategy, InType: reflect.TypeOf(&PartitionStatefulSetStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollbackConfig, InType: reflect.TypeOf(&RollbackConfig{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollbackConfig, InType: reflect.TypeOf(&RollbackConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollingUpdateDeployment, InType: reflect.TypeOf(&RollingUpdateDeployment{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollingUpdateDeployment, InType: reflect.TypeOf(&RollingUpdateDeployment{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Scale, InType: reflect.TypeOf(&Scale{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Scale, InType: reflect.TypeOf(&Scale{})},
...@@ -55,6 +56,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -55,6 +56,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetUpdateStrategy, InType: reflect.TypeOf(&StatefulSetUpdateStrategy{})},
) )
} }
...@@ -251,6 +253,16 @@ func DeepCopy_v1beta1_DeploymentStrategy(in interface{}, out interface{}, c *con ...@@ -251,6 +253,16 @@ func DeepCopy_v1beta1_DeploymentStrategy(in interface{}, out interface{}, c *con
} }
} }
// DeepCopy_v1beta1_PartitionStatefulSetStrategy is an autogenerated deepcopy function.
func DeepCopy_v1beta1_PartitionStatefulSetStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PartitionStatefulSetStrategy)
out := out.(*PartitionStatefulSetStrategy)
*out = *in
return nil
}
}
// DeepCopy_v1beta1_RollbackConfig is an autogenerated deepcopy function. // DeepCopy_v1beta1_RollbackConfig is an autogenerated deepcopy function.
func DeepCopy_v1beta1_RollbackConfig(in interface{}, out interface{}, c *conversion.Cloner) error { func DeepCopy_v1beta1_RollbackConfig(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
...@@ -397,6 +409,14 @@ func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conver ...@@ -397,6 +409,14 @@ func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conver
} }
} }
} }
if err := DeepCopy_v1beta1_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, c); err != nil {
return err
}
if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
*out = new(int32)
**out = **in
}
return nil return nil
} }
} }
...@@ -415,3 +435,18 @@ func DeepCopy_v1beta1_StatefulSetStatus(in interface{}, out interface{}, c *conv ...@@ -415,3 +435,18 @@ func DeepCopy_v1beta1_StatefulSetStatus(in interface{}, out interface{}, c *conv
return nil return nil
} }
} }
// DeepCopy_v1beta1_StatefulSetUpdateStrategy is an autogenerated deepcopy function.
func DeepCopy_v1beta1_StatefulSetUpdateStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatefulSetUpdateStrategy)
out := out.(*StatefulSetUpdateStrategy)
*out = *in
if in.Partition != nil {
in, out := &in.Partition, &out.Partition
*out = new(PartitionStatefulSetStrategy)
**out = **in
}
return nil
}
}
...@@ -38,10 +38,12 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -38,10 +38,12 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs( return scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevision, InType: reflect.TypeOf(&ControllerRevision{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevision, InType: reflect.TypeOf(&ControllerRevision{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevisionList, InType: reflect.TypeOf(&ControllerRevisionList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevisionList, InType: reflect.TypeOf(&ControllerRevisionList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_PartitionStatefulSetStrategy, InType: reflect.TypeOf(&PartitionStatefulSetStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSet, InType: reflect.TypeOf(&StatefulSet{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSet, InType: reflect.TypeOf(&StatefulSet{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetUpdateStrategy, InType: reflect.TypeOf(&StatefulSetUpdateStrategy{})},
) )
} }
...@@ -87,6 +89,16 @@ func DeepCopy_apps_ControllerRevisionList(in interface{}, out interface{}, c *co ...@@ -87,6 +89,16 @@ func DeepCopy_apps_ControllerRevisionList(in interface{}, out interface{}, c *co
} }
} }
// DeepCopy_apps_PartitionStatefulSetStrategy is an autogenerated deepcopy function.
func DeepCopy_apps_PartitionStatefulSetStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PartitionStatefulSetStrategy)
out := out.(*PartitionStatefulSetStrategy)
*out = *in
return nil
}
}
// DeepCopy_apps_StatefulSet is an autogenerated deepcopy function. // DeepCopy_apps_StatefulSet is an autogenerated deepcopy function.
func DeepCopy_apps_StatefulSet(in interface{}, out interface{}, c *conversion.Cloner) error { func DeepCopy_apps_StatefulSet(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
...@@ -153,6 +165,14 @@ func DeepCopy_apps_StatefulSetSpec(in interface{}, out interface{}, c *conversio ...@@ -153,6 +165,14 @@ func DeepCopy_apps_StatefulSetSpec(in interface{}, out interface{}, c *conversio
} }
} }
} }
if err := DeepCopy_apps_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, c); err != nil {
return err
}
if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
*out = new(int32)
**out = **in
}
return nil return nil
} }
} }
...@@ -171,3 +191,18 @@ func DeepCopy_apps_StatefulSetStatus(in interface{}, out interface{}, c *convers ...@@ -171,3 +191,18 @@ func DeepCopy_apps_StatefulSetStatus(in interface{}, out interface{}, c *convers
return nil return nil
} }
} }
// DeepCopy_apps_StatefulSetUpdateStrategy is an autogenerated deepcopy function.
func DeepCopy_apps_StatefulSetUpdateStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatefulSetUpdateStrategy)
out := out.(*StatefulSetUpdateStrategy)
*out = *in
if in.Partition != nil {
in, out := &in.Partition, &out.Partition
*out = new(PartitionStatefulSetStrategy)
**out = **in
}
return nil
}
}
...@@ -111,6 +111,7 @@ filegroup( ...@@ -111,6 +111,7 @@ filegroup(
"//pkg/controller/disruption:all-srcs", "//pkg/controller/disruption:all-srcs",
"//pkg/controller/endpoint:all-srcs", "//pkg/controller/endpoint:all-srcs",
"//pkg/controller/garbagecollector:all-srcs", "//pkg/controller/garbagecollector:all-srcs",
"//pkg/controller/history:all-srcs",
"//pkg/controller/job:all-srcs", "//pkg/controller/job:all-srcs",
"//pkg/controller/namespace:all-srcs", "//pkg/controller/namespace:all-srcs",
"//pkg/controller/node:all-srcs", "//pkg/controller/node:all-srcs",
......
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_test(
name = "go_default_test",
srcs = ["controller_history_test.go"],
library = ":go_default_library",
tags = ["automanaged"],
deps = [
"//pkg/api/testapi:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/apis/apps/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//pkg/client/informers/informers_generated/externalversions:go_default_library",
"//pkg/controller:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library",
"//vendor/k8s.io/client-go/testing:go_default_library",
],
)
go_library(
name = "go_default_library",
srcs = ["controller_history.go"],
tags = ["automanaged"],
deps = [
"//pkg/apis/apps/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/informers/informers_generated/externalversions/apps/v1beta1:go_default_library",
"//pkg/client/listers/apps/v1beta1:go_default_library",
"//pkg/client/retry:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/util/hash:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
...@@ -14,6 +14,7 @@ go_library( ...@@ -14,6 +14,7 @@ go_library(
"stateful_pod_control.go", "stateful_pod_control.go",
"stateful_set.go", "stateful_set.go",
"stateful_set_control.go", "stateful_set_control.go",
"stateful_set_status_updater.go",
"stateful_set_utils.go", "stateful_set_utils.go",
], ],
tags = ["automanaged"], tags = ["automanaged"],
...@@ -29,12 +30,15 @@ go_library( ...@@ -29,12 +30,15 @@ go_library(
"//pkg/client/listers/core/v1:go_default_library", "//pkg/client/listers/core/v1:go_default_library",
"//pkg/client/retry:go_default_library", "//pkg/client/retry:go_default_library",
"//pkg/controller:go_default_library", "//pkg/controller:go_default_library",
"//pkg/controller/history:go_default_library",
"//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/strategicpatch:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
"//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library", "//vendor/k8s.io/client-go/kubernetes/scheme:go_default_library",
"//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
...@@ -50,6 +54,7 @@ go_test( ...@@ -50,6 +54,7 @@ go_test(
srcs = [ srcs = [
"stateful_pod_control_test.go", "stateful_pod_control_test.go",
"stateful_set_control_test.go", "stateful_set_control_test.go",
"stateful_set_status_updater_test.go",
"stateful_set_test.go", "stateful_set_test.go",
"stateful_set_utils_test.go", "stateful_set_utils_test.go",
], ],
...@@ -68,6 +73,7 @@ go_test( ...@@ -68,6 +73,7 @@ go_test(
"//pkg/client/listers/apps/v1beta1:go_default_library", "//pkg/client/listers/apps/v1beta1:go_default_library",
"//pkg/client/listers/core/v1:go_default_library", "//pkg/client/listers/core/v1:go_default_library",
"//pkg/controller:go_default_library", "//pkg/controller:go_default_library",
"//pkg/controller/history:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
...@@ -77,6 +83,7 @@ go_test( ...@@ -77,6 +83,7 @@ go_test(
"//vendor/k8s.io/client-go/testing:go_default_library", "//vendor/k8s.io/client-go/testing:go_default_library",
"//vendor/k8s.io/client-go/tools/cache:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library",
"//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/client-go/tools/record:go_default_library",
"//vendor/k8s.io/metrics/pkg/client/clientset_generated/clientset/scheme:go_default_library",
], ],
) )
......
...@@ -148,6 +148,7 @@ go_test( ...@@ -148,6 +148,7 @@ go_test(
"//pkg/api/testapi:go_default_library", "//pkg/api/testapi:go_default_library",
"//pkg/api/testing:go_default_library", "//pkg/api/testing:go_default_library",
"//pkg/api/v1:go_default_library", "//pkg/api/v1:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/apps/v1beta1:go_default_library", "//pkg/apis/apps/v1beta1:go_default_library",
"//pkg/apis/batch:go_default_library", "//pkg/apis/batch:go_default_library",
"//pkg/apis/batch/v1:go_default_library", "//pkg/apis/batch/v1:go_default_library",
......
...@@ -60,6 +60,54 @@ const ( ...@@ -60,6 +60,54 @@ const (
ParallelPodManagement = "Parallel" ParallelPodManagement = "Parallel"
) )
// 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.
type StatefulSetUpdateStrategy struct {
// Type indicates the type of the StatefulSetUpdateStrategy.
Type StatefulSetUpdateStrategyType
// 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.
Partition *PartitionStatefulSetStrategy
}
// StatefulSetUpdateStrategyType is a string enumeration type that enumerates
// all possible update strategies for the StatefulSet controller.
type StatefulSetUpdateStrategyType string
const (
// PartitionStatefulSetStrategyType indicates that updates will only be
// applied to a partition of the StatefulSet. This is useful for canaries
// and phased roll outs. When a scale operation is performed with this
// strategy, new Pods will be created from the specification version indicated
// by the StatefulSet's currentRevision if there ordinal is less than the supplied
// Partition's ordinal. Otherwise, they will be created from the specification
// version indicated by the StatefulSet's updateRevision.
PartitionStatefulSetStrategyType StatefulSetUpdateStrategyType = "Partition"
// RollingUpdateStatefulSetStrategyType indicates that update will be
// applied to all Pods in the StatefulSet with respect to the StatefulSet
// ordering constraints. When a scale operation is performed with this
// strategy, new Pods will be created from the specification version indicated
// by the StatefulSet's updateRevision.
RollingUpdateStatefulSetStrategyType = "RollingUpdate"
// OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version
// tracking and ordered rolling restarts are disabled. Pods are recreated
// from the StatefulSetSpec when they are manually deleted. When a scale
// operation is performed with this strategy,specification version indicated
// by the StatefulSet's currentRevision.
OnDeleteStatefulSetStrategyType = "OnDelete"
)
// PartitionStatefulSetStrategy contains the parameters used with the
// PartitionStatefulSetStrategyType.
type PartitionStatefulSetStrategy struct {
// Ordinal indicates the ordinal at which the StatefulSet should be
// partitioned.
Ordinal int32
}
// A StatefulSetSpec is the specification of a StatefulSet. // A StatefulSetSpec is the specification of a StatefulSet.
type StatefulSetSpec struct { type StatefulSetSpec struct {
// Replicas is the desired number of replicas of the given Template. // Replicas is the desired number of replicas of the given Template.
...@@ -109,16 +157,47 @@ type StatefulSetSpec struct { ...@@ -109,16 +157,47 @@ type StatefulSetSpec struct {
// all pods at once. // all pods at once.
// +optional // +optional
PodManagementPolicy PodManagementPolicyType PodManagementPolicy PodManagementPolicyType
// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
UpdateStrategy StatefulSetUpdateStrategy
// 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.
RevisionHistoryLimit *int32
} }
// StatefulSetStatus represents the current state of a StatefulSet. // StatefulSetStatus represents the current state of a StatefulSet.
type StatefulSetStatus struct { type StatefulSetStatus struct {
// 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.
// +optional // +optional
ObservedGeneration *int64 ObservedGeneration *int64
// Replicas is the number of actual replicas. // replicas is the number of Pods created by the StatefulSet controller.
Replicas int32 Replicas int32
// readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.
ReadyReplicas int32
// currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by currentRevision.
CurrentReplicas int32
// updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by updateRevision.
UpdatedReplicas int32
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
// sequence [0,currentReplicas).
CurrentRevision string
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
// [replicas-updatedReplicas,replicas)
UpdateRevision string
} }
// StatefulSetList is a collection of StatefulSets. // StatefulSetList is a collection of StatefulSets.
......
...@@ -37,6 +37,8 @@ func addConversionFuncs(scheme *runtime.Scheme) error { ...@@ -37,6 +37,8 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
err := scheme.AddConversionFuncs( err := scheme.AddConversionFuncs(
Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec, Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec,
Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec, Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec,
Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy,
Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy,
// extensions // extensions
// TODO: below conversions should be dropped in favor of auto-generated // TODO: below conversions should be dropped in favor of auto-generated
// ones, see https://github.com/kubernetes/kubernetextensionsssues/39865 // ones, see https://github.com/kubernetes/kubernetextensionsssues/39865
...@@ -109,6 +111,15 @@ func Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpec ...@@ -109,6 +111,15 @@ func Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSetSpec
} else { } else {
out.VolumeClaimTemplates = nil out.VolumeClaimTemplates = nil
} }
if err := Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil {
return err
}
if in.RevisionHistoryLimit != nil {
out.RevisionHistoryLimit = new(int32)
*out.RevisionHistoryLimit = *in.RevisionHistoryLimit
} else {
out.RevisionHistoryLimit = nil
}
out.ServiceName = in.ServiceName out.ServiceName = in.ServiceName
out.PodManagementPolicy = apps.PodManagementPolicyType(in.PodManagementPolicy) out.PodManagementPolicy = apps.PodManagementPolicyType(in.PodManagementPolicy)
return nil return nil
...@@ -140,8 +151,39 @@ func Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.StatefulSe ...@@ -140,8 +151,39 @@ func Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.StatefulSe
} else { } else {
out.VolumeClaimTemplates = nil out.VolumeClaimTemplates = nil
} }
if in.RevisionHistoryLimit != nil {
out.RevisionHistoryLimit = new(int32)
*out.RevisionHistoryLimit = *in.RevisionHistoryLimit
} else {
out.RevisionHistoryLimit = nil
}
out.ServiceName = in.ServiceName out.ServiceName = in.ServiceName
out.PodManagementPolicy = PodManagementPolicyType(in.PodManagementPolicy) out.PodManagementPolicy = PodManagementPolicyType(in.PodManagementPolicy)
if err := Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil {
return err
}
return nil
}
func Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy(in *StatefulSetUpdateStrategy, out *apps.StatefulSetUpdateStrategy, s conversion.Scope) error {
out.Type = apps.StatefulSetUpdateStrategyType(in.Type)
if in.Partition != nil {
out.Partition = new(apps.PartitionStatefulSetStrategy)
out.Partition.Ordinal = in.Partition.Ordinal
} else {
out.Partition = nil
}
return nil
}
func Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy(in *apps.StatefulSetUpdateStrategy, out *StatefulSetUpdateStrategy, s conversion.Scope) error {
out.Type = StatefulSetUpdateStrategyType(in.Type)
if in.Partition != nil {
out.Partition = new(PartitionStatefulSetStrategy)
out.Partition.Ordinal = in.Partition.Ordinal
} else {
out.Partition = nil
}
return nil return nil
} }
......
...@@ -30,6 +30,10 @@ func SetDefaults_StatefulSet(obj *StatefulSet) { ...@@ -30,6 +30,10 @@ func SetDefaults_StatefulSet(obj *StatefulSet) {
if len(obj.Spec.PodManagementPolicy) == 0 { if len(obj.Spec.PodManagementPolicy) == 0 {
obj.Spec.PodManagementPolicy = OrderedReadyPodManagement obj.Spec.PodManagementPolicy = OrderedReadyPodManagement
} }
if obj.Spec.UpdateStrategy.Type == "" {
obj.Spec.UpdateStrategy.Type = OnDeleteStatefulSetStrategyType
}
labels := obj.Spec.Template.Labels labels := obj.Spec.Template.Labels
if labels != nil { if labels != nil {
if obj.Spec.Selector == nil { if obj.Spec.Selector == nil {
...@@ -45,6 +49,11 @@ func SetDefaults_StatefulSet(obj *StatefulSet) { ...@@ -45,6 +49,11 @@ func SetDefaults_StatefulSet(obj *StatefulSet) {
obj.Spec.Replicas = new(int32) obj.Spec.Replicas = new(int32)
*obj.Spec.Replicas = 1 *obj.Spec.Replicas = 1
} }
if obj.Spec.RevisionHistoryLimit == nil {
obj.Spec.RevisionHistoryLimit = new(int32)
*obj.Spec.RevisionHistoryLimit = 10
}
} }
// SetDefaults_Deployment sets additional defaults compared to its counterpart // SetDefaults_Deployment sets additional defaults compared to its counterpart
......
...@@ -224,6 +224,14 @@ message DeploymentStrategy { ...@@ -224,6 +224,14 @@ message DeploymentStrategy {
optional RollingUpdateDeployment rollingUpdate = 2; optional RollingUpdateDeployment rollingUpdate = 2;
} }
// PartitionStatefulSetStrategy contains the parameters used with the
// PartitionStatefulSetStrategyType.
message PartitionStatefulSetStrategy {
// Ordinal indicates the ordinal at which the StatefulSet should be
// partitioned.
optional int32 ordinal = 1;
}
message RollbackConfig { message RollbackConfig {
// The revision to rollback to. If set to 0, rollback to the last revision. // The revision to rollback to. If set to 0, rollback to the last revision.
// +optional // +optional
...@@ -378,15 +386,60 @@ message StatefulSetSpec { ...@@ -378,15 +386,60 @@ message StatefulSetSpec {
// all pods at once. // all pods at once.
// +optional // +optional
optional string podManagementPolicy = 6; optional string podManagementPolicy = 6;
// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
optional StatefulSetUpdateStrategy updateStrategy = 7;
// 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.
optional int32 revisionHistoryLimit = 8;
} }
// StatefulSetStatus represents the current state of a StatefulSet. // StatefulSetStatus represents the current state of a StatefulSet.
message StatefulSetStatus { message StatefulSetStatus {
// 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.
// +optional // +optional
optional int64 observedGeneration = 1; optional int64 observedGeneration = 1;
// replicas is the number of actual replicas. // replicas is the number of Pods created by the StatefulSet controller.
optional int32 replicas = 2; optional int32 replicas = 2;
// readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.
optional int32 readyReplicas = 3;
// currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by currentRevision.
optional int32 currentReplicas = 4;
// updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by updateRevision.
optional int32 updatedReplicas = 5;
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
// sequence [0,currentReplicas).
optional string currentRevision = 6;
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
// [replicas-updatedReplicas,replicas)
optional string updateRevision = 7;
}
// 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.
message StatefulSetUpdateStrategy {
// Type indicates the type of the StatefulSetUpdateStrategy.
optional string type = 1;
// 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.
optional PartitionStatefulSetStrategy partition = 2;
} }
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
const ( const (
// StatefulSetInitAnnotation if present, and set to false, indicates that a Pod's readiness should be ignored. // StatefulSetInitAnnotation if present, and set to false, indicates that a Pod's readiness should be ignored.
StatefulSetInitAnnotation = "pod.alpha.kubernetes.io/initialized" StatefulSetInitAnnotation = "pod.alpha.kubernetes.io/initialized"
StatefulSetRevisionLabel = "statefulset.beta.kubernetes.io/revision"
) )
// ScaleSpec describes the attributes of a scale subresource // ScaleSpec describes the attributes of a scale subresource
...@@ -111,6 +112,54 @@ const ( ...@@ -111,6 +112,54 @@ const (
ParallelPodManagement = "Parallel" ParallelPodManagement = "Parallel"
) )
// 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.
type StatefulSetUpdateStrategy struct {
// Type indicates the type of the StatefulSetUpdateStrategy.
Type StatefulSetUpdateStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=StatefulSetStrategyType"`
// 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.
Partition *PartitionStatefulSetStrategy `json:"partition,omitempty" protobuf:"bytes,2,opt,name=partition"`
}
// StatefulSetUpdateStrategyType is a string enumeration type that enumerates
// all possible update strategies for the StatefulSet controller.
type StatefulSetUpdateStrategyType string
const (
// PartitionStatefulSetStrategyType indicates that updates will only be
// applied to a partition of the StatefulSet. This is useful for canaries
// and phased roll outs. When a scale operation is performed with this
// strategy, new Pods will be created from the specification version indicated
// by the StatefulSet's currentRevision if there ordinal is less than the supplied
// Partition's ordinal. Otherwise, they will be created from the specification
// version indicated by the StatefulSet's updateRevision.
PartitionStatefulSetStrategyType StatefulSetUpdateStrategyType = "Partition"
// RollingUpdateStatefulSetStrategyType indicates that update will be
// applied to all Pods in the StatefulSet with respect to the StatefulSet
// ordering constraints. When a scale operation is performed with this
// strategy, new Pods will be created from the specification version indicated
// by the StatefulSet's updateRevision.
RollingUpdateStatefulSetStrategyType = "RollingUpdate"
// OnDeleteStatefulSetStrategyType triggers the legacy behavior. Version
// tracking and ordered rolling restarts are disabled. Pods are recreated
// from the StatefulSetSpec when they are manually deleted. When a scale
// operation is performed with this strategy,specification version indicated
// by the StatefulSet's currentRevision.
OnDeleteStatefulSetStrategyType = "OnDelete"
)
// PartitionStatefulSetStrategy contains the parameters used with the
// PartitionStatefulSetStrategyType.
type PartitionStatefulSetStrategy struct {
// Ordinal indicates the ordinal at which the StatefulSet should be
// partitioned.
Ordinal int32 `json:"ordinal" protobuf:"varint,1,opt,name=ordinal"`
}
// A StatefulSetSpec is the specification of a StatefulSet. // A StatefulSetSpec is the specification of a StatefulSet.
type StatefulSetSpec struct { type StatefulSetSpec struct {
// replicas is the desired number of replicas of the given Template. // replicas is the desired number of replicas of the given Template.
...@@ -160,16 +209,47 @@ type StatefulSetSpec struct { ...@@ -160,16 +209,47 @@ type StatefulSetSpec struct {
// all pods at once. // all pods at once.
// +optional // +optional
PodManagementPolicy PodManagementPolicyType `json:"podManagementPolicy,omitempty" protobuf:"bytes,6,opt,name=podManagementPolicy,casttype=PodManagementPolicyType"` PodManagementPolicy PodManagementPolicyType `json:"podManagementPolicy,omitempty" protobuf:"bytes,6,opt,name=podManagementPolicy,casttype=PodManagementPolicyType"`
// updateStrategy indicates the StatefulSetUpdateStrategy that will be
// employed to update Pods in the StatefulSet when a revision is made to
// Template.
UpdateStrategy StatefulSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,7,opt,name=updateStrategy"`
// 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.
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,8,opt,name=revisionHistoryLimit"`
} }
// StatefulSetStatus represents the current state of a StatefulSet. // StatefulSetStatus represents the current state of a StatefulSet.
type StatefulSetStatus struct { type StatefulSetStatus struct {
// 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.
// +optional // +optional
ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"` ObservedGeneration *int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
// replicas is the number of actual replicas. // replicas is the number of Pods created by the StatefulSet controller.
Replicas int32 `json:"replicas" protobuf:"varint,2,opt,name=replicas"` Replicas int32 `json:"replicas" protobuf:"varint,2,opt,name=replicas"`
// readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.
ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,3,opt,name=readyReplicas"`
// currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by currentRevision.
CurrentReplicas int32 `json:"currentReplicas,omitempty" protobuf:"varint,4,opt,name=currentReplicas"`
// updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version
// indicated by updateRevision.
UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,5,opt,name=updatedReplicas"`
// currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the
// sequence [0,currentReplicas).
CurrentRevision string `json:"currentRevision,omitempty" protobuf:"bytes,6,opt,name=currentRevision"`
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence
// [replicas-updatedReplicas,replicas)
UpdateRevision string `json:"updateRevision,omitempty" protobuf:"bytes,7,opt,name=updateRevision"`
} }
// StatefulSetList is a collection of StatefulSets. // StatefulSetList is a collection of StatefulSets.
......
...@@ -137,6 +137,15 @@ func (DeploymentStrategy) SwaggerDoc() map[string]string { ...@@ -137,6 +137,15 @@ func (DeploymentStrategy) SwaggerDoc() map[string]string {
return map_DeploymentStrategy return map_DeploymentStrategy
} }
var map_PartitionStatefulSetStrategy = map[string]string{
"": "PartitionStatefulSetStrategy contains the parameters used with the PartitionStatefulSetStrategyType.",
"ordinal": "Ordinal indicates the ordinal at which the StatefulSet should be partitioned.",
}
func (PartitionStatefulSetStrategy) SwaggerDoc() map[string]string {
return map_PartitionStatefulSetStrategy
}
var map_RollbackConfig = map[string]string{ var map_RollbackConfig = map[string]string{
"revision": "The revision to rollback to. If set to 0, rollback to the last revision.", "revision": "The revision to rollback to. If set to 0, rollback to the last revision.",
} }
...@@ -212,6 +221,8 @@ var map_StatefulSetSpec = map[string]string{ ...@@ -212,6 +221,8 @@ var map_StatefulSetSpec = map[string]string{
"volumeClaimTemplates": "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.", "volumeClaimTemplates": "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.",
"serviceName": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.", "serviceName": "serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where \"pod-specific-string\" is managed by the StatefulSet controller.",
"podManagementPolicy": "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.", "podManagementPolicy": "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": "updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template.",
"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.",
} }
func (StatefulSetSpec) SwaggerDoc() map[string]string { func (StatefulSetSpec) SwaggerDoc() map[string]string {
...@@ -220,12 +231,27 @@ func (StatefulSetSpec) SwaggerDoc() map[string]string { ...@@ -220,12 +231,27 @@ func (StatefulSetSpec) SwaggerDoc() map[string]string {
var map_StatefulSetStatus = map[string]string{ var map_StatefulSetStatus = map[string]string{
"": "StatefulSetStatus represents the current state of a StatefulSet.", "": "StatefulSetStatus represents the current state of a StatefulSet.",
"observedGeneration": "observedGeneration is the most recent generation observed by this StatefulSet.", "observedGeneration": "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": "replicas is the number of actual replicas.", "replicas": "replicas is the number of Pods created by the StatefulSet controller.",
"readyReplicas": "readyReplicas is the number of Pods created by the StatefulSet controller that have a Ready Condition.",
"currentReplicas": "currentReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by currentRevision.",
"updatedReplicas": "updatedReplicas is the number of Pods created by the StatefulSet controller from the StatefulSet version indicated by updateRevision.",
"currentRevision": "currentRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [0,currentReplicas).",
"updateRevision": "updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence [replicas-updatedReplicas,replicas)",
} }
func (StatefulSetStatus) SwaggerDoc() map[string]string { func (StatefulSetStatus) SwaggerDoc() map[string]string {
return map_StatefulSetStatus return map_StatefulSetStatus
} }
var map_StatefulSetUpdateStrategy = map[string]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.",
"type": "Type indicates the type of the StatefulSetUpdateStrategy.",
"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.",
}
func (StatefulSetUpdateStrategy) SwaggerDoc() map[string]string {
return map_StatefulSetUpdateStrategy
}
// AUTO-GENERATED FUNCTIONS END HERE // AUTO-GENERATED FUNCTIONS END HERE
...@@ -42,6 +42,8 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -42,6 +42,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_apps_ControllerRevision_To_v1beta1_ControllerRevision, Convert_apps_ControllerRevision_To_v1beta1_ControllerRevision,
Convert_v1beta1_ControllerRevisionList_To_apps_ControllerRevisionList, Convert_v1beta1_ControllerRevisionList_To_apps_ControllerRevisionList,
Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList, Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList,
Convert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy,
Convert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy,
Convert_v1beta1_StatefulSet_To_apps_StatefulSet, Convert_v1beta1_StatefulSet_To_apps_StatefulSet,
Convert_apps_StatefulSet_To_v1beta1_StatefulSet, Convert_apps_StatefulSet_To_v1beta1_StatefulSet,
Convert_v1beta1_StatefulSetList_To_apps_StatefulSetList, Convert_v1beta1_StatefulSetList_To_apps_StatefulSetList,
...@@ -50,6 +52,8 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -50,6 +52,8 @@ func RegisterConversions(scheme *runtime.Scheme) error {
Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec, Convert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec,
Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus, Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus,
Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus, Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus,
Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy,
Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy,
) )
} }
...@@ -123,6 +127,26 @@ func Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in *a ...@@ -123,6 +127,26 @@ func Convert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in *a
return autoConvert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in, out, s) return autoConvert_apps_ControllerRevisionList_To_v1beta1_ControllerRevisionList(in, out, s)
} }
func autoConvert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy(in *PartitionStatefulSetStrategy, out *apps.PartitionStatefulSetStrategy, s conversion.Scope) error {
out.Ordinal = in.Ordinal
return nil
}
// Convert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy is an autogenerated conversion function.
func Convert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy(in *PartitionStatefulSetStrategy, out *apps.PartitionStatefulSetStrategy, s conversion.Scope) error {
return autoConvert_v1beta1_PartitionStatefulSetStrategy_To_apps_PartitionStatefulSetStrategy(in, out, s)
}
func autoConvert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy(in *apps.PartitionStatefulSetStrategy, out *PartitionStatefulSetStrategy, s conversion.Scope) error {
out.Ordinal = in.Ordinal
return nil
}
// Convert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy is an autogenerated conversion function.
func Convert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy(in *apps.PartitionStatefulSetStrategy, out *PartitionStatefulSetStrategy, s conversion.Scope) error {
return autoConvert_apps_PartitionStatefulSetStrategy_To_v1beta1_PartitionStatefulSetStrategy(in, out, s)
}
func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error { func autoConvert_v1beta1_StatefulSet_To_apps_StatefulSet(in *StatefulSet, out *apps.StatefulSet, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta out.ObjectMeta = in.ObjectMeta
if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil { if err := Convert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(&in.Spec, &out.Spec, s); err != nil {
...@@ -208,6 +232,10 @@ func autoConvert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSet ...@@ -208,6 +232,10 @@ func autoConvert_v1beta1_StatefulSetSpec_To_apps_StatefulSetSpec(in *StatefulSet
out.VolumeClaimTemplates = *(*[]api.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates)) out.VolumeClaimTemplates = *(*[]api.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates))
out.ServiceName = in.ServiceName out.ServiceName = in.ServiceName
out.PodManagementPolicy = apps.PodManagementPolicyType(in.PodManagementPolicy) out.PodManagementPolicy = apps.PodManagementPolicyType(in.PodManagementPolicy)
if err := Convert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil {
return err
}
out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit))
return nil return nil
} }
...@@ -222,12 +250,21 @@ func autoConvert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.Statef ...@@ -222,12 +250,21 @@ func autoConvert_apps_StatefulSetSpec_To_v1beta1_StatefulSetSpec(in *apps.Statef
out.VolumeClaimTemplates = *(*[]api_v1.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates)) out.VolumeClaimTemplates = *(*[]api_v1.PersistentVolumeClaim)(unsafe.Pointer(&in.VolumeClaimTemplates))
out.ServiceName = in.ServiceName out.ServiceName = in.ServiceName
out.PodManagementPolicy = PodManagementPolicyType(in.PodManagementPolicy) out.PodManagementPolicy = PodManagementPolicyType(in.PodManagementPolicy)
if err := Convert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, s); err != nil {
return err
}
out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit))
return nil return nil
} }
func autoConvert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error { func autoConvert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSetStatus, out *apps.StatefulSetStatus, s conversion.Scope) error {
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
out.Replicas = in.Replicas out.Replicas = in.Replicas
out.ReadyReplicas = in.ReadyReplicas
out.CurrentReplicas = in.CurrentReplicas
out.UpdatedReplicas = in.UpdatedReplicas
out.CurrentRevision = in.CurrentRevision
out.UpdateRevision = in.UpdateRevision
return nil return nil
} }
...@@ -239,6 +276,11 @@ func Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSet ...@@ -239,6 +276,11 @@ func Convert_v1beta1_StatefulSetStatus_To_apps_StatefulSetStatus(in *StatefulSet
func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error {
out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration)) out.ObservedGeneration = (*int64)(unsafe.Pointer(in.ObservedGeneration))
out.Replicas = in.Replicas out.Replicas = in.Replicas
out.ReadyReplicas = in.ReadyReplicas
out.CurrentReplicas = in.CurrentReplicas
out.UpdatedReplicas = in.UpdatedReplicas
out.CurrentRevision = in.CurrentRevision
out.UpdateRevision = in.UpdateRevision
return nil return nil
} }
...@@ -246,3 +288,15 @@ func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.St ...@@ -246,3 +288,15 @@ func autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.St
func Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error { func Convert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in *apps.StatefulSetStatus, out *StatefulSetStatus, s conversion.Scope) error {
return autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in, out, s) return autoConvert_apps_StatefulSetStatus_To_v1beta1_StatefulSetStatus(in, out, s)
} }
func autoConvert_v1beta1_StatefulSetUpdateStrategy_To_apps_StatefulSetUpdateStrategy(in *StatefulSetUpdateStrategy, out *apps.StatefulSetUpdateStrategy, s conversion.Scope) error {
out.Type = apps.StatefulSetUpdateStrategyType(in.Type)
out.Partition = (*apps.PartitionStatefulSetStrategy)(unsafe.Pointer(in.Partition))
return nil
}
func autoConvert_apps_StatefulSetUpdateStrategy_To_v1beta1_StatefulSetUpdateStrategy(in *apps.StatefulSetUpdateStrategy, out *StatefulSetUpdateStrategy, s conversion.Scope) error {
out.Type = StatefulSetUpdateStrategyType(in.Type)
out.Partition = (*PartitionStatefulSetStrategy)(unsafe.Pointer(in.Partition))
return nil
}
...@@ -46,6 +46,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -46,6 +46,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentSpec, InType: reflect.TypeOf(&DeploymentSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentSpec, InType: reflect.TypeOf(&DeploymentSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStatus, InType: reflect.TypeOf(&DeploymentStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStatus, InType: reflect.TypeOf(&DeploymentStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStrategy, InType: reflect.TypeOf(&DeploymentStrategy{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_DeploymentStrategy, InType: reflect.TypeOf(&DeploymentStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_PartitionStatefulSetStrategy, InType: reflect.TypeOf(&PartitionStatefulSetStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollbackConfig, InType: reflect.TypeOf(&RollbackConfig{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollbackConfig, InType: reflect.TypeOf(&RollbackConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollingUpdateDeployment, InType: reflect.TypeOf(&RollingUpdateDeployment{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_RollingUpdateDeployment, InType: reflect.TypeOf(&RollingUpdateDeployment{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Scale, InType: reflect.TypeOf(&Scale{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Scale, InType: reflect.TypeOf(&Scale{})},
...@@ -55,6 +56,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -55,6 +56,7 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_StatefulSetUpdateStrategy, InType: reflect.TypeOf(&StatefulSetUpdateStrategy{})},
) )
} }
...@@ -251,6 +253,16 @@ func DeepCopy_v1beta1_DeploymentStrategy(in interface{}, out interface{}, c *con ...@@ -251,6 +253,16 @@ func DeepCopy_v1beta1_DeploymentStrategy(in interface{}, out interface{}, c *con
} }
} }
// DeepCopy_v1beta1_PartitionStatefulSetStrategy is an autogenerated deepcopy function.
func DeepCopy_v1beta1_PartitionStatefulSetStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PartitionStatefulSetStrategy)
out := out.(*PartitionStatefulSetStrategy)
*out = *in
return nil
}
}
// DeepCopy_v1beta1_RollbackConfig is an autogenerated deepcopy function. // DeepCopy_v1beta1_RollbackConfig is an autogenerated deepcopy function.
func DeepCopy_v1beta1_RollbackConfig(in interface{}, out interface{}, c *conversion.Cloner) error { func DeepCopy_v1beta1_RollbackConfig(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
...@@ -397,6 +409,14 @@ func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conver ...@@ -397,6 +409,14 @@ func DeepCopy_v1beta1_StatefulSetSpec(in interface{}, out interface{}, c *conver
} }
} }
} }
if err := DeepCopy_v1beta1_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, c); err != nil {
return err
}
if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
*out = new(int32)
**out = **in
}
return nil return nil
} }
} }
...@@ -415,3 +435,18 @@ func DeepCopy_v1beta1_StatefulSetStatus(in interface{}, out interface{}, c *conv ...@@ -415,3 +435,18 @@ func DeepCopy_v1beta1_StatefulSetStatus(in interface{}, out interface{}, c *conv
return nil return nil
} }
} }
// DeepCopy_v1beta1_StatefulSetUpdateStrategy is an autogenerated deepcopy function.
func DeepCopy_v1beta1_StatefulSetUpdateStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatefulSetUpdateStrategy)
out := out.(*StatefulSetUpdateStrategy)
*out = *in
if in.Partition != nil {
in, out := &in.Partition, &out.Partition
*out = new(PartitionStatefulSetStrategy)
**out = **in
}
return nil
}
}
...@@ -38,10 +38,12 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -38,10 +38,12 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs( return scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevision, InType: reflect.TypeOf(&ControllerRevision{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevision, InType: reflect.TypeOf(&ControllerRevision{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevisionList, InType: reflect.TypeOf(&ControllerRevisionList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_ControllerRevisionList, InType: reflect.TypeOf(&ControllerRevisionList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_PartitionStatefulSetStrategy, InType: reflect.TypeOf(&PartitionStatefulSetStrategy{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSet, InType: reflect.TypeOf(&StatefulSet{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSet, InType: reflect.TypeOf(&StatefulSet{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetList, InType: reflect.TypeOf(&StatefulSetList{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetSpec, InType: reflect.TypeOf(&StatefulSetSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetStatus, InType: reflect.TypeOf(&StatefulSetStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_apps_StatefulSetUpdateStrategy, InType: reflect.TypeOf(&StatefulSetUpdateStrategy{})},
) )
} }
...@@ -87,6 +89,16 @@ func DeepCopy_apps_ControllerRevisionList(in interface{}, out interface{}, c *co ...@@ -87,6 +89,16 @@ func DeepCopy_apps_ControllerRevisionList(in interface{}, out interface{}, c *co
} }
} }
// DeepCopy_apps_PartitionStatefulSetStrategy is an autogenerated deepcopy function.
func DeepCopy_apps_PartitionStatefulSetStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*PartitionStatefulSetStrategy)
out := out.(*PartitionStatefulSetStrategy)
*out = *in
return nil
}
}
// DeepCopy_apps_StatefulSet is an autogenerated deepcopy function. // DeepCopy_apps_StatefulSet is an autogenerated deepcopy function.
func DeepCopy_apps_StatefulSet(in interface{}, out interface{}, c *conversion.Cloner) error { func DeepCopy_apps_StatefulSet(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
...@@ -153,6 +165,14 @@ func DeepCopy_apps_StatefulSetSpec(in interface{}, out interface{}, c *conversio ...@@ -153,6 +165,14 @@ func DeepCopy_apps_StatefulSetSpec(in interface{}, out interface{}, c *conversio
} }
} }
} }
if err := DeepCopy_apps_StatefulSetUpdateStrategy(&in.UpdateStrategy, &out.UpdateStrategy, c); err != nil {
return err
}
if in.RevisionHistoryLimit != nil {
in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit
*out = new(int32)
**out = **in
}
return nil return nil
} }
} }
...@@ -171,3 +191,18 @@ func DeepCopy_apps_StatefulSetStatus(in interface{}, out interface{}, c *convers ...@@ -171,3 +191,18 @@ func DeepCopy_apps_StatefulSetStatus(in interface{}, out interface{}, c *convers
return nil return nil
} }
} }
// DeepCopy_apps_StatefulSetUpdateStrategy is an autogenerated deepcopy function.
func DeepCopy_apps_StatefulSetUpdateStrategy(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*StatefulSetUpdateStrategy)
out := out.(*StatefulSetUpdateStrategy)
*out = *in
if in.Partition != nil {
in, out := &in.Partition, &out.Partition
*out = new(PartitionStatefulSetStrategy)
**out = **in
}
return nil
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment