Skip to content

Instantly share code, notes, and snippets.

@jackyscript
Last active July 17, 2024 10:41
Show Gist options
  • Save jackyscript/ee656fbc56cf1b82e45f640c127fff51 to your computer and use it in GitHub Desktop.
Save jackyscript/ee656fbc56cf1b82e45f640c127fff51 to your computer and use it in GitHub Desktop.
kubectl

kubectl utilities

Get all pods plain names

kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'

Get the node port

kubectl get services/someService -o go-template='{{(index .spec.ports 0).nodePort}}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment