kubectl run fail in interactive mode on CI

6/7/2018

have issue with

kubectl run -ti 

in gitlab ci. For testing in CI we run docker container with "npm t" command in interactive mode and it was perfectly work on docker. After migrate to Kubernetes have issue, as kubectl run give next error: Unable to use a TTY - input is not a terminal or the right kind of file
Job run in image: lachlanevenson/k8s-kubectl If run kubectl run from local machine all work. Pls help

-- Alibek Karimov
continuous-integration
docker
gitlab-ci-runner
kubectl
kubernetes

1 Answer

6/8/2018

The PodSpec container: has a tty attribute, which defaults to false but which one can set to true (that's what the -t option, which is a shortcut for --tty=true, does in kubectl exec). You can experiment with setting stdin: true but at your peril, since it can hang the Pod waiting for "someone" to type something.

-- mdaniel
Source: StackOverflow