Merge pull request #26208 from ydFu/update-replicatset
Update workloads/controllers/replicationcontroller.md and replicaset.md
This commit is contained in:
commit
b8d1814389
|
@ -472,15 +472,15 @@ curl -X DELETE 'localhost:8080/apis/apps/v1/namespaces/default/replicasets/fron
|
||||||
<!--
|
<!--
|
||||||
### Deleting just a ReplicaSet
|
### Deleting just a ReplicaSet
|
||||||
|
|
||||||
You can delete a ReplicaSet without affecting any of its pods using [`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete) with the `-cascade=false` option.
|
You can delete a ReplicaSet without affecting any of its Pods using [`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete) with the `--cascade=orphan` option.
|
||||||
When using the REST API or the `client-go` library, you must set `propagationPolicy` to `Orphan`.
|
When using the REST API or the `client-go` library, you must set `propagationPolicy` to `Orphan`.
|
||||||
For example:
|
For example:
|
||||||
-->
|
-->
|
||||||
### 只删除 ReplicaSet
|
### 只删除 ReplicaSet
|
||||||
|
|
||||||
你可以只删除 ReplicaSet 而不影响它的 Pod,方法是使用
|
你可以只删除 ReplicaSet 而不影响它的 Pods,方法是使用
|
||||||
[`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete)
|
[`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete)
|
||||||
命令并设置 `--cascade=false` 选项。
|
命令并设置 `--cascade=orphan` 选项。
|
||||||
|
|
||||||
当使用 REST API 或 `client-go` 库时,你必须将 `propagationPolicy` 设置为 `Orphan`。
|
当使用 REST API 或 `client-go` 库时,你必须将 `propagationPolicy` 设置为 `Orphan`。
|
||||||
例如:
|
例如:
|
||||||
|
|
|
@ -97,6 +97,10 @@ Run the example job by downloading the example file and then running this comman
|
||||||
```shell
|
```shell
|
||||||
kubectl apply -f https://k8s.io/examples/controllers/replication.yaml
|
kubectl apply -f https://k8s.io/examples/controllers/replication.yaml
|
||||||
```
|
```
|
||||||
|
<!--
|
||||||
|
The output is similar to this:
|
||||||
|
-->
|
||||||
|
输出类似于:
|
||||||
```
|
```
|
||||||
replicationcontroller/nginx created
|
replicationcontroller/nginx created
|
||||||
```
|
```
|
||||||
|
@ -109,6 +113,10 @@ Check on the status of the ReplicationController using this command:
|
||||||
```shell
|
```shell
|
||||||
kubectl describe replicationcontrollers/nginx
|
kubectl describe replicationcontrollers/nginx
|
||||||
```
|
```
|
||||||
|
<!--
|
||||||
|
The output is similar to this:
|
||||||
|
-->
|
||||||
|
输出类似于:
|
||||||
```
|
```
|
||||||
Name: nginx
|
Name: nginx
|
||||||
Namespace: default
|
Namespace: default
|
||||||
|
@ -155,6 +163,10 @@ pods=$(kubectl get pods --selector=app=nginx --output=jsonpath={.items..metadata
|
||||||
echo $pods
|
echo $pods
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The output is similar to this:
|
||||||
|
-->
|
||||||
|
输出类似于:
|
||||||
```
|
```
|
||||||
nginx-3ntk0 nginx-4ok8v nginx-qrm3m
|
nginx-3ntk0 nginx-4ok8v nginx-qrm3m
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue