I run this command:
kubectl run my-shell --rm -it --image alpine -- sh
It all works fine, but after a few minutes of inactivity the shell closes on it's own and my terminal hangs as well, so that kubectl does not remove the pod since it cannot complete.
So I am wondering, is it possible to increase the timeout before this happens, I have not found this in the documentation?
P.S. Help on preventing terminal hanging is appreciated as well, I am using ordinary windows command line.
P.P.S. This is happening in AKS, as @wolmi suggested it might be relevant.
Add the --generator flag:
kubectl run my-shell --rm -it --image alpine --generator=run-pod/v1 -- sh
I tried with no problem during more than 20min idle.
By default the run command uses --generator=deployment/apps.v1beta1 that is deprecated and generated a different yaml.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With