Welcome to your Day 3 Warmup Challenge! Your mission, should you choose to accept it, is to:
- Download and execute a script that sets up everything you need for this lab.
- Create the Pod manifest below...
- Figure out why your pod isn’t being created in the
warmupnamespace!
Run the following single command to download and execute the setup script:
student@bchd~$ cd && wget https://raw.githubusercontent.com/csfeeser/k8s/master/resources/rqwarmupsetup.sh -O - | bash
Make the following pod.
student@bchd~$ vim day4warmup.yml
apiVersion: v1
kind: Pod
metadata:
name: warmup-pod
namespace: warmup
spec:
containers:
- name: warmup-container
image: nginx
resources:
requests:
cpu: "500m" # Requesting 0.5 cores
limits:
cpu: "1" # Limiting to 1 coreOnce you’ve written this, go ahead and apply the manifest with:
student@bchd~$ kubectl apply -f day4warmup.yml
Oh no! The pod isn’t being created. 😱
But wait—don’t panic! This is your time to shine and troubleshoot like a Kubernetes guru. There's a reason the pod isn’t being allowed to run. What could it be?
Read the error message you received! Use the power of kubectl describe ns warmup to figure out what’s happening. You got this!
Need a few hints? Click here to reveal!
- Could it be that the namespace has specific resource constraints you need to meet?
- Did you set ALL the requests and limits you need in your pod manifest?
Click here if you want the full solution!
-
The issue is likely caused by the
ResourceQuotaset on thewarmupnamespace. The quota enforces both CPU and memory limits, but your pod manifest only has CPU requests and limits. -
Since no memory requests/limits are specified in your pod manifest, it conflicts with the resource quota. To fix this, update your pod manifest to include memory requests and limits:
resources: requests: cpu: "500m" memory: "256Mi" limits: cpu: "1" memory: "512Mi"
Once you’ve updated the pod manifest, run
kubectl apply -f day4warmup.ymlagain, and the pod should be created successfully.