Itay Gil
Itay Gil

Reputation: 251

Formatting kubectl output

I'm trying to format the output of this command:

kubectl get pods test

like docker I'm trying to format the outout just for it to print me the name and the status of all pods. docker:

docker ps --format "{{.Status}},{{.Name}}"

Any way I can do it?

Upvotes: 0

Views: 2178

Answers (1)

nickgryg
nickgryg

Reputation: 28593

You can do that with custom columns:

kubectl get pods -o=custom-columns=STATUS:.status.phase,STARTED:.status.startTime,NAME:.metadata.name

Upvotes: 4

Related Questions