kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
问题现象为通过kubectl进入pods时提示在未来版本中将移除这种进入这种方式,需要使用新的命令格式进入
[root@master ~]# kubectl exec myweb-c5xq6 -it /bin/bash
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
root@myweb-c5xq6:/usr/local/tomcat#
使用新的命令格式进入pod,语法为 kebectl exec [pods名] -- [执行的命令],注意,如果进入交互式伪终端,需要在exec后面补充-it参数
[root@master ~]# kubectl exec -it myweb-c5xq6 -- /bin/bash
root@myweb-c5xq6:/usr/local/tomcat# exit
exit
[root@master ~]#