I have this command
clear; sudo kubectl exec -it $(kubectl get pods | grep 'app' | cut -d ' ' -f 1) ash
I will land here
/src #
I want to also run a command ls
/src # ls
Procfile composer.lock phpunit.xml server.php
app config public storage
artisan database resources tests
benu.code-workspace heroku.sh routes vendor
bootstrap package-lock.json run.sh webpack.mix.js
composer.json package.json scripts
/src #
I've tried
clear; sudo kubectl exec -it $(kubectl get pods | grep 'app' | cut -d ' ' -f 1) ash echo "ls"
and
clear; sudo kubectl exec -it $(kubectl get pods | grep 'app' | cut -d ' ' -f 1) echo "ls"
Please correct me
If you want to run the command, you want kubectl exec -it $podname ls
. If you put echo "ls"
then that is the command which run, i.e. print "ls".