k8s

kubectl -ojsonpath

icy1900

Roy

Posted on September 8, 2021

kubectl -ojsonpath

bettwen jsonpath and template, there should be a equal sign
right

kubectl get pod mysql-0 -n coding -ojsonpath="{.metadata.name}"
Enter fullscreen mode Exit fullscreen mode

or

kubectl get pod mysql-0 -n coding -o jsonpath="{.metadata.name}"
Enter fullscreen mode Exit fullscreen mode

wrong

kubectl get pod mysql-0 -n coding -ojsonpath "{.metadata}"
Enter fullscreen mode Exit fullscreen mode

will report

error: template format specified but no template given

💖 💪 🙅 🚩
icy1900
Roy

Posted on September 8, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related