kubectl命令
程序员文章站
2024-03-11 16:32:31
...
- 从容器中拷贝文件
kubectl cp -n namespace pod_name:app/test.txt ./test.txt
- 查看pod详情
kubectl describe pods -n namespace
- 删除节点
#先停止服务
systemctl stop docker
systemctl stop kubelet
kubectl delete node node_name
- 删除pod
kubectl delete pod pod_name -n namespace
强制删除
kubectl delete pod pod_name -n namespace --grace-period=0 --force
- 回滚
kubectl rollout history deployment/grafana -n kubesphere-monitoring-system
kubectl rollout history deployment/grafana --revision=83 -n kubesphere-monitoring-system
kubectl rollout undo deployment/grafana --to-revision=1 -n kubesphere-monitoring-system