Execute bash command in pod with kubectl?
问题 my question is simple. How to execute a bash command in the pod? I want to do everything with one bash command? [root@master ~]# kubectl exec -it --namespace="tools" mongo-pod --bash -c "mongo" Error: unknown flag: --bash So, the command is simply ignored. [root@master ~]# kubectl exec -it --namespace="tools" mongo-pod bash -c "mongo" root@mongo-deployment-78c87cb84-jkgxx:/# Or so. [root@master ~]# kubectl exec -it --namespace="tools" mongo-pod bash mongo Defaulting container name to mongo.