Relevant Documentation

Lesson Reference

Create a pod with resource requests that exceed available node resources.

  1. Create a YAML file named big-request-pod.yml and open it for editing:
vi big-request-pod.yml
  1. Add the following content to the file:
apiVersion: v1
kind: Pod
metadata:
  name: big-request-pod
spec:
  containers:
  - name: busybox
    image: busybox
    command: ['sh', '-c', 'while true; do sleep 3600; done']
    resources:
      requests:
        cpu: "10000m"
        memory: "128Mi"
  1. Save and close the file.
  2. Create the pod using the YAML file:
kubectl create -f big-request-pod.yml
  1. Check the status of the pod. It should remain in the Pending state since no worker nodes have enough resources to meet the request:
kubectl get pod big-request-pod
  1. Create a YAML file named resource-pod.yml and open it for editing:
vi resource-pod.yml
  1. Add the following content to the file: