Merge pull request #26208 from ydFu/update-replicatset

Update workloads/controllers/replicationcontroller.md and replicaset.md
This commit is contained in:
Kubernetes Prow Robot 2021-01-24 18:04:53 -08:00 committed by GitHub
commit b8d1814389
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -472,15 +472,15 @@ curl -X DELETE 'localhost:8080/apis/apps/v1/namespaces/default/replicasets/fron
<!--
### 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`.
For example:
-->
### 只删除 ReplicaSet
你可以只删除 ReplicaSet 而不影响它的 Pod方法是使用
你可以只删除 ReplicaSet 而不影响它的 Pods,方法是使用
[`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete)
命令并设置 `--cascade=false` 选项。
命令并设置 `--cascade=orphan` 选项。
当使用 REST API 或 `client-go` 库时,你必须将 `propagationPolicy` 设置为 `Orphan`
例如:

View File

@ -97,6 +97,10 @@ Run the example job by downloading the example file and then running this comman
```shell
kubectl apply -f https://k8s.io/examples/controllers/replication.yaml
```
<!--
The output is similar to this:
-->
输出类似于:
```
replicationcontroller/nginx created
```
@ -109,6 +113,10 @@ Check on the status of the ReplicationController using this command:
```shell
kubectl describe replicationcontrollers/nginx
```
<!--
The output is similar to this:
-->
输出类似于:
```
Name: nginx
Namespace: default
@ -155,6 +163,10 @@ pods=$(kubectl get pods --selector=app=nginx --output=jsonpath={.items..metadata
echo $pods
```
<!--
The output is similar to this:
-->
输出类似于:
```
nginx-3ntk0 nginx-4ok8v nginx-qrm3m
```