exam questions

Exam CKA All Questions

View all questions & answers for the CKA exam

Exam CKA topic 1 question 14 discussion

Actual exam question from CNCF's CKA
Question #: 14
Topic #: 1
[All CKA Questions]

SIMULATION -


Task -
From the pod label name=overloaded-cpu, find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /opt/
KUTR00401/KUTR00401.txt (which already exists).

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Bensaid
Highly Voted 1 year, 6 months ago
kubectl top pod -l name=overloaded-cpu --sort-by=cpu
upvoted 6 times
...
dirkdirkdirk
Highly Voted 1 year, 10 months ago
Why would they add "(which already exists)"? It just confuses matters. In other questions they do not add this qualification. Makes me wonder if that file is empty? Maybe first # cat /opt/KUTR00401/KUTR00401.txt to make sure it's empty. If it's not, # echo "name-of-top-cpu-pod" >> /opt/KUTR00401/KUTR00401.txt Instead of # echo "name-of-top-cpu-pod" > /opt/KUTR00401/KUTR00401.txt Or am I overthinking here?
upvoted 6 times
mchahed
1 year, 10 months ago
I got the same feeling here :D
upvoted 2 times
...
...
Nasser_Sam
Most Recent 1 month, 2 weeks ago
kubectl top pod -l name=overloaded-cpu --sort-by=cpu | head -n 1 > /opt/KUTR00401/KUTR00401.txt ## Note: The --sort-by=cpu flag will sort the pods by CPU usage, but to capture only the topmost CPU-consuming pod (not all pods), you'll need to use head -n 1 to select the first result. ## | head -n 1: Selects the pod with the highest CPU usage from the sorted list.
upvoted 2 times
...
noahsark
1 month, 3 weeks ago
killer_sh_lab practice: # In spec - containers - args: --secure-port=4443 --kubelet-insecure-tls # Add # In ports: - containerPort: 4443 # Add hostNetwork above nodeSelector: hostNetwork: true nodeSelector: kubernetes.io/os: linux k apply -f metrics-server.yml k run nginx --image=nginx --labels=”name=overloaded-cpu” --dry-run=client -o=yaml > nginx.yaml k apply -f nginx.yaml mkdir /opt/KUTR00401 touch /opt/KUTR00401/KUTR00401.txt k top pods -l=’name=overloaded-cpu’ --sort-by=cpu echo “nginx” >> /opt/KUTR00401/KUTR00401.txt cat /opt/KUTR00401/KUTR00401.txt
upvoted 1 times
...
Archanakaviya
2 months, 3 weeks ago
kubectl top pod -l name=overloaded-cpu --sort-by=cpu --no-headers | head -n 1 | awk '{print $1}' > /opt/KUTR00401/KUTR00401.txt
upvoted 1 times
...
[Removed]
5 months ago
kubectl top pod -l name=overloaded-cpu --sort-by=cpu | awk 'NR==2 {print $1}' > /opt/KUTR00401/KUTR00401.txt
upvoted 2 times
...
zanhsieh
8 months ago
Frankly speaking, why bother typing the pod name with this single liner: # Dry-run k top po -l name=overloaded-cpu --sort-by=cpu -A --no-headers | head -n 1 | awk '{print $2}' # Exec k top po -l name=overloaded-cpu --sort-by=cpu -A --no-headers | head -n 1 | awk '{print $2}' >> /opt/KUTR00401/KURT00401.txt
upvoted 1 times
...
donid323
1 year, 5 months ago
default or all namespaces ?
upvoted 1 times
...
Chinensis
1 year, 10 months ago
I think the answer should be: overloaded-cpu-98b9se
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago