设置资源配额和资源限制
<p class="shortdesc">您可通过设置命名空间的资源配额和资源限制,来管理命名空间CPU、内存、Pod数量等资源的使用额度。本文主要介绍如何设置命名空间的资源配额和资源限制。</p>
<section class="section prereq" id="resource_limits__prereq_q1z_wdc_gsb"><div class="tasklabel"><h2 class="doc-tairway">前提条件</h2></div>
<p class="p">您已成功创建命名空间,可参考<a class="xref" href="/ssr/help/management/PKS/Serverless.user_guide.namespace.create_namespace" target="_blank" rel="external noopener">创建命名空间</a>。</p>
</section>
<section class="section attention" id="resource_limits__attention_zgf_22w_n5b"><div class="tasklabel"><h2 class="doc-tairway">注意事项</h2></div>
<ul class="ul" id="resource_limits__ul_bg1_1yt_rvb">
<li class="li">系统命名空间,如kube-system、kube-public、kube-node-lease,不支持资源限制操作。</li>
<li class="li">对命名空间设置资源配额(Resource Quota)后,创建Pod时需指定容器CPU及内存的资源限制,如未指定则默认为命名空间资源限制(Limit
Range)。</li>
</ul>
</section>
<section id="resource_limits__steps_or5_d2w_n5b"><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps" id="resource_limits__steps_or5_d2w_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 uicontrol">命名空间</span>,进入命名空间页面。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">在目标命名空间<span class="ph uicontrol">操作</span>列,单击<span class="ph uicontrol">资源限制</span>,进入<span class="ph uicontrol">命名空间资源限制</span>页面。您可以对命名空间的资源配额及资源限制进行设置,然后单击<span class="ph uicontrol">确定</span>。</span>
<div class="itemgroup info">
<ul class="ul" id="resource_limits__ul_x2z_12c_gsb">
<li class="li">
<span class="ph uicontrol">资源配额</span>
<table class="table" id="resource_limits__table_p1z_pzt_rvb"><caption></caption><colgroup><col><col></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="resource_limits__table_p1z_pzt_rvb__entry__1">配置项</th>
<th class="entry" id="resource_limits__table_p1z_pzt_rvb__entry__2">说明</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">CPU</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下CPU的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">内存</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下内存的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">存储空间</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下存储空间的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">存储声明数量</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下存储声明数量的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">Pod数量</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下Pod数量的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">Service数量</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下Service数量的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">配置文件数量</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下配置文件数量的配额。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__1 ">
<p class="p">密钥数量</p>
</td>
<td class="entry" headers="resource_limits__table_p1z_pzt_rvb__entry__2 ">
<p class="p">限制命名空间下密钥数量的配额。</p>
</td>
</tr>
</tbody></table></li>
<li class="li">
<span class="ph uicontrol">资源限制</span>
<table class="table" id="resource_limits__table_c2r_xzt_rvb"><caption></caption><colgroup><col><col></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="resource_limits__table_c2r_xzt_rvb__entry__1">配置项</th>
<th class="entry" id="resource_limits__table_c2r_xzt_rvb__entry__2"><strong class="ph b">说明</strong></th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__1 ">
<p class="p">CPU资源请求</p>
</td>
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__2 ">
<p class="p">为命名空间下容器设置CPU请求默认值。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__1 ">
<p class="p">CPU资源限制</p>
</td>
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__2 ">
<p class="p">为命名空间下容器设置CPU限制默认值。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__1 ">
<p class="p">内存资源请求</p>
</td>
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__2 ">
<p class="p">为命名空间下容器设置内存请求默认值。</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__1 ">
<p class="p">内存资源限制</p>
</td>
<td class="entry" headers="resource_limits__table_c2r_xzt_rvb__entry__2 ">
<p class="p">为命名空间下容器设置内存限制默认值。</p>
</td>
</tr>
</tbody></table></li>
</ul>
</div>
</li></ol></section>
<section class="section result" id="resource_limits__result_pr5_d2w_n5b"><div class="tasklabel"><h2 class="doc-tairway">执行结果</h2></div>
<ul class="ul" id="resource_limits__ul_qr5_d2w_n5b">
<li class="li">页面上方提示编辑配额成功。</li>
<li class="li">在命名空间列表,单击命名空间名称进入命名空间详情页,在<span class="ph uicontrol">资源配额</span>和<span class="ph uicontrol">资源限制</span>区域可查看到配置信息已更新。</li>
</ul>
</section>
提交成功!非常感谢您的反馈,我们会继续努力做到更好!