<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 管理namespace中的資源配額 當用多個團隊或者用戶共用同一個集群的時候難免會有資源競爭的情況發生,這時候就需要對不同團隊或用戶的資源使用配額做出限制。 ## 開啟資源配額限制功能 目前有兩種資源分配管理相關的控制策略插件 `ResourceQuota` 和 `LimitRange`。 要啟用它們只要 API Server 的啟動配置的 `KUBE_ADMISSION_CONTROL` 參數中加入了 `ResourceQuota` 的設置,這樣就給集群開啟了資源配額限制功能,加入 `LimitRange` 可以用來限制一個資源申請的范圍限制,參考 [為 namesapce 配置默認的內存請求與限額](https://k8smeetup.github.io/docs/tasks/administer-cluster/memory-default-namespace/) 和 [在 namespace 中配置默認的CPU請求與限額](https://k8smeetup.github.io/docs/tasks/administer-cluster/cpu-default-namespace/)。 兩種控制策略的作用范圍都是對于某一 namespace,`ResourceQuota` 用來限制 namespace 中所有的 Pod 占用的總的資源 request 和 limit,而 `LimitRange` 是用來設置 namespace 中 Pod 的默認的資源 request 和 limit 值。 資源配額分為三種類型: - 計算資源配額 - 存儲資源配額 - 對象數量配額 關于資源配額的詳細信息請參考 kubernetes 官方文檔 [資源配額](https://k8smeetup.github.io/docs/concepts/policy/resource-quotas/)。 ## 示例 我們為 `spark-cluster` 這個 namespace 設置 `ResouceQuota` 和 `LimitRange`。 以下 yaml 文件可以在 [kubernetes-handbook](https://github.com/rootsongjc/kubernetes-handbook) 的 `manifests/spark-with-kubernetes-native-scheduler` 目錄下找到。 ### 配置計算資源配額 配置文件:`spark-compute-resources.yaml` ```yaml apiVersion: v1 kind: ResourceQuota metadata: name: compute-resources namespace: spark-cluster spec: hard: pods: "20" requests.cpu: "20" requests.memory: 100Gi limits.cpu: "40" limits.memory: 200Gi ``` 要想查看該配置只要執行: ```bash kubectl -n spark-cluster describe resourcequota compute-resources ``` ### 配置對象數量限制 配置文件:`spark-object-counts.yaml` ```yaml apiVersion: v1 kind: ResourceQuota metadata: name: object-counts namespace: spark-cluster spec: hard: configmaps: "10" persistentvolumeclaims: "4" replicationcontrollers: "20" secrets: "10" services: "10" services.loadbalancers: "2" ``` ### 配置CPU和內存LimitRange 配置文件:`spark-limit-range.yaml` ```yaml apiVersion: v1 kind: LimitRange metadata: name: mem-limit-range spec: limits: - default: memory: 50Gi cpu: 5 defaultRequest: memory: 1Gi cpu: 1 type: Container ``` - `default` 即 limit 的值 - `defaultRequest` 即 request 的值 ## 參考 - [資源配額](https://k8smeetup.github.io/docs/concepts/policy/resource-quotas/) - [為命名空間配置默認的內存請求與限額](https://k8smeetup.github.io/docs/tasks/administer-cluster/memory-default-namespace/) - [在命名空間中配置默認的CPU請求與限額](https://k8smeetup.github.io/docs/tasks/administer-cluster/cpu-default-namespace/)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看