配置工作负载升级策略
<p class="shortdesc">配置工作负载的升级策略,当工作负载重新部署或更新升级时,控制器将依据相应策略更新Pod。本文介绍如何配置工作负载升级策略。</p>
<section class="section attention" id="workload_upgrade__attention_w3j_y2w_n5b"><div class="tasklabel"><h2 class="doc-tairway">注意事项</h2></div>
<p class="p">若升级策略为全部重建(Recreate),升级部署时将直接删除所有Pod,再启动相同数量的新Pod。该策略会导致业务中断,请谨慎使用。</p>
</section>
<section id="workload_upgrade__steps_z25_x2w_n5b"><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps" id="workload_upgrade__steps_z25_x2w_n5b"><li class="li step stepexpand">
<span class="ph cmd">登录<a class="xref" href="https://www.ocftcloud.com/console/pks/cluster" target="_blank" rel="external noopener">容器服务CaaS Serverless集群控制台</a>。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">单击左侧导航栏<span class="ph uicontrol">集群</span>,进入<span class="ph uicontrol">集群列表</span>页面。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">在目标地域中,单击目标集群名称,进入<span class="ph uicontrol">集群信息。</span></span>
</li><li class="li step stepexpand">
<span class="ph cmd">在集群管理页左侧导航栏单击<span class="ph menucascade"><span class="ph uicontrol">工作负载</span><abbr> > </abbr><span class="ph uicontrol"> 无状态</span></span>,进入<span class="ph uicontrol">无状态</span>工作负载页面。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">在目标工作负载<span class="ph uicontrol">操作</span>列,单击<span class="ph menucascade"><span class="ph uicontrol">更多操作 </span><abbr> > </abbr><span class="ph uicontrol"> 升级策略</span></span>。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">在升级策略页面,根据如下说明完成配置。</span>
<div class="itemgroup info">
<div class="p">
<img class="image" id="workload_upgrade__image_v2h_t4g_gsb" src="https://obs-cn-shanghai.fincloud.pinganyun.com/pacloud/20222012160841-1a282b43980c.png" width="600">
</div>
<table class="table" id="workload_upgrade__table_bbw_1k5_rvb"><caption></caption><colgroup><col><col></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="workload_upgrade__table_bbw_1k5_rvb__entry__1">
<p class="p">配置项</p>
</th>
<th class="entry" id="workload_upgrade__table_bbw_1k5_rvb__entry__2">
<p class="p">说明</p>
</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__1 ">
<p class="p">更新方式</p>
</td>
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__2 ">
<p class="p">设置工作负载更新的策略:</p>
<p class="p"><strong class="ph b">滚动更新(Rolling Update)</strong>:分批次逐步替换工作负载的Pod实例。</p>
<p class="p"><strong class="ph b">全部重建(Recreat)</strong>:先删除旧工作负载的全部Pod,再启动相同数量的Pod。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__1 ">更新策略</td>
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__2 ">
<div class="p">更新方式为<strong class="ph b">滚动更新</strong>时,需设置滚动更新Pod的替换策略。<div class="note note note_note" id="workload_upgrade__note_bfd_fk5_rvb"><span class="note__title">说明:</span> 自定义策略遵循先启动新Pod,再删除旧Pod策略。</div></div>
</td>
</tr>
<tr class="row">
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__1 ">
<p class="p">策略配置</p>
</td>
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__2 ">
<p class="p">更新方式为<strong class="ph b">滚动更新</strong>时,需配置Pod最大不可用数量和Pod最大超过期望数量:</p>
<ul class="ul" id="workload_upgrade__ul_cbw_1k5_rvb">
<li class="li"><strong class="ph b">Pod最大不可用数量</strong>:用于指定更新过程中不可用Pod的个数上限。</li>
<li class="li"><strong class="ph b">Pod最大超过期望数量</strong>:用于指定可以创建的超出期望Pod个数的Pod数量。</li>
</ul>
<div class="note note note_note" id="workload_upgrade__note_gqq_ck5_rvb"><span class="note__title">说明:</span> Pod最大不可用数量与Pod最大超过期望数量不可同时为0。</div>
</td>
</tr>
<tr class="row">
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__1 ">
<p class="p">最小准备时长</p>
</td>
<td class="entry" headers="workload_upgrade__table_bbw_1k5_rvb__entry__2 ">
<p class="p">设置Pod的最小准备时长。指在Pod被视为就绪之前,Pod中的容器至少需要运行的时长,默认为 0。</p>
</td>
</tr>
</tbody></table>
</div>
</li><li class="li step stepexpand">
<span class="ph cmd">单击<span class="ph uicontrol">确定</span>。</span>
</li></ol></section>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!