Kubernetes Rest API - Exec (re)size

10/19/2018

How can I set Size (ie: cols and rows) using Rest API WebSockets Exec? API doc does not mention it.

kubectl exec -v=99 doesn't give me a clue how it's setting size.

I've read some people setting environment variables COLUMNS and ROWS when running kubectl exec -it $container env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM bash, but there is nothing documented for exec method api in order to set variables either.

-- rptl
kubernetes

1 Answer

10/19/2018

Answering my own question: You have to send those envs mentioned in my question as multiple command's in your query.

ie: to Execute bash with 80 columns and 24 rows: &command=env&command=COLUMNS%3D80&command=ROWS%3D24&command=/bin/bash

-- rptl
Source: StackOverflow