plamer
plamer

Reputation: 474

Kubernetes - kubectl exec bash - session drop and line width

I'm having k8s cluster with 3 minions, master and haproxy in front. When I use

kubectl exec -p $POD -i -t -- bash -il

for accessing bash in the pod (it is a single container in this case) I get in and after something like 5 mins I get dropped out of the terminal. If I reenter the container I can see my old bash process running, with a new started for my new connection. Is there a way to prevent this from happening? When I'm using docker exec it works fine and doesn't drop me so I guess it is from kubernetes.

As a bonus question - is there a way to increase the characters per line when using kubectl exec? I get truncated output that is different from docker exec.

Thanks in advance!

Upvotes: 6

Views: 7002

Answers (2)

lufeng
lufeng

Reputation: 91

i have resolve by add env COLUMNS=$COLUMNS LINES=$LINES before bash kubectl exec -ti busybox env COLUMNS=$COLUMNS LINES=$LINES bash

Upvotes: 3

plamer
plamer

Reputation: 474

It is a known issue - https://github.com/kubernetes/kubernetes/issues/9180

The kubelet webserver times out.

Upvotes: 3

Related Questions