KubeSphere uses Kubernetes requests and limits to control resource (for example, CPU and memory) usage in a project, also known as 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, Jobs, Services, and ConfigMaps in a project.
This tutorial demonstrates how to configure quotas for a project.
You have an available workspace, a project and a user (
ws-admin). The user must have the
admin role at the workspace level. For more information, see Create Workspaces, Projects, Users and Roles.
project-admin(a user of the
adminrole at the project level), you can set project quotas as well for a new project (i.e. its quotas remain unset). However,
project-admincannot change project quotas once they are set. Generally, it is the responsibility of
ws-adminto set limits and requests for a project.
project-adminis responsible for setting limit ranges for containers in a project.
Set Project Quotas
Log in to the console as
ws-adminand go to a project. On the Overview page, you can see project quotas remain unset if the project is newly created. Click Edit Quotas to configure quotas.
In the displayed dialog box, you can see that KubeSphere does not set any requests or limits for a project by default. To set limits to control CPU and memory resources, use the slider to move to a desired value or enter numbers directly. Leaving a field blank means you do not set any requests or limits.
NoteThe limit can never be lower than the request.
To set quotas for other resources, click Add under Project Resource Quotas, and then select a resource or enter a recource name and set a quota.
Click OK to finish setting quotas.
Go to Basic Information in Project Settings, and you can see all resource quotas for the project.
To change project quotas, click Edit Project on the Basic Information page and select Edit Project Quotas.
NoteFor a multi-cluster project, the option Edit Project Quotas does not display in the Manage Project drop-down menu. To set quotas for a multi-cluster project, go to Projects Quotas under Project Settings and click Edit Quotas. Note that as a multi-cluster project runs across clusters, you can set resource quotas on different clusters separately.
Change project quotas in the dialog that appears and click OK.
Was this page Helpful?
Receive the latest news, articles and updates from KubeSphere
Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.