1.查看pod部署信息
kubectl describe pod 部署的pod名称 -n 所在的命名空间
2.查看所有pod
kubectl get pods --all-namespaces
3.查看Kubernetes中所有节点
kubectl get nodes
4.删除一个pod
kubectl delete pod xxx -n xxx
5.删除deployment
kubectl get xxx -n xxx
kubectl delete deployment xxx -n xxx
6.添加污点
node-role.kubernetes.io/master
7.修改pod配置文件
kubectl edit pod 部署的pod名称 -n 所在的命名空间
8.常见问题
容器中的程序时区相差8小时,以及中文乱码问题,设置环境变量或者在dockerfile中指定如下:
# 指定编码解决中文乱码
LANG en_US.utf8
# 指定时区解决时间相差8小时
TZ Asia/Shanghai
指定程序部署到某个节点中
nodeSelector:
kubernetes.io/hostname: node1