diff --git a/content/zh-cn/docs/concepts/policy/resource-quotas.md b/content/zh-cn/docs/concepts/policy/resource-quotas.md index d7ddb004da..dd16499e68 100644 --- a/content/zh-cn/docs/concepts/policy/resource-quotas.md +++ b/content/zh-cn/docs/concepts/policy/resource-quotas.md @@ -6,7 +6,6 @@ api_metadata: content_type: concept weight: 20 --- - -你可以在[查看和设置配额](#viewing-and-setting-quotas)节查看更多示例。 +你可以在[查看和设置配额](#viewing-and-setting-quotas)一节查看更多示例。 -仅当配额规范中的 `scopeSelector` 字段选择到某 Pod 时,配额机制才会匹配和计量 Pod 的资源消耗。 +仅当配额规约中的 `scopeSelector` 字段选择到某 Pod 时,配额机制才会匹配和计量 Pod 的资源消耗。 -将以下 YAML 保存到文件 `quota.yml` 中。 +将以下 YAML 保存到文件 `quota.yaml` 中。 -```yaml -apiVersion: v1 -kind: List -items: -- apiVersion: v1 - kind: ResourceQuota - metadata: - name: pods-high - spec: - hard: - cpu: "1000" - memory: 200Gi - pods: "10" - scopeSelector: - matchExpressions: - - operator: In - scopeName: PriorityClass - values: ["high"] -- apiVersion: v1 - kind: ResourceQuota - metadata: - name: pods-medium - spec: - hard: - cpu: "10" - memory: 20Gi - pods: "10" - scopeSelector: - matchExpressions: - - operator: In - scopeName: PriorityClass - values: ["medium"] -- apiVersion: v1 - kind: ResourceQuota - metadata: - name: pods-low - spec: - hard: - cpu: "5" - memory: 10Gi - pods: "10" - scopeSelector: - matchExpressions: - - operator: In - scopeName: PriorityClass - values: ["low"] -``` +{{% code_sample file="policy/quota.yaml" %}} 创建优先级为 "high" 的 Pod。 -将以下 YAML 保存到文件 `high-priority-pod.yml` 中。 +将以下 YAML 保存到文件 `high-priority-pod.yaml` 中。 -```yaml -apiVersion: v1 -kind: Pod -metadata: - name: high-priority -spec: - containers: - - name: high-priority - image: ubuntu - command: ["/bin/sh"] - args: ["-c", "while true; do echo hello; sleep 10;done"] - resources: - requests: - memory: "10Gi" - cpu: "500m" - limits: - memory: "10Gi" - cpu: "500m" - priorityClassName: high -``` +{{% code_sample file="policy/high-priority-pod.yaml" %}}