k8s-基本命令

来源:互联网 发布:想在淘宝开店没货源 编辑:程序博客网 时间:2024/06/05 03:44

k8s基本命令

问题:常用的命令有哪些?有什么用?怎么用?

解答

kubectl exec

如同docker exec ,进入到pod容器里面的命令

kubectl cp

拷贝pod里面数据,pod里面容器需要安装tar的命令,从报错信息可以获取。

[root@host1 test]# kubectl cp pod-834063700-d9x0p:/entry/cpfile /test/cpfileexec: "tar": executable file not found in $PATH#安装tar[root@pod-834063700-d9x0p entry]# yum -y install tarLoaded plugins: fastestmirror[root@host1 test]# kubectl cp pod-834063700-d9x0p:/entry/cpfile /test/cpfile tar: Removing leading `/' from member names[root@host1 test]# ls cpfile             cp    

kubectl get

svc

kubectl get svc --namespace==kube.system

参考

1.http://blog.csdn.net/liumiaocn/article/details/73925301
2.k8s api server