Skip to content

Instantly share code, notes, and snippets.

@epcim
Created August 5, 2022 08:46
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 epcim/f249f6073ab6408c42b50051dfc1b42a to your computer and use it in GitHub Desktop.
Save epcim/f249f6073ab6408c42b50051dfc1b42a to your computer and use it in GitHub Desktop.
k8s container docker exec
# enter any kubernetes pod/container directly just by "part" of it's cotnainer name
cshell ()
{
d=$1;
docker exec -it $(docker ps |grep "k8s_$d" | awk '{print $1}' | head -1) /bin/bash
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment