Resource requests and limits are set on a per-container basis within a pod. By specifying a resource request we tell the Kubernetes scheduler the minimum amount of each resource (CPU and memory) a container will need. By specifying limits, we set up cgroup constraints on the node where the process runs. An example of setting requests/limits looks like:
apiVersion: v1 kind: Pod metadata: name: ckad-resource-pod spec: containers: - name: ckad-resource-container image: my-app:v3.3 resources: limits: cpu: "1" memory: “1Gi” requests: cpu: "0.5" memory: “500Mi”
Learn more about pod resource requests/limits.