diff --git a/content/en/docs/project-administration/container-limit-ranges.md b/content/en/docs/project-administration/container-limit-ranges.md new file mode 100644 index 000000000..cb5c7addf --- /dev/null +++ b/content/en/docs/project-administration/container-limit-ranges.md @@ -0,0 +1,59 @@ +--- +title: "Container Limit Ranges" +keywords: 'Kubernetes, KubeSphere, resource, quotas, limits, requests, limit ranges, containers' +description: 'How to set default container limit ranges.' +linkTitle: "Container Limit Ranges" +weight: 13400 +--- + +A container can use as much CPU and memory as set by [the resource quota for a project](../../workspace-administration/project-quotas/). At the same time, KubeSphere uses requests and limits to control resource (e.g. CPU and memory) usage for a container, also known as [LimitRanges](https://kubernetes.io/docs/concepts/policy/limit-range/) in Kubernetes. Requests make sure the container can get the resources it needs as they are specifically guaranteed and reserved. On the contrary, limits ensure that container can never use resources above a certain value. + +When you create a workload, such as a Deployment, you configure resource requests and limits for the container. To make these request and limit fields pre-populated with values, you can set default limit ranges. + +This tutorial demonstrates how to set default limit ranges for containers in a project. + +## Prerequisites + +You have an available workspace, a project and an account (`project-admin`). The account must have the `admin` role at the project level. For more information, see [Create Workspace, Project, Account and Role](../../quick-start/create-workspace-and-project/). + +## Set Default Limit Ranges + +1. Log in to the console as `project-admin` and go to a project. On the **Overview** page, you can see default limit ranges remain unset if the project is newly created. Click **Set** to configure limit ranges. + + ![limit-ranges](/images/docs/project-administration/container-limit-ranges/limit-ranges.jpg) + +2. In the dialog that appears, you can see that KubeSphere does not set any requests or limits by default. To set requests and limits to control CPU and memory resources, use the slider to move to a desired value or input numbers directly. Leaving a field blank means you do not set any requests or limits. + + ![default-limit-range](/images/docs/project-administration/container-limit-ranges/default-limit-range.jpg) + + {{< notice note >}} + + The limit can never be lower than the request. + + {{}} + +3. Click **OK** to finish setting limit ranges. + +4. Go to **Basic Info** in **Project Settings**, and you can see default limit ranges for containers in a project. + + ![view-limit-ranges](/images/docs/project-administration/container-limit-ranges/view-limit-ranges.jpg) + +5. To change default limit ranges, click **Manage Project** on the **Basic Info** page and select **Edit Resource Default Request**. + + ![change-limit-range](/images/docs/project-administration/container-limit-ranges/change-limit-range.jpg) + +6. Change limit ranges directly in the dialog and click **OK**. + +7. When you create a workload, requests and limits of the container will be pre-populated with values. + + ![workload-values](/images/docs/project-administration/container-limit-ranges/workload-values.jpg) + + {{< notice note >}} + + For more information, see **Resource Request** in [Container Image Settings](../../project-user-guide/application-workloads/container-image-settings/). + + {{}} + +## See Also + +[Project Quotas](../../workspace-administration/project-quotas/) \ No newline at end of file diff --git a/content/en/docs/project-administration/project-quota.md b/content/en/docs/project-administration/project-quota.md deleted file mode 100644 index 53f1a44d4..000000000 --- a/content/en/docs/project-administration/project-quota.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Project Quotas" -keywords: 'kubernetes, docker, helm, jenkins, istio, prometheus' -description: 'Project Quotas' - -linkTitle: "Project Quotas" -weight: 13400 ---- - -TBD diff --git a/content/en/docs/workspace-administration/project-quotas.md b/content/en/docs/workspace-administration/project-quotas.md new file mode 100644 index 000000000..0f80f78c6 --- /dev/null +++ b/content/en/docs/workspace-administration/project-quotas.md @@ -0,0 +1,59 @@ +--- +title: "Project Quotas" +keywords: 'KubeSphere, Kubernetes, projects, quotas, resources, requests, limits' +description: 'How to set project quotas.' +linkTitle: "Project Quotas" +weight: 9600 +--- + +KubeSphere uses requests and limits to control resource (e.g. CPU and memory) usage in a project, also known as [ResourceQuotas](https://kubernetes.io/docs/concepts/policy/resource-quotas/) in Kubernetes. Requests make sure a project can get the resources it needs as they are specifically guaranteed and reserved. On the contrary, limits ensure that a project can never use resources above a certain value. + +Besides CPU and memory, you can also set resource quotas for other objects separately such as Pods, [Deployments](../../project-user-guide/application-workloads/deployments/), [Jobs](../../project-user-guide/application-workloads/jobs/), [Services](../../project-user-guide/application-workloads/services/) and [ConfigMaps](../../project-user-guide/configuration/configmaps/) in a project. + +This tutorial demonstrates how to configure quotas for a project. + +## Prerequisites + +You have an available workspace, a project and an account (`ws-admin`). The account must have the `admin` role at the workspace level. For more information, see [Create Workspace, Project, Account and Role](../../quick-start/create-workspace-and-project/). + +{{< notice note >}} + +If you use the account `project-admin` (an account of the `admin` role at the project level), you can set project quotas as well for a new project (i.e. its quotas remain unset). However, `project-admin` cannot change project quotas once they are set. Generally, it is the responsibility of `ws-admin` to set limits and requests for a project. `project-admin` is responsible for [setting limit ranges](../../project-administration/container-limit-ranges/) for containers in a project. + +{{}} + +## Set Project Quotas + +1. Log in to the console as `ws-admin` and go to a project. On the **Overview** page, you can see project quotas remain unset if the project is newly created. Click **Set** to configure quotas. + + ![project-quotas](/images/docs/workspace-administration/project-quotas/project-quotas.jpg) + +2. In the dialog that appears, you can see that KubeSphere does not set any requests or limits for a project by default. To set requests and limits to control CPU and memory resources, use the slider to move to a desired value or input numbers directly. Leaving a field blank means you do not set any requests or limits. + + ![set-project-quotas](/images/docs/workspace-administration/project-quotas/set-project-quotas.jpg) + + {{< notice note >}} + + The limit can never be lower than the request. + + {{}} + +3. To set quotas for other resources, click **Add quota item** and select an object from the list. + + ![set-other-resouce-quotas](/images/docs/workspace-administration/project-quotas/set-other-resouce-quotas.jpg) + +4. Click **OK** to finish setting quotas. + +5. Go to **Basic Info** in **Project Settings**, and you can see all resource quotas for the project. + + ![resrouce-quotas](/images/docs/workspace-administration/project-quotas/resrouce-quotas.jpg) + +6. To change project quotas, click **Manage Project** on the **Basic Info** page and select **Edit Quota**. + + ![edit-quotas](/images/docs/workspace-administration/project-quotas/edit-quotas.jpg) + +7. Change project quotas directly on the **Project Quota** page and click **OK**. + +## See Also + +[Container Limit Ranges](../../project-administration/container-limit-ranges/) \ No newline at end of file diff --git a/static/images/docs/project-administration/container-limit-ranges/change-limit-range.jpg b/static/images/docs/project-administration/container-limit-ranges/change-limit-range.jpg new file mode 100644 index 000000000..c4047dad6 Binary files /dev/null and b/static/images/docs/project-administration/container-limit-ranges/change-limit-range.jpg differ diff --git a/static/images/docs/project-administration/container-limit-ranges/default-limit-range.jpg b/static/images/docs/project-administration/container-limit-ranges/default-limit-range.jpg new file mode 100644 index 000000000..dc0efaea0 Binary files /dev/null and b/static/images/docs/project-administration/container-limit-ranges/default-limit-range.jpg differ diff --git a/static/images/docs/project-administration/container-limit-ranges/limit-ranges.jpg b/static/images/docs/project-administration/container-limit-ranges/limit-ranges.jpg new file mode 100644 index 000000000..8013c54c3 Binary files /dev/null and b/static/images/docs/project-administration/container-limit-ranges/limit-ranges.jpg differ diff --git a/static/images/docs/project-administration/container-limit-ranges/view-limit-ranges.jpg b/static/images/docs/project-administration/container-limit-ranges/view-limit-ranges.jpg new file mode 100644 index 000000000..874a67a27 Binary files /dev/null and b/static/images/docs/project-administration/container-limit-ranges/view-limit-ranges.jpg differ diff --git a/static/images/docs/project-administration/container-limit-ranges/workload-values.jpg b/static/images/docs/project-administration/container-limit-ranges/workload-values.jpg new file mode 100644 index 000000000..385bcabf4 Binary files /dev/null and b/static/images/docs/project-administration/container-limit-ranges/workload-values.jpg differ diff --git a/static/images/docs/workspace-administration/project-quotas/edit-quotas.jpg b/static/images/docs/workspace-administration/project-quotas/edit-quotas.jpg new file mode 100644 index 000000000..61f4a1ac6 Binary files /dev/null and b/static/images/docs/workspace-administration/project-quotas/edit-quotas.jpg differ diff --git a/static/images/docs/workspace-administration/project-quotas/project-quotas.jpg b/static/images/docs/workspace-administration/project-quotas/project-quotas.jpg new file mode 100644 index 000000000..521890be7 Binary files /dev/null and b/static/images/docs/workspace-administration/project-quotas/project-quotas.jpg differ diff --git a/static/images/docs/workspace-administration/project-quotas/resrouce-quotas.jpg b/static/images/docs/workspace-administration/project-quotas/resrouce-quotas.jpg new file mode 100644 index 000000000..9059f6dfb Binary files /dev/null and b/static/images/docs/workspace-administration/project-quotas/resrouce-quotas.jpg differ diff --git a/static/images/docs/workspace-administration/project-quotas/set-other-resouce-quotas.jpg b/static/images/docs/workspace-administration/project-quotas/set-other-resouce-quotas.jpg new file mode 100644 index 000000000..4fa6ca202 Binary files /dev/null and b/static/images/docs/workspace-administration/project-quotas/set-other-resouce-quotas.jpg differ diff --git a/static/images/docs/workspace-administration/project-quotas/set-project-quotas.jpg b/static/images/docs/workspace-administration/project-quotas/set-project-quotas.jpg new file mode 100644 index 000000000..dee2529f8 Binary files /dev/null and b/static/images/docs/workspace-administration/project-quotas/set-project-quotas.jpg differ