From 9270ebfa5ac8433cb1feecd2ed40b01ca3ad6091 Mon Sep 17 00:00:00 2001 From: Qiming Date: Sun, 1 Dec 2019 13:17:04 +0800 Subject: [PATCH] Tweak StatefulSet concept page for YAML rendering (#17891) for: #17792 --- .../concepts/workloads/controllers/statefulset.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/content/en/docs/concepts/workloads/controllers/statefulset.md b/content/en/docs/concepts/workloads/controllers/statefulset.md index 205e72bc63..4519cb4bec 100644 --- a/content/en/docs/concepts/workloads/controllers/statefulset.md +++ b/content/en/docs/concepts/workloads/controllers/statefulset.md @@ -49,11 +49,8 @@ that provides a set of stateless replicas. [manual intervention to repair](#forced-rollback). ## Components -The example below demonstrates the components of a StatefulSet. -* A Headless Service, named nginx, is used to control the network domain. -* The StatefulSet, named web, has a Spec that indicates that 3 replicas of the nginx container will be launched in unique Pods. -* The volumeClaimTemplates will provide stable storage using [PersistentVolumes](/docs/concepts/storage/persistent-volumes/) provisioned by a PersistentVolume Provisioner. +The example below demonstrates the components of a StatefulSet. ```yaml apiVersion: v1 @@ -106,6 +103,12 @@ spec: storage: 1Gi ``` +In the above example: + +* A Headless Service, named `nginx`, is used to control the network domain. +* The StatefulSet, named `web`, has a Spec that indicates that 3 replicas of the nginx container will be launched in unique Pods. +* The `volumeClaimTemplates` will provide stable storage using [PersistentVolumes](/docs/concepts/storage/persistent-volumes/) provisioned by a PersistentVolume Provisioner. + ## Pod Selector 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.