Merge pull request #22473 from JarHMJ/patch-2

Update deployment.md: fix format error
This commit is contained in:
Kubernetes Prow Robot
2020-07-14 23:34:38 -07:00
committed by GitHub
@@ -1208,7 +1208,6 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
```shell ```shell
kubectl get rs kubectl get rs
``` ```
<!-- <!--
The output is similar to this: The output is similar to this:
--> -->
@@ -1387,198 +1386,6 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
nginx-3926361531 3 3 3 28s nginx-3926361531 3 3 3 28s
``` ```
<!--
You can pause a Deployment before triggering one or more updates and then resume it. This allows you to
apply multiple fixes in between pausing and resuming without triggering unnecessary rollouts.
-->
可以在触发一个或多个更新之前暂停 Deployment ,然后继续它。这允许在暂停和恢复之间应用多个修补程序,而不会触发不必要的 Deployment 。
<!--
* For example, with a Deployment that was just created:
Get the Deployment details:
-->
* 例如,对于一个刚刚创建的 Deployment
获取 Deployment 信息:
```shell
kubectl get deploy
```
<!--
The output is similar to this:
-->
输出:
```
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
nginx 3 3 3 3 1m
```
<!--
Get the rollout status:
-->
获取 Deployment 状态:
```shell
kubectl get rs
```
<!--
The output is similar to this:
-->
输出:
```
NAME DESIRED CURRENT READY AGE
nginx-2142116321 3 3 3 1m
```
<!--
* Pause by running the following command:
-->
使用如下指令中断运行:
```shell
kubectl rollout pause deployment.v1.apps/nginx-deployment
```
<!--
The output is similar to this:
-->
输出:
```
deployment.apps/nginx-deployment paused
```
<!--
* Then update the image of the Deployment:
-->
* 然后更新 Deployment 镜像:
```shell
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.9.1
```
<!--
The output is similar to this:
-->
输出:
```
deployment.apps/nginx-deployment image updated
```
<!--
* Notice that no new rollout started:
-->
* 注意没有新的展开:
```shell
kubectl rollout history deployment.v1.apps/nginx-deployment
```
<!--
The output is similar to this:
-->
输出:
```
deployments "nginx"
REVISION CHANGE-CAUSE
1 <none>
```
<!--
* Get the rollout status to ensure that the Deployment is updates successfully:
-->
* 获取展开状态确保 Deployment 更新已经成功:
```shell
kubectl get rs
```
<!--
The output is similar to this:
-->
输出:
```
NAME DESIRED CURRENT READY AGE
nginx-2142116321 3 3 3 2m
```
<!--
* You can make as many updates as you wish, for example, update the resources that will be used:
-->
* 更新是很容易的,例如,可以这样更新使用到的资源:
```shell
kubectl set resources deployment.v1.apps/nginx-deployment -c=nginx --limits=cpu=200m,memory=512Mi
```
<!--
The output is similar to this:
-->
输出:
```
deployment.apps/nginx-deployment resource requirements updated
```
<!--
The initial state of the Deployment prior to pausing it will continue its function, but new updates to
the Deployment will not have any effect as long as the Deployment is paused.
-->
暂停 Deployment 之前的初始状态将继续其功能,但新的更新只要暂停 Deployment Deployment 就不会产生任何效果。
<!--
* Eventually, resume the Deployment and observe a new ReplicaSet coming up with all the new updates:
-->
* 最后,恢复 Deployment 并观察新的 ReplicaSet ,并更新所有新的更新:
```shell
kubectl rollout resume deployment.v1.apps/nginx-deployment
```
<!--
The output is similar to this:
-->
输出:
```
deployment.apps/nginx-deployment resumed
```
<!--
* Watch the status of the rollout until it's done.
-->
* 观察展开的状态,直到完成。
```shell
kubectl get rs -w
```
<!--
The output is similar to this:
-->
输出:
```
NAME DESIRED CURRENT READY AGE
nginx-2142116321 2 2 2 2m
nginx-3926361531 2 2 0 6s
nginx-3926361531 2 2 1 18s
nginx-2142116321 1 2 2 2m
nginx-2142116321 1 2 2 2m
nginx-3926361531 3 2 1 18s
nginx-3926361531 3 2 1 18s
nginx-2142116321 1 1 1 2m
nginx-3926361531 3 3 1 18s
nginx-3926361531 3 3 2 19s
nginx-2142116321 0 1 1 2m
nginx-2142116321 0 1 1 2m
nginx-2142116321 0 0 0 2m
nginx-3926361531 3 3 3 20s
```
<!--
* Get the status of the latest rollout:
-->
* 获取最近展开的状态:
```shell
kubectl get rs
```
<!--
The output is similar to this:
-->
输出:
```
NAME DESIRED CURRENT READY AGE
nginx-2142116321 0 0 0 2m
nginx-3926361531 3 3 3 28s
```
{{< note >}} {{< note >}}
<!-- <!--
You cannot rollback a paused Deployment until you resume it. You cannot rollback a paused Deployment until you resume it.