You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Users expect applications to be available all the time and developers are expected to deploy new versions of them several times a day. In Kubernetes this is done with rolling updates. <b>Rolling updates</b> allow Deployments' update to take place with zero downtime by incrementally updating Pods instances with new ones. The new Pods will be scheduled on Nodes with available resources.</p>
47
48
-->
48
-
<p>用户希望应用程序始终可用,而开发人员则需要每天多次部署它们的新版本。在 Kubernetes 中,这些是通过滚动更新(Rolling Updates)完成的。 <b>滚动更新</b> 允许通过使用新的实例逐步更新 Pod 实例,零停机进行 Deployment 更新。新的 Pod 将在具有可用资源的节点上进行调度。</p>
49
-
49
+
<p>用户希望应用程序始终可用,而开发人员则需要每天多次部署它们的新版本。
50
+
在 Kubernetes 中,这些是通过滚动更新(Rolling Updates)完成的。
51
+
<b>滚动更新</b> 允许通过使用新的实例逐步更新 Pod 实例,实现零停机的 Deployment 更新。
52
+
新的 Pod 将被调度到具有可用资源的节点上。</p>
53
+
50
54
<!--
51
55
<p>In the previous module we scaled our application to run multiple instances. This is a requirement for performing updates without affecting application availability. By default, the maximum number of Pods that can be unavailable during the update and the maximum number of new Pods that can be created, is one. Both options can be configured to either numbers or percentages (of Pods).
52
-
In Kubernetes, updates are versioned and any Deployment update can be reverted to previous (stable) version.</p>
56
+
In Kubernetes, updates are versioned and any Deployment update can be reverted to a previous (stable) version.</p>
53
57
-->
54
-
<p>在前面的模块中,我们将应用程序扩展为运行多个实例。这是在不影响应用程序可用性的情况下执行更新的要求。默认情况下,更新期间不可用的 pod 的最大值和可以创建的新 pod 数都是 1。这两个选项都可以配置为(pod)数字或百分比。
<p>Similar to application Scaling, if a Deployment is exposed publicly, the Service will load-balance the traffic only to available Pods during the update. An available Pod is an instance that is available to the users of the application.</p>
134
-
-->
135
-
<p>与应用程序扩展类似,如果 Deployment 是公开的,服务将在更新期间仅对可用的 pod 进行负载均衡。可用 Pod 是应用程序用户可用的实例。</p>
<p>To update the image of the application to version 2, use the <code>set image</code> subcommand, followed by the deployment name and the new image version:</p>
<p><code><b>kubectl set image deployments/kubernetes-bootcamp kubernetes-bootcamp=jocatalin/kubernetes-bootcamp:v2</b></code></p>
209
+
<!--
210
+
<p>The command notified the Deployment to use a different image for your app and initiated a rolling update. Check the status of the new Pods, and view the old one terminating with the <code>get pods</code> subcommand:</p>
211
+
-->
212
+
<p>此命令通知 Deployment 为应用程序使用不同的镜像,并启动滚动更新。
213
+
要检查新 Pod 的状态,并查看旧 Pod 的终止状况,请使用 <code>get pods</code> 子命令:</p>
214
+
<p><code><b>kubectl get pods</b></code></p>
215
+
</div>
216
+
</div>
217
+
<divclass="row">
218
+
<divclass="col-md-12">
219
+
<!-- <h3>Step 2: Verify an update</h3> -->
220
+
<h3>第二步:验证更新</h3>
221
+
<!--
222
+
<p>First, check that the app is running. To find the exposed IP address and port, run the <code>describe service</code> command:</p>
223
+
-->
224
+
<p>首先,检查应用是否正在运行。要查找应用暴露的 IP 地址和端口,请运行 <code>describe services</code> 子命令:</p>
<p>In the <code>Events</code> section of the output for the affected Pods, notice that the <code>v10</code> image version did not exist in the repository.</p>
285
+
<p>To roll back the deployment to your last working version, use the <code>rollout undo</code> subcommand:</p>
<p>The <code>rollout undo</code> command reverts the deployment to the previous known state (v2 of the image). Updates are versioned and you can revert to any previously known state of a Deployment.</p>
293
+
<p>Use the <code>get pods</code> subcommand to list the Pods again:</p>
0 commit comments