#!/bin/bash if [ "$1" = "" ]; then echo "usage: $0 \$pod_name_to_grep_for" exit fi grepfor=$1 kubectl exec --stdin --tty $(kubectl get pods | grep -i "${grepfor}" | awk '{print $1;}') -- /bin/bash