Lab 06 - Finding your way around kubectl
Lab 06 - Finding your way around kubectl
InfodiscoveryGoal: never need the internet to answer a Kubernetes question again. Chapter: Finding your way
Each task states what you should end up seeing. Try it yourself first; the box holds one working answer.
Task 1. List every kind of object this cluster knows about, and find out
whether ingresses is namespaced and what its short name is.
Task 2. List only the kinds that are not namespaced. You should see nodes, persistentvolumes, storageclasses, namespaces themselves.
Task 3. Without leaving the terminal, find out which fields go under a Pod’s
spec.containers[].resources, and what spec.restartPolicy accepts.
Task 4. Find the minimum required fields of an Ingress rule - the ones marked required.
Task 5. You want to create a Deployment imperatively but do not remember the flags. Find the built-in examples.
Task 6. Create a Pod named explorer running nginx:1.27, then print
only its IP address and the node it landed on - no other output.
Task 7. Show the full stored object for explorer, including the defaults
the API server filled in that you never wrote. Find terminationGracePeriodSeconds
and dnsPolicy.
Task 8. Show the events for explorer: scheduled, image pulled, started.
Task 9. Print the nginx access log of explorer, then follow it live while
you curl the Pod from a throwaway Pod.
Task 10. Find out whether you are allowed to delete nodes in this cluster.
Clean up
kubectl delete pod explorer
Four commands answer almost everything: api-resources (what exists),
explain (what fields), describe (what happened), logs (what the app said).