首页 > 其他 > 详细

k8s常用命令

时间:2018-08-29 21:11:40      阅读:233      评论:0      收藏:0      [点我收藏+]

Node、pod基本命令:
Kubectl describe pods
kubectl get pods -n default -o wide
kubectl log -f --tail=200 $pod_id
kubectl create/delete -f xxx.yaml
kubectl delete pod $pod_id
kubectl exec $pod_id


Service命令:
Kubectl get services
kubectl create -f service.yaml
kubectl delete service -l app=v1

 

pod文件挂载(前提:集群有共享网络磁盘)
spec:
containers:
- name: redis
image: redis
volumeMounts:
- name: redis-storage
mountPath: /data/redis
volumes:
- name: redis-storage
hostPath:
path: /host-path

 

名称空间
namespace-wenlin.yaml
apiVersion: v1
kind: Namespace
metadata:
name: wenlin

k8s常用命令

原文:https://www.cnblogs.com/wenlin-gk/p/9556624.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!