Skip to content

Instantly share code, notes, and snippets.

@amitkrishna
Last active December 14, 2022 09:35
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 amitkrishna/1ee0586c806a3d99639646654e6a6438 to your computer and use it in GitHub Desktop.
Save amitkrishna/1ee0586c806a3d99639646654e6a6438 to your computer and use it in GitHub Desktop.
k8s cli hacks
- Customized Column output
$>kubectl get pods -A -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,NODE:.spec.nodeName,HOSTIP:.status.hostIP,PHASE:.status.phase,START_TIME:.metadata.creationTimestamp --sort-by=.metadata.creationTimestamp
- Delete taint from K8s clusters
$> kubectl patch node node1.compute.internal -p '{"spec":{"taints":[]}}'
$> kubectl get nodes -o json | jq '.items[].spec'
$> kubectl get nodes -o json | jq '.items[].spec.taints'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment