[zh] Tidy up and fix links in tasks section (6/10)

This commit is contained in:
Qiming Teng
2020-08-14 15:14:21 +08:00
parent fcd8af988c
commit 2c8a55a6e6
8 changed files with 689 additions and 650 deletions
@@ -4,10 +4,8 @@ content_type: task
---
<!--
---
title: Configure Quotas for API Objects
content_type: task
---
-->
<!-- overview -->
@@ -20,22 +18,14 @@ You specify quotas in a
[ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core)
object.
-->
本文讨论如何为 API 对象配置配额,包括 PersistentVolumeClaims 和 Services。
本文讨论如何为 API 对象配置配额,包括 PersistentVolumeClaim 和 Service。
配额限制了可以在命名空间中创建的特定类型对象的数量。
可以在 [ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core) 对象中指定配额。
可以在 [ResourceQuota](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#resourcequota-v1-core) 对象中指定配额。
## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
<!-- steps -->
<!--
@@ -44,7 +34,6 @@ object.
Create a namespace so that the resources you create in this exercise are
isolated from the rest of your cluster.
-->
## 创建命名空间
创建一个命名空间以便本例中创建的资源和集群中的其余部分相隔离。
@@ -58,7 +47,6 @@ kubectl create namespace quota-object-example
Here is the configuration file for a ResourceQuota object:
-->
## 创建 ResourceQuota
下面是一个 ResourceQuota 对象的配置文件:
@@ -68,17 +56,15 @@ Here is the configuration file for a ResourceQuota object:
<!--
Create the ResourceQuota:
-->
创建 ResourceQuota
创建 ResourceQuota
```shell
kubectl create -f https://k8s.io/examples/admin/resource/quota-objects.yaml --namespace=quota-object-example
kubectl apply -f https://k8s.io/examples/admin/resource/quota-objects.yaml --namespace=quota-object-example
```
<!--
View detailed information about the ResourceQuota:
-->
查看 ResourceQuota 的详细信息:
```shell
@@ -90,9 +76,8 @@ The output shows that in the quota-object-example namespace, there can be at mos
one PersistentVolumeClaim, at most two Services of type LoadBalancer, and no Services
of type NodePort.
-->
输出结果表明在 quota-object-example 命名空间中,至多只能有一个 PersistentVolumeClaim最多两个 LoadBalancer 类型的服务,不能有 NodePort 类型的服务。
输出结果表明在 quota-object-example 命名空间中,至多只能有一个 PersistentVolumeClaim
最多两个 LoadBalancer 类型的服务,不能有 NodePort 类型的服务。
```yaml
status:
@@ -111,7 +96,6 @@ status:
Here is the configuration file for a PersistentVolumeClaim object:
-->
## 创建 PersistentVolumeClaim
下面是一个 PersistentVolumeClaim 对象的配置文件:
@@ -121,17 +105,15 @@ Here is the configuration file for a PersistentVolumeClaim object:
<!--
Create the PersistentVolumeClaim:
-->
创建 PersistentVolumeClaim
```shell
kubectl create -f https://k8s.io/examples/admin/resource/quota-objects-pvc.yaml --namespace=quota-object-example
kubectl apply -f https://k8s.io/examples/admin/resource/quota-objects-pvc.yaml --namespace=quota-object-example
```
<!--
Verify that the PersistentVolumeClaim was created:
-->
确认已创建完 PersistentVolumeClaim
```shell
@@ -141,10 +123,9 @@ kubectl get persistentvolumeclaims --namespace=quota-object-example
<!--
The output shows that the PersistentVolumeClaim exists and has status Pending:
-->
输出信息表明 PersistentVolumeClaim 存在并且处于 Pending 状态:
```shell
```
NAME STATUS
pvc-quota-demo Pending
```
@@ -154,7 +135,6 @@ pvc-quota-demo Pending
Here is the configuration file for a second PersistentVolumeClaim:
-->
## 尝试创建第二个 PersistentVolumeClaim
下面是第二个 PersistentVolumeClaim 的配置文件:
@@ -164,7 +144,6 @@ Here is the configuration file for a second PersistentVolumeClaim:
<!--
Attempt to create the second PersistentVolumeClaim:
-->
尝试创建第二个 PersistentVolumeClaim
```shell
@@ -174,23 +153,21 @@ kubectl create -f https://k8s.io/examples/admin/resource/quota-objects-pvc-2.yam
The output shows that the second PersistentVolumeClaim was not created,
because it would have exceeded the quota for the namespace.
-->
输出信息表明第二个 PersistentVolumeClaim 没有创建成功,因为这会超出命名空间的配额。
```
persistentvolumeclaims "pvc-quota-demo-2" is forbidden:
exceeded quota: object-quota-demo, requested: persistentvolumeclaims=1,
used: persistentvolumeclaims=1, limited: persistentvolumeclaims=1
```
<!--
## Notes
These are the strings used to identify API resources that can be constrained
by quotas:
-->
## 注意事项
## 说明
下面这些字符串可被用来标识那些能被配额限制的 API 资源:
@@ -212,20 +189,16 @@ by quotas:
Delete your namespace:
-->
## 清理
删除的命名空间:
删除的命名空间:
```shell
kubectl delete namespace quota-object-example
```
## {{% heading "whatsnext" %}}
<!--
### For cluster administrators
@@ -244,17 +217,12 @@ kubectl delete namespace quota-object-example
### 集群管理员参考
* [为命名空间配置默认的内存请求和限制](/docs/tasks/administer-cluster/memory-default-namespace/)
* [为命名空间配置默认的 CPU 请求和限制](/docs/tasks/administer-cluster/cpu-default-namespace/)
* [为命名空间配置内存的最小和最大限制](/docs/tasks/administer-cluster/memory-constraint-namespace/)
* [为命名空间配置 CPU 的最小和最大限制](/docs/tasks/administer-cluster/cpu-constraint-namespace/)
* [为命名空间配置 CPU 和内存配额](/docs/tasks/administer-cluster/quota-memory-cpu-namespace/)
* [为命名空间配置 Pod 配额](/docs/tasks/administer-cluster/quota-pod-namespace/)
* [为命名空间配置默认的内存请求和限制](/zh/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/)
* [为命名空间配置默认的 CPU 请求和限制](/zh/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/)
* [为命名空间配置内存的最小和最大限制](/zh/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/)
* [为命名空间配置 CPU 的最小和最大限制](/zh/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/)
* [为命名空间配置 CPU 和内存配额](/zh/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/)
* [为命名空间配置 Pod 配额](/zh/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace/)
<!--
### For app developers
@@ -268,9 +236,7 @@ kubectl delete namespace quota-object-example
### 应用开发者参考
* [为容器和 Pod 分配内存资源](/docs/tasks/configure-pod-container/assign-memory-resource/)
* [为容器和 Pod 分配 CPU 资源](/docs/tasks/configure-pod-container/assign-cpu-resource/)
* [为 Pod 配置服务质量](/docs/tasks/configure-pod-container/quality-service-pod/)
* [为容器和 Pod 分配内存资源](/zh/docs/tasks/configure-pod-container/assign-memory-resource/)
* [为容器和 Pod 分配 CPU 资源](/zh/docs/tasks/configure-pod-container/assign-cpu-resource/)
* [为 Pod 配置服务质量](/zh/docs/tasks/configure-pod-container/quality-service-pod/)