码迷,mamicode.com
首页 > 其他好文 > 详细

k8s常用命令

时间:2018-08-29 21:30:22      阅读:271      评论:0      收藏:0      [点我收藏+]

标签:container   nod   pac   version   path   磁盘   volume   metadata   tor   

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常用命令

标签:container   nod   pac   version   path   磁盘   volume   metadata   tor   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!