I am using Kubernetes to exec into a pod like this:
kubectl exec myPod bash -i
which works fine, except I don't get a prompt. So then I do:
export PS1="myPrompt "
Which I would expect to give me a prompt, but doesn't. Is there some workaround for this?
Trying to exec into pod in interactive way requires specifying -ti
option.
Where -i
passes stdin to the container and -t
connects your terminal to this stdin.
Take a look at the following example:
kubectl exec -it myPod -- bash
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.