这是一篇关于kubectl run命令的帖子 - http://kubernetes.io/docs/user-guide/kubectl/kubectl_run/
我尝试使用-i选项运行docker容器,如示例所示:
# Start a single instance of busybox and keep it in the foreground, don't restart it if it exits.
kubectl run -i --tty busybox --image=busybox --restart=Never
然而,kubectl说-i是一个未知的命令。
Error: unknown shorthand flag: 'i' in -i
Run 'kubectl help' for usage.
有什么想法吗?
答案 0 :(得分:1)
您的kubectl客户端可能已过期,因为您的命令行适用于我:
$ 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.2", GitCommit:"528f879e7d3790ea4287687ef0ab3f2a01cc2718", GitTreeState:"clean"}
$ kubectl run -i --tty busybox --image=busybox --restart=Never
Waiting for pod default/busybox-dikev to be running, status is Pending, pod ready: false
Hit enter for command prompt
/ #