191 lines
8.6 KiB
HTML
191 lines
8.6 KiB
HTML
---
|
||
title: 执行滚动更新
|
||
weight: 10
|
||
---
|
||
|
||
<!--
|
||
---
|
||
title: Performing a Rolling Update
|
||
weight: 10
|
||
---
|
||
-->
|
||
|
||
<!DOCTYPE html>
|
||
|
||
<html lang="en">
|
||
|
||
<body>
|
||
|
||
<link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet">
|
||
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:300,400,700" rel="stylesheet">
|
||
|
||
<div class="layout" id="top">
|
||
|
||
<main class="content">
|
||
|
||
<div class="row">
|
||
|
||
<div class="col-md-8">
|
||
<h3>Objectives</h3>
|
||
<ul>
|
||
<!--
|
||
<li>Perform a rolling update using kubectl.</li>
|
||
-->
|
||
<li>使用 kubectl 执行滚动更新。</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="col-md-8">
|
||
<!--
|
||
<h3>Updating an application</h3>
|
||
-->
|
||
<h3>更新应用程序</h3>
|
||
|
||
<!--
|
||
<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>
|
||
-->
|
||
<p>用户希望应用程序始终可用,而开发人员则需要每天多次部署它们的新版本。在 Kubernetes 中,这些是通过滚动更新(Rolling Updates)完成的。 <b>滚动更新</b> 允许通过使用新的实例逐步更新 Pod 实例,零停机进行 Deployment 更新。新的 Pod 将在具有可用资源的节点上进行调度。</p>
|
||
|
||
<!--
|
||
<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).
|
||
In Kubernetes, updates are versioned and any Deployment update can be reverted to previous (stable) version.</p>
|
||
-->
|
||
<p>在前面的模块中,我们将应用程序扩展为运行多个实例。这是在不影响应用程序可用性的情况下执行更新的要求。默认情况下,更新期间不可用的 pod 的最大值和可以创建的新 pod 数都是 1。这两个选项都可以配置为(pod)数字或百分比。
|
||
在 Kubernetes 中,更新是经过版本控制的,任何 Deployment 更新都可以恢复到以前的(稳定)版本。</p>
|
||
|
||
|
||
</div>
|
||
<div class="col-md-4">
|
||
<div class="content__box content__box_lined">
|
||
<!--
|
||
<h3>Summary:</h3>
|
||
-->
|
||
<h3>摘要:</h3>
|
||
<ul>
|
||
<!--
|
||
<li>Updating an app</li>
|
||
-->
|
||
<li>更新应用</li>
|
||
</ul>
|
||
</div>
|
||
<div class="content__box content__box_fill">
|
||
<!--
|
||
<p><i>Rolling updates allow Deployments' update to take place with zero downtime by incrementally updating Pods instances with new ones. </i></p>
|
||
-->
|
||
<p><i>滚动更新允许通过使用新的实例逐步更新 Pod 实例从而实现 Deployments 更新,停机时间为零。</i></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<br>
|
||
|
||
<div class="row">
|
||
<div class="col-md-8">
|
||
<!--
|
||
<h2 style="color: #3771e3;">Rolling updates overview</h2>
|
||
-->
|
||
<h2 style="color: #3771e3;">滚动更新概述</h2>
|
||
</div>
|
||
</div>
|
||
<div class="row">
|
||
<div class="col-md-1"></div>
|
||
<div class="col-md-8">
|
||
<div id="myCarousel" class="carousel" data-ride="carousel" data-interval="3000">
|
||
<ol class="carousel-indicators">
|
||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||
<li data-target="#myCarousel" data-slide-to="1"></li>
|
||
<li data-target="#myCarousel" data-slide-to="2"></li>
|
||
<li data-target="#myCarousel" data-slide-to="3"></li>
|
||
</ol>
|
||
<div class="carousel-inner" role="listbox">
|
||
<div class="item carousel-item active">
|
||
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates1.svg" >
|
||
</div>
|
||
|
||
<div class="item carousel-item">
|
||
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates2.svg">
|
||
</div>
|
||
|
||
<div class="item carousel-item">
|
||
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates3.svg">
|
||
</div>
|
||
|
||
<div class="item carousel-item">
|
||
<img src="/docs/tutorials/kubernetes-basics/public/images/module_06_rollingupdates4.svg">
|
||
</div>
|
||
</div>
|
||
|
||
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
|
||
<span class="sr-only ">Previous</span>
|
||
</a>
|
||
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
|
||
<span class="sr-only">Next</span>
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<br>
|
||
|
||
<div class="row">
|
||
<div class="col-md-8">
|
||
<!--
|
||
<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>
|
||
-->
|
||
<p>与应用程序扩展类似,如果公开了 Deployment,服务将在更新期间仅对可用的 pod 进行负载均衡。可用 Pod 是应用程序用户可用的实例。</p>
|
||
|
||
<!--
|
||
<p>Rolling updates allow the following actions:</p>
|
||
-->
|
||
<p>滚动更新允许以下操作:</p>
|
||
<ul>
|
||
<!--
|
||
<li>Promote an application from one environment to another (via container image updates)</li>
|
||
<li>Rollback to previous versions</li>
|
||
<li>Continuous Integration and Continuous Delivery of applications with zero downtime</li>
|
||
-->
|
||
<li>将应用程序从一个环境提升到另一个环境(通过容器镜像更新)</li>
|
||
<li>回滚到以前的版本</li>
|
||
<li>持续集成和持续交付应用程序,无需停机</li>
|
||
</ul>
|
||
|
||
</div>
|
||
<div class="col-md-4">
|
||
<div class="content__box content__box_fill">
|
||
<!--
|
||
<p><i>If a Deployment is exposed publicly, the Service will load-balance the traffic only to available Pods during the update. </i></p>
|
||
-->
|
||
<p><i>如果 Deployment 是公开的,则服务将仅在更新期间对可用的 pod 进行负载均衡。 </i></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<br>
|
||
|
||
<div class="row">
|
||
<div class="col-md-8">
|
||
<!--
|
||
<p> In the following interactive tutorial, we'll update our application to a new version, and also perform a rollback.</p>
|
||
-->
|
||
<p> 在下面的交互式教程中,我们将应用程序更新为新版本,并执行回滚。</p>
|
||
|
||
</div>
|
||
</div>
|
||
<br>
|
||
|
||
<div class="row">
|
||
<div class="col-md-12">
|
||
<!--
|
||
<a class="btn btn-lg btn-success" href="/docs/tutorials/kubernetes-basics/update/update-interactive/" role="button">Start Interactive Tutorial <span class="btn__next">›</span></a>
|
||
-->
|
||
<a class="btn btn-lg btn-success" href="/zh/docs/tutorials/kubernetes-basics/update/update-interactive/" role="button">启动交互教程<span class="btn__next">›</span></a>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</main>
|
||
|
||
</div>
|
||
|
||
</body>
|
||
</html>
|