Resource requests and limits¶
Applications in Kubernetes can declare resource requests (how much they need when idling) and limits (maximum usage). Applications in ARISnet must declare CPU and memory requests as well as memory limits.
You can do this in your deployment as follows:
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
# ...
template:
#...
spec:
containers:
- name: frontend
resources:
requests:
cpu: "10m"
memory: "128Mi"
limits:
memory: "256Mi"
Note
Please consider your CPU requests. Most applications don't need any CPU while idling, a CPU request of 10m is
perfectly fine. Setting a higher request means that other users of the cluster can't access the allocated resources.
The allocated resources will count towards your quota. You can check your quota allocation by running the following command:
oc get resourcequotas