Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My personal list of kubectl tips and tricks

Viewing All Node Labels

Shows you a list of nodes and their associated labels + values in the cluster.

kubectl get nodes -o go-template='{{range .items }}{{.metadata.name}}{{"\n-----------\n"}}{{range $key, $value := .metadata.labels }}{{$key}}: {{$value}}{{"\n"}}{{end}}{{"\n"}}{{end}}'

Viewing All Node Annotations

Shows you a list of nodes and their associated annotations + values in the cluster.

kubectl get nodes -o go-template='{{range .items }}{{.metadata.name}}{{"\n-----------\n"}}{{range $key, $value := .metadata.annotations }}{{$key}}: {{$value}}{{"\n"}}{{end}}{{"\n"}}{{end}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.