From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Finding pods - Kubernetes Tutorial
From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep
Finding pods
- All right, the next task is to find Pods. So the mission was to find all Pods that have the label tier=control-plane and write a list of these Pods to the file /tmp/task2pods. Let me show you what the solution is. So, let's use kubectl get pods minus A to look for pods in all namespaces, minus minus selector tier=control-plane. And there we have a couple of them. Now, we need to have all pods that have the label and we need to write the name of the pods to the file TMP task to pods. Now if you are comfortable with using Linux, then you can use some awking on that, and that's what I'm going to do. Otherwise, feel free to just write everything to /tmp/task2pods and clean it up manually because if you are not very comfortable with comments like this then you are going to lose too much time. But I'm going to use awk print dollar two and before writing it to the file, I want to make sure that this is showing what we want, and yeah, this is showing what we want. There's one line too many…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Module 7: Sample exam introduction13s
-
(Locked)
Learning objectives47s
-
(Locked)
Exam tips5m 9s
-
(Locked)
Tasks overview6m 54s
-
(Locked)
Grading the exam57s
-
(Locked)
Working with namespaces5m 23s
-
(Locked)
Finding pods1m 38s
-
(Locked)
Creating a ConfigMap5m 31s
-
(Locked)
Using a sidecar4m 56s
-
(Locked)
Using probes1m 30s
-
(Locked)
Creating a deployment4m 48s
-
(Locked)
Exposing applications3m 24s
-
(Locked)
Managing NetworkPolicy4m 44s
-
(Locked)
Using storage5m 37s
-
(Locked)
Using Helm1m 36s
-
(Locked)
Managing resource restrictions2m 18s
-
(Locked)
Creating canary deployments5m 22s
-
(Locked)
Defining container restrictions4m 6s
-
(Locked)
Using a Dockerfile2m 26s
-
(Locked)
Using ServiceAccount2m 32s
-
(Locked)
-