The focus of this lab is to become familar with quickly starting a pod imperatively. This lab is also setup to understand how to debug and env either by starting a shell in a pod or by executing a pod with a specific command.
- Execute an imperative command to see what is in a standard Pods ENV
kubectl run busybox --image=busybox --command --restart=Never -- env
How do you see the output?
-
Add an ENV to the pod from step 1. (you'll like to add it to the yaml and replace)
-
Create a config map with the key
APP_ENV
and value ofdev
-
Create a pod that shows the mapping
-
Create a namespace foo, what is the value of the service account token?
-
Start a shell in a pod (start an nginx pod if one isn't running) and view the mounted token.
k exec -it nginx /bin/bash
- Recreate cluster with multi-nodes and run nginx pod
# needs kind and kubectl on path
./setup-lab3.sh
wait for "Lab 3 is Ready"
Launch a standard pod: k run nginx --image nginx
What is the status? Why?
Fix the pod.
- What does the following command do?
kubectl patch nodes kind-worker -p '{"spec":{"taints":[]}}'
- Node
kind-worker
has a label that doesn't exist onkind-worker2
. Create a pod that has node affinity to this nodekind-worker
passed on this label.