How to limit resources for specific roles Kubernetes?

5/16/2019

I am currently setting up a cluster for a team. I've setup a hierarchial role based authentication. I've used the Kuberentes role API to define the roles. However, you can only restrict the CRUD operations for the roles.

How can I limit resources like cpu or memory based on roles?

EDIT: Seems like there is no way to do that directly. Namespaces would have to be created for each role and then ResourceQuotas will have to be applied on them.

-- Haran Rajkumar
kubectl
kubernetes

2 Answers

5/16/2019

Create different namespace for each team. you should be using ResourceQuota to limit the resources at namepsace level.

Follow the link for help --> ResourceQuota in Kubernetes

-- P Ekambaram
Source: StackOverflow

5/16/2019

I think you need to use Resource Quotas Policy in Kubernetes.

Refer to this link - Resource Quotes

-- Aravind
Source: StackOverflow