committed by
Andrew Chen
parent
0f2d91e27d
commit
501656585e
@@ -65,7 +65,7 @@ control the domain of the StatefulSet, `web`.
|
|||||||
Download the example above, and save it to a file named `web.yaml`
|
Download the example above, and save it to a file named `web.yaml`
|
||||||
|
|
||||||
You will need to use two terminal windows. In the first terminal, use
|
You will need to use two terminal windows. In the first terminal, use
|
||||||
[`kubectl get`](/docs/user-guide/kubectl/kubectl_get/) to watch the creation
|
[`kubectl get`](/docs/user-guide/kubectl/v1.6/#get) to watch the creation
|
||||||
of the StatefulSet's Pods.
|
of the StatefulSet's Pods.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -73,7 +73,7 @@ kubectl get pods -w -l app=nginx
|
|||||||
```
|
```
|
||||||
|
|
||||||
In the second terminal, use
|
In the second terminal, use
|
||||||
[`kubectl create`](/docs/user-guide/kubectl/kubectl_create/) to create the
|
[`kubectl create`](/docs/user-guide/kubectl/v1.6/#create) to create the
|
||||||
Headless Service and StatefulSet defined in `web.yaml`.
|
Headless Service and StatefulSet defined in `web.yaml`.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -145,7 +145,7 @@ replicas, it creates two Pods, `web-0` and `web-1`.
|
|||||||
|
|
||||||
### Using Stable Network Identities
|
### Using Stable Network Identities
|
||||||
Each Pod has a stable hostname based on its ordinal index. Use
|
Each Pod has a stable hostname based on its ordinal index. Use
|
||||||
[`kubectl exec`](/docs/user-guide/kubectl/kubectl_exec/) to execute the
|
[`kubectl exec`](/docs/user-guide/kubectl/v1.6/#exec) to execute the
|
||||||
`hostname` command in each Pod.
|
`hostname` command in each Pod.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -154,7 +154,7 @@ web-0
|
|||||||
web-1
|
web-1
|
||||||
```
|
```
|
||||||
|
|
||||||
Use [`kubectl run`](/docs/user-guide/kubectl/kubectl_run/) to execute
|
Use [`kubectl run`](/docs/user-guide/kubectl/v1.6/#run) to execute
|
||||||
a container that provides the `nslookup` command from the `dnsutils` package.
|
a container that provides the `nslookup` command from the `dnsutils` package.
|
||||||
Using `nslookup` on the Pods' hostnames, you can examine their in-cluster DNS
|
Using `nslookup` on the Pods' hostnames, you can examine their in-cluster DNS
|
||||||
addresses.
|
addresses.
|
||||||
@@ -186,7 +186,7 @@ In one terminal, watch the StatefulSet's Pods.
|
|||||||
kubectl get pod -w -l app=nginx
|
kubectl get pod -w -l app=nginx
|
||||||
```
|
```
|
||||||
In a second terminal, use
|
In a second terminal, use
|
||||||
[`kubectl delete`](/docs/user-guide/kubectl/kubectl_delete/) to delete all
|
[`kubectl delete`](/docs/user-guide/kubectl/v1.6/#delete) to delete all
|
||||||
the Pods in the StatefulSet.
|
the Pods in the StatefulSet.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -339,8 +339,8 @@ appropriate mount points.
|
|||||||
## Scaling a StatefulSet
|
## Scaling a StatefulSet
|
||||||
Scaling a StatefulSet refers to increasing or decreasing the number of replicas.
|
Scaling a StatefulSet refers to increasing or decreasing the number of replicas.
|
||||||
This is accomplished by updating the `replicas` field. You can use either
|
This is accomplished by updating the `replicas` field. You can use either
|
||||||
[`kubectl scale`](/docs/user-guide/kubectl/kubectl_scale/) or
|
[`kubectl scale`](/docs/user-guide/kubectl/v1.6/#scale) or
|
||||||
[`kubectl patch`](/docs/user-guide/kubectl/kubectl_patch/) to scale a Stateful
|
[`kubectl patch`](/docs/user-guide/kubectl/v1.6/#patch) to scale a Stateful
|
||||||
Set.
|
Set.
|
||||||
|
|
||||||
### Scaling Up
|
### Scaling Up
|
||||||
@@ -555,7 +555,7 @@ In one terminal window, watch the Pods in the StatefulSet.
|
|||||||
kubectl get pods -w -l app=nginx
|
kubectl get pods -w -l app=nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
Use [`kubectl delete`](/docs/user-guide/kubectl/kubectl_delete/) to delete the
|
Use [`kubectl delete`](/docs/user-guide/kubectl/v1.6/#delete) to delete the
|
||||||
StatefulSet. Make sure to supply the `--cascade=false` parameter to the
|
StatefulSet. Make sure to supply the `--cascade=false` parameter to the
|
||||||
command. This parameter tells Kubernetes to only delete the StatefulSet, and to
|
command. This parameter tells Kubernetes to only delete the StatefulSet, and to
|
||||||
not delete any of its Pods.
|
not delete any of its Pods.
|
||||||
|
|||||||
Reference in New Issue
Block a user