kubernetes: interactive run "Unrecognized input header"

Something is not happy taking extra args. @ncdc

thockin@freakshow kubernetes master /$ kubectl run date -i --tty --restart=Never --image=busybox --; kubectl delete pod date
Waiting for pod default/date to be running, status is Pending, pod ready: false

/ # 
/ # pod "date" deleted
thockin@freakshow kubernetes master /$ kubectl run date -i --tty --restart=Never --image=busybox -- /bin/sh; kubectl delete pod date
Waiting for pod default/date to be running, status is Pending, pod ready: false

/ # /bin/date
Mon Nov  2 16:19:56 UTC 2015
/ # pod "date" deleted
thockin@freakshow kubernetes master /$ kubectl run date -i --tty --restart=Never --image=busybox -- /bin/date; kubectl delete pod date
Waiting for pod default/date to be running, status is Pending, pod ready: false
Error attaching, falling back to logs: error executing remote command: Error executing command in container: container not found ("date")
Error from server: Internal error occurred: Unrecognized input header
pod "date" deleted
thockin@freakshow kubernetes master /$ kubectl run date -i --tty --restart=Never --image=busybox -- /bin/sh -c /bin/date; kubectl delete pod date
Waiting for pod default/date to be running, status is Pending, pod ready: false
Error attaching, falling back to logs: error executing remote command: Error executing command in container: container not found ("date")
Error from server: Internal error occurred: Unrecognized input header
pod "date" deleted
thockin@freakshow kubernetes master /$ kubectl run date -i --tty --restart=Never --image=busybox -- -c /bin/date; kubectl delete pod date
Waiting for pod default/date to be running, status is Pending, pod ready: false
Error from server: Internal error occurred: Unrecognized input header
pod "date" deleted

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 28 (21 by maintainers)

Most upvoted comments

kubectl run with a short running command still doesn’t work for me with 1.2.0 final:

With --restart=Never the command ends with Unrecognized input header

lodur:config yves$ kubectl run busybox -i --tty --image=busybox --rm --restart=Never --command -- nslookup kubernetes.default
Waiting for pod default/busybox-nwobh to be running, status is Pending, pod ready: false
Waiting for pod default/busybox-nwobh to be running, status is Pending, pod ready: false
Waiting for pod default/busybox-nwobh to be running, status is Pending, pod ready: false
Error from server: Unrecognized input header

Also the job doesn’t get deleted but the pod does.

Without the --restart=Never the command hangs:

lodur:config yves$ kubectl run busybox -i --tty --image=busybox --rm --command -- nslookup kubernetes.default
Waiting for pod default/busybox-4204947303-78vap to be running, status is Pending, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Pending, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
Waiting for pod default/busybox-4204947303-78vap to be running, status is Running, pod ready: false
...

I’m using the Docker single node setup with Docker Machine, versions:

lodur:config yves$ kubectl version
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"5cb86ee022267586db386f62781338b0483733b3", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"5cb86ee022267586db386f62781338b0483733b3", GitTreeState:"clean"}

lodur:config yves$ docker version
Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 21:49:11 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 21:49:11 2016
 OS/Arch:      linux/amd64

I’m still seeing this problem with kubernetes / kubectl 1.4.4 and docker 1.11.2.

there seems kubernetes only support container TTY=false. as in code, it’s hard code with RawTerminal. sopts := StreamOptions{ OutputStream: stdout, ErrorStream: stderr, RawTerminal: false, }