创建HPA
<p class="shortdesc">HPA可以根据设置的策略,自动扩缩Pod数量。本文主要介绍如何创建HPA。</p>
<section class="section prereq" id="createH__prereq_pbn_4g2_vvb"><div class="tasklabel"><h2 class="doc-tairway">前提条件</h2></div>
<ul class="ul" id="createH__d99e20">
<li class="li">您已成功创建管理集群,可参考<a class="xref" href="/ssr/help/compute/caas/Operation_Guide.Cluster_Management.Master_Cluster.create" target="_blank" rel="external noopener">创建管理集群</a>。</li>
<li class="li">您已成功创建业务集群,可参考<a class="xref" href="/ssr/help/compute/caas/Operation_Guide.Cluster_Management.worker.create" target="_blank" rel="external noopener">创建业务集群</a>。</li>
<li class="li">您已成功创建无状态应用,可参考<a class="xref" href="/ssr/help/compute/caas/Operation_Guide.Service_Management.Deployment.create" target="_blank" rel="external noopener">创建无状态应用</a>。</li>
</ul>
</section>
<section class="section attention" id="createH__attention_fbr_jgt_fvb"><div class="tasklabel"><h2 class="doc-tairway">注意事项</h2></div>
<p class="p">在实际使用环境中,应用会根据CPU负载进行自动扩展。您也可在测试环境中验证弹性伸缩,通过给Pod进行CPU压测,可以发现Pod在半分钟内即可完成水平的扩展。</p>
</section>
<section id="createH__steps_cj3_2gt_fvb"><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps" id="createH__steps_cj3_2gt_fvb"><li class="li step stepexpand">
<span class="ph cmd">登录<a class="xref" href="https://www.ocftcloud.com/console/caas/overview" target="_blank" rel="external noopener">容器服务CaaS控制台</a>。</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">HPA</span></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">根据如下信息,创建HPA。</span>
<div class="itemgroup info">
<table class="table frame-all" id="createH__table_dx5_qcs_fvb"><caption></caption><colgroup><col style="width:32.57328990228013%"><col style="width:67.42671009771986%"></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="createH__table_dx5_qcs_fvb__entry__1">
<p class="p">配置项</p>
</th>
<th class="entry" id="createH__table_dx5_qcs_fvb__entry__2">
<p class="p">说明</p>
</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">地域</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">选择创建HPA的地域。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">所属集群</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">选择HPA所属的集群。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">HPA名称</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">设置HPA的名称。</p>
<div class="note note note_note"><span class="note__title">说明:</span> 名称长度支持1~32个字符,只能包含小写字母、数字及分隔符(“-“)。必须以小写字母开头,以数字或小写字母结尾。</div>
</td>
</tr>
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">最小实例数</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">触发扩容时,扩展的最小实例数。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">最大实例数</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">触发扩容时,扩展的最大实例数。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">模板CPU利用率%</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">当Pod的CPU使用率达到设置的值时,触发扩容操作。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__1 ">
<p class="p">选择应用</p>
</td>
<td class="entry" headers="createH__table_dx5_qcs_fvb__entry__2 ">
<p class="p">选择需要创建HPA的服务。</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>
<section class="section result" id="createH__result_dj3_2gt_fvb"><div class="tasklabel"><h2 class="doc-tairway">执行结果</h2></div>
<p class="p">在<span class="keyword wintitle">HPA</span>页面,可以看到已成功创建的HPA。</p>
</section>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!