StatefulSet 1.9 updates. (#6550)
* updates sts concept and tutorials to use 1.9 apps/v1 * Update statefulset.md * clarify pod name label
This commit is contained in:
committed by
Zach Corleissen
parent
2d09a2a7b4
commit
74b4cb69a4
@@ -10,8 +10,11 @@ title: StatefulSets
|
||||
---
|
||||
|
||||
{% capture overview %}
|
||||
**StatefulSet is the workload API object used to manage stateful applications.
|
||||
StatefulSets are beta in 1.8.**
|
||||
|
||||
StatefulSet is the workload API object used to manage stateful applications.
|
||||
|
||||
**Note:** StatefulSets are stable (GA) in 1.9.
|
||||
{: .note}
|
||||
|
||||
{% glossary_definition term_id="statefulset" length="all" %}
|
||||
{% endcapture %}
|
||||
@@ -66,7 +69,7 @@ spec:
|
||||
selector:
|
||||
app: nginx
|
||||
---
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: web
|
||||
@@ -152,6 +155,12 @@ PersistentVolume Claims. Note that, the PersistentVolumes associated with the
|
||||
Pods' PersistentVolume Claims are not deleted when the Pods, or StatefulSet are deleted.
|
||||
This must be done manually.
|
||||
|
||||
### Pod Name Label
|
||||
|
||||
When the StatefulSet controller creates a Pod, it adds a label, `statefulset.kubernetes.io/pod-name`,
|
||||
that is set to the name of the Pod. This label allows you to attach a Service to a specific Pod in
|
||||
the StatefulSet.
|
||||
|
||||
## Deployment and Scaling Guarantees
|
||||
|
||||
* For a StatefulSet with N replicas, when Pods are being deployed, they are created sequentially, in order from {0..N-1}.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mysql
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
apiVersion: apps/v1beta2
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: cassandra
|
||||
|
||||
@@ -13,7 +13,7 @@ spec:
|
||||
selector:
|
||||
app: nginx
|
||||
---
|
||||
apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: web
|
||||
|
||||
@@ -13,7 +13,7 @@ spec:
|
||||
selector:
|
||||
app: nginx
|
||||
---
|
||||
apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: web
|
||||
|
||||
@@ -38,7 +38,7 @@ spec:
|
||||
app: zk
|
||||
maxUnavailable: 1
|
||||
---
|
||||
apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: zk
|
||||
|
||||
Reference in New Issue
Block a user