Skip to content

Instantly share code, notes, and snippets.

@SEJeff
Created February 13, 2018 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SEJeff/69bdb90462bb24f8c4d83025cd1fff53 to your computer and use it in GitHub Desktop.
Save SEJeff/69bdb90462bb24f8c4d83025cd1fff53 to your computer and use it in GitHub Desktop.
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