Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation CKA Exam - Topic 2 Question 90 Discussion

Actual exam question for Linux Foundation's CKA exam
Question #: 90
Topic #: 2
[All CKA Questions]

SIMULATION

Get list of all the pods showing name and namespace with a jsonpath expression.

Show Suggested Answer Hide Answer
Suggested Answer: A

kubectl get pods -o=jsonpath='{.items[*]['metadata.name'

, 'metadata.namespace']}'


Contribute your Thoughts:

0/2000 characters
Billi
9 hours ago
I would use `kubectl get pods -o jsonpath='{.items[*].metadata.name} {.items[*].metadata.namespace}'`.
upvoted 0 times
...
Noah
5 days ago
I think it's straightforward if you know jsonpath.
upvoted 0 times
...
Elenore
24 days ago
Definitely a game changer for managing namespaces!
upvoted 0 times
...
Wei
29 days ago
I thought jsonpath was more complicated than that.
upvoted 0 times
...
Lindsey
1 month ago
Wait, can you really get all that info in one line?
upvoted 0 times
...
Veronika
1 month ago
Wait, is this the same as using kubectl get pods -o jsonpath?
upvoted 0 times
...
Omega
1 month ago
Hmm, I think I've seen this kind of question before. Let me think about it.
upvoted 0 times
...
Tiera
2 months ago
Jsonpath is a powerful tool, I'm sure this will be a piece of cake.
upvoted 0 times
...
Slyvia
2 months ago
This is a straightforward question, the solution is pretty simple.
upvoted 0 times
...
Stephaine
2 months ago
I practiced this last week, and I believe the full command should look like `kubectl get pods -o jsonpath='{.items[*].metadata.name} {.items[*].metadata.namespace}'`.
upvoted 0 times
...
Elliot
2 months ago
I feel like we also need to include the namespace in the jsonpath, but I can't recall how to format that part correctly.
upvoted 0 times
...
Torie
2 months ago
I remember practicing a similar question, and I think it was something like `-o jsonpath='{.items[*].metadata.name}'` for names.
upvoted 0 times
...
Reuben
3 months ago
I think we need to use `kubectl get pods` with a jsonpath option, but I'm not entirely sure about the exact syntax.
upvoted 0 times
...
Corinne
3 months ago
Okay, I've got a plan. I'll use the `kubectl get pods -o jsonpath='{.items[*].metadata.name} {.items[*].metadata.namespace}'` command. Gotta make sure I get the jsonpath expression right, but I think I can nail this.
upvoted 0 times
...
Sabrina
3 months ago
That works! Super handy for quick checks.
upvoted 0 times
...
Malcom
3 months ago
Oof, jsonpath can be tricky. I'll need to think through the exact syntax to extract the name and namespace. Maybe I'll start with a simpler kubectl command and then try to translate that to jsonpath.
upvoted 0 times
...
Alona
4 months ago
You can use `kubectl get pods -o jsonpath='{.items[*].metadata.name} {.items[*].metadata.namespace}'`
upvoted 0 times
...
Penney
4 months ago
This question is tricky!
upvoted 0 times
...
Long
4 months ago
Jsonpath? I'm a little fuzzy on that, but I know kubectl has some built-in options for getting pod info. I'll need to double-check the docs, but I'm confident I can figure this out.
upvoted 0 times
...
Patrick
4 months ago
Hmm, this looks like a straightforward JSON parsing question. I'll need to brush up on my jsonpath syntax, but I think I can handle this.
upvoted 0 times
Bettyann
3 months ago
I struggle with jsonpath sometimes.
upvoted 0 times
...
...

Save Cancel