How to format the output of kubectl describe to JSON

后端 未结 4 1436
甜味超标
甜味超标 2020-12-17 08:25

kubectl get command has this flag -o to format the output.

Is there a similar way to format the output of the kubectl describe

4条回答
  •  太阳男子
    2020-12-17 08:53

    kubectl describe doesn't support -o or equivalent. It's meant to be human-readable rather than script-friendly. You can achieve what you described with kubectl get pods -l -o , for example:

    $ kubectl get pods -l app=guestbook,tier=frontend -o name
    pod/frontend-a4kjz
    pod/frontend-am1ua
    pod/frontend-yz2dq
    

提交回复
热议问题