覆盖在学习和工作中的常用 Kubernetes 命令:Node / Pod / Deployment / Service / Configmap / Storage / Network
目录 Table of Contents
Node
查看
1 2
| kubectl get nodes | grep ${node_name} kubectl describe node ${node_name}
|
Pod
查看
1 2
| kubectl get pods | grep ${pod_name} kubectl describe pod ${pod_name}
|
执行
1
| kubectl exec -it ${pod_name} -c ${container_name} ${command}
|
删除
1 2
| kubectl delete pod ${pod_name}
|
Deployment
查看
1 2
| kubectl get deployments | grep ${deployment_name} kubectl describe deployment ${deployment_name}
|
修改
1 2 3 4
| kubectl edit deployment ${deployment_name}
kubectl set image deployment/${deployment_name} ${container_name}=${registry}:${tag}
|
Service
查看
1 2
| kubectl get services | grep ${service_name} kubectl describe service ${service_name}
|
Configmap
查看
1 2
| kubectl get configmaps | grep ${configmap_name} kubectl describe configmap ${configmap_name}
|
修改
1 2
| kubectl edit configmap ${configmap_name}
|
Storage
Network