Skip to content

Instantly share code, notes, and snippets.

@mattclegg
Created September 21, 2018 06:21
Show Gist options
  • Save mattclegg/eab60382c4843950378f50b587650796 to your computer and use it in GitHub Desktop.
Save mattclegg/eab60382c4843950378f50b587650796 to your computer and use it in GitHub Desktop.
kshell() {
kubectl exec -it --namespace="$1" "$2" -- env TERM=$TERM COLUMNS=$COLUMNS LINES=$LINES sh -il
}
kdelete() {
kubectl delete pod --namespace="$1" $2
}
kpod() {
kubectl get pods --namespace=$1 -l$2 -o go-template="{{ range \$var,\$val := .items}}{{ if eq \$var 0 }}{{ \$val.metadata.name }}{{ end }}{{ end }}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment