Skip to content

Instantly share code, notes, and snippets.

@baybatu
Created April 12, 2023 15:03
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save baybatu/793aaabf387333b4343bcf1a2e12f8aa to your computer and use it in GitHub Desktop.
List all used node ports on kubernetes cluster. kudos @hasansama
kubectl get svc --all-namespaces -o go-template="{{range .items}}{{range.spec.ports}}{{if .nodePort}}{{.nodePort}}{{printf \"\n\"}}{{end}}{{end}}{{end}}" | sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment