From 4126ccaad0c242147c341c0fa202d47991dcd991 Mon Sep 17 00:00:00 2001 From: song Date: Wed, 18 May 2022 01:28:23 +0800 Subject: [PATCH] update manage-resources documentation Signed-off-by: song --- .../manage-resources/cpu-constraint-namespace.md | 11 +++++++---- .../manage-resources/memory-constraint-namespace.md | 9 +++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md index 6c52dea6e1..e0255eb2bd 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md @@ -27,7 +27,7 @@ in the namespace. You must have access to create namespaces in your cluster. -Your cluster must have at least 1.0 CPU available for use to run the task examples. +Each node in your cluster must have at least 1.0 CPU available for Pods. See [meaning of CPU](/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu) to learn what Kubernetes means by “1 CPU”. @@ -45,7 +45,7 @@ kubectl create namespace constraints-cpu-example ## Create a LimitRange and a Pod -Here's an example manifest for a LimitRange: +Here's a manifest for an example {{< glossary_tooltip text="LimitRange" term_id="limitrange" >}}: {{< codenew file="admin/resource/cpu-constraints.yaml" >}} @@ -96,7 +96,7 @@ on these resources, the two values must be the same. Here's a manifest for a Pod that has one container. The container manifest specifies a CPU request of 500 millicpu and a CPU limit of 800 millicpu. These satisfy the -minimum and maximum CPU constraints imposed by the LimitRange. +minimum and maximum CPU constraints imposed by the LimitRange for this namespace. {{< codenew file="admin/resource/cpu-constraints-pod.yaml" >}} @@ -214,7 +214,10 @@ applied the [default CPU request and limit](/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/) from the LimitRange for this namespace. -At this point, your Pod might be running or it might not be running. Recall that a prerequisite for this task is that your cluster must have at least 1 CPU available for use. If each of your Nodes has only 1 CPU, then there might not be enough allocatable CPU on any Node to accommodate a request of 800 millicpu. If you happen to be using Nodes with 2 CPU, then you probably have enough CPU to accommodate the 800 millicpu request. +At this point, your Pod may or may not be running. Recall that a prerequisite for +this task is that your Nodes must have at least 1 CPU available for use. If each of your Nodes has only 1 CPU, +then there might not be enough allocatable CPU on any Node to accommodate a request of 800 millicpu. +If you happen to be using Nodes with 2 CPU, then you probably have enough CPU to accommodate the 800 millicpu request. Delete your Pod: diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md index 3efd899075..9d2d707cb0 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md @@ -11,8 +11,9 @@ description: >- This page shows how to set minimum and maximum values for memory used by containers -running in a namespace. You specify minimum and maximum memory values in a -[LimitRange](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#limitrange-v1-core) +running in a {{< glossary_tooltip text="namespace" term_id="namespace" >}}. +You specify minimum and maximum memory values in a +[LimitRange](/docs/reference/kubernetes-api/policy-resources/limit-range-v1/) object. If a Pod does not meet the constraints imposed by the LimitRange, it cannot be created in the namespace. @@ -76,8 +77,8 @@ file for the LimitRange, they were created automatically. Now whenever you define a Pod within the constraints-mem-example namespace, Kubernetes performs these steps: -* If any container in that Pod does not specify its own memory request and limit, assign -the default memory request and limit to that container. +* If any container in that Pod does not specify its own memory request and limit, +the control plane assigns the default memory request and limit to that container. * Verify that every container in that Pod requests at least 500 MiB of memory.