Merge pull request #831 from Sherlock113/resourcequota
Add project quota and limit range ranges
|
|
@ -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.
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
{{< notice note >}}
|
||||
|
||||
The limit can never be lower than the request.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
5. To change default limit ranges, click **Manage Project** on the **Basic Info** page and select **Edit Resource Default Request**.
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
{{< notice note >}}
|
||||
|
||||
For more information, see **Resource Request** in [Container Image Settings](../../project-user-guide/application-workloads/container-image-settings/).
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
## See Also
|
||||
|
||||
[Project Quotas](../../workspace-administration/project-quotas/)
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
title: "Project Quotas"
|
||||
keywords: 'kubernetes, docker, helm, jenkins, istio, prometheus'
|
||||
description: 'Project Quotas'
|
||||
|
||||
linkTitle: "Project Quotas"
|
||||
weight: 13400
|
||||
---
|
||||
|
||||
TBD
|
||||
|
|
@ -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.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
## 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.
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
{{< notice note >}}
|
||||
|
||||
The limit can never be lower than the request.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
3. To set quotas for other resources, click **Add quota item** and select an object from the list.
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
6. To change project quotas, click **Manage Project** on the **Basic Info** page and select **Edit Quota**.
|
||||
|
||||

|
||||
|
||||
7. Change project quotas directly on the **Project Quota** page and click **OK**.
|
||||
|
||||
## See Also
|
||||
|
||||
[Container Limit Ranges](../../project-administration/container-limit-ranges/)
|
||||
|
After Width: | Height: | Size: 328 KiB |
|
After Width: | Height: | Size: 263 KiB |
|
After Width: | Height: | Size: 349 KiB |
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 359 KiB |
|
After Width: | Height: | Size: 354 KiB |
|
After Width: | Height: | Size: 370 KiB |
|
After Width: | Height: | Size: 296 KiB |
|
After Width: | Height: | Size: 245 KiB |
|
After Width: | Height: | Size: 247 KiB |