...

/

Defining Resource Requests

Defining Resource Requests

Learn how we can define resources for our pods.

We'll cover the following...

Defining request

When we create a pod to run our application, we can define how much CPU and memory it will need. Kubernetes will then only schedule this pod on nodes that have enough capacity to fulfil these requests.

This does not mean the containers will be limited to that amount of resources; it just means that if a node can’t provide the requested CPU and memory, the pod won’t even be allowed to run there.

Here’s how we define this request in the pod’s definition:

Press + to interact
apiVersion: v1
kind: Pod
metadata:
name: busybox
spec:
containers:
- name: busybox-container
image: busybox
command: ["dd", "if=/dev/zero", "of=/dev/null"]
resources:
requests:
cpu: 500m
memory: 5Mi

We’re running a busybox container, ...

Access this course and 1400+ top-rated courses and projects.