k8s常用命令
Posted wenlin-gk
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s常用命令相关的知识,希望对你有一定的参考价值。
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常用命令的主要内容,如果未能解决你的问题,请参考以下文章