kubectl操作示例
1、根据yaml配置文件一次性创建service和rc
kubectl create -f my-service.yaml -f my-rc.yaml
2、根据目录下所有.yaml、.yml、.json文件的定义进行创建操作
kubectl create -f
3、查看所有Pod列表
kubectl get pods
4、查看rc和service列表
kubectl get rc,service
5、显示Node的详细信息
kubectl describe nodes
6、显示Pod的详细信息
kubectl describe pods/
7、显示由RC管理的Pod信息
kubectl describe pods
8、删除基于pod.yaml文件定义的Pod
kubectl delete -f pod.yaml
9、删除所有包含某个label的Pod和Service
kubectl delete pods,services -l name=
10、删除所有Pod
kubectl delete pods --all
11、在Pod的容器里执行date命令,默认使用Pod中的第个容器执行
kubectl exec date
12、指定Pod中某个容器执行date命令
kubectl exec -c date
13、以bash方式登陆到Pod中的某个容器里
kubectl exec -it -c /bin/bash
14、查看容器输出到stdout的日志
kubectl logs
15、跟踪查看容器的日志,相当于tail -f命令的结果
kubectl logs -f -c
kubectl exec examples
kubeconfig with kubectl config command
kubectl cheat sheet
1万+

被折叠的 条评论
为什么被折叠?



