Skip to content

Tools

To develop new Apps or other Workloads, install a client on your local machine to access the Kubernetes API:

Kubectl

kubectl is a CLI application that allows you to run commands against Kubernetes clusters. It is used for the examples in this documentation.

Output formatting

Many kubectl commands can give output in JSON format. Install jq to automatically format JSON data in the terminal. Pipe it to less for navigation.

kubectl <command> | jq | less

Filtering with JSONPath

Some commands give verbose output. Use JSONPath to filter it.

kubectl get pods -o=jsonpath='{.items[*].spec}'

Read more about JSONPath here.

Filtering with Golang Templates

You can also filter using Golang templates. This is more powerful than JSONPath but requires more knowledge of the template language.

kubectl get pods -o=go-template='{{range .items}}{{.spec}}{{end}}'

Read more about Golang templates here.