## exit will delete the pod automatically ## --restart=Never: create a pod instead of deployment ## praqma/network-multitool: network tools image alias kbt='kubectl run testpod -it --rm --restart=Never --image=praqma/network-multitool -- /bin/sh'
## docker shortcut alias di='docker images' alias dp='docker ps -a' alias dri='docker rmi -f' alias drp='docker rm -f'
alias k='kubectl' alias kbn='kubectl get nodes' ## can replace with your working namespace ## pods alias kbp='kubectl get pods --all-namespaces' ## deployments alias kbd='kubectl get deploy -n zen | grep -E "xmeta|services"' ## statefulsets alias kbsts='kubectl get sts -n zen | grep -E "conductor|compute"' ## services alias kbs='kubectl get svc -n test-1'
## get into pods kbl() { pod=$1 ## get namepace ns=$(kubectl get pod --all-namespaces | grep $pod | awk {'print $1'}) kubectl exec -it $pod sh -n $ns } ### for fixed pod name alias gocond='kubectl exec -it is-en-conductor-0 bash -n test-1' alias gocomp0='kubectl exec -it is-engine-compute-0 bash -n test-1' ### for dynamic pod name goxmeta() { isxmetadockerpod=`kubectl get pods --field-selector=status.phase=Running -n test-1 | grep is-xmetadocker-pod | awk {'print $1'}` kubectl exec -it ${isxmetadockerpod} bash -n test-1 }