|
77 | 77 | app: nginx # has to match .spec.template.metadata.labels
|
78 | 78 | serviceName: "nginx"
|
79 | 79 | replicas: 3 # by default is 1
|
| 80 | + minReadySeconds: 10 # by default is 0 |
80 | 81 | template:
|
81 | 82 | metadata:
|
82 | 83 | labels:
|
@@ -112,9 +113,24 @@ In the above example:
|
112 | 113 | The name of a StatefulSet object must be a valid
|
113 | 114 | [DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
|
114 | 115 |
|
115 |
| -## Pod Selector |
| 116 | +### Pod Selector |
116 | 117 |
|
117 |
| -You must set the `.spec.selector` field of a StatefulSet to match the labels of its `.spec.template.metadata.labels`. Prior to Kubernetes 1.8, the `.spec.selector` field was defaulted when omitted. In 1.8 and later versions, failing to specify a matching Pod Selector will result in a validation error during StatefulSet creation. |
| 118 | +You must set the `.spec.selector` field of a StatefulSet to match the labels of its `.spec.template.metadata.labels`. In 1.8 and later versions, failing to specify a matching Pod Selector will result in a validation error during StatefulSet creation. |
| 119 | + |
| 120 | +### Volume Claim Templates |
| 121 | + |
| 122 | +You can set the `.spec.volumeClaimTemplates` which can provide stable storage using [PersistentVolumes](/docs/concepts/storage/persistent-volumes/) provisioned by a PersistentVolume Provisioner. |
| 123 | + |
| 124 | + |
| 125 | +### Minimum ready seconds |
| 126 | + |
| 127 | +{{< feature-state for_k8s_version="v1.23" state="beta" >}} |
| 128 | + |
| 129 | +`.spec.minReadySeconds` is an optional field that specifies the minimum number of seconds for which a newly |
| 130 | +created Pod should be ready without any of its containers crashing, for it to be considered available. |
| 131 | +Please note that this feature is beta and enabled by default. Please opt out by unsetting the StatefulSetMinReadySeconds flag, if you don't |
| 132 | +want this feature to be enabled. This field defaults to 0 (the Pod will be considered |
| 133 | +available as soon as it is ready). To learn more about when a Pod is considered ready, see [Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes). |
118 | 134 |
|
119 | 135 | ## Pod Identity
|
120 | 136 |
|
@@ -284,16 +300,6 @@ After reverting the template, you must also delete any Pods that StatefulSet had
|
284 | 300 | already attempted to run with the bad configuration.
|
285 | 301 | StatefulSet will then begin to recreate the Pods using the reverted template.
|
286 | 302 |
|
287 |
| -### Minimum ready seconds |
288 |
| - |
289 |
| -{{< feature-state for_k8s_version="v1.22" state="alpha" >}} |
290 |
| - |
291 |
| -`.spec.minReadySeconds` is an optional field that specifies the minimum number of seconds for which a newly |
292 |
| -created Pod should be ready without any of its containers crashing, for it to be considered available. |
293 |
| -This defaults to 0 (the Pod will be considered available as soon as it is ready). To learn more about when |
294 |
| -a Pod is considered ready, see [Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes). |
295 |
| - |
296 |
| -Please note that this field only works if you enable the `StatefulSetMinReadySeconds` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/). |
297 | 303 |
|
298 | 304 | ## {{% heading "whatsnext" %}}
|
299 | 305 |
|
|
0 commit comments