K8s基础
base
#使用glusterfs做存储,不懂glusterfs的请参考其他文章
k8s-imagePullPolicy拉取策略
imagePullPolicy: Always 总是拉取 pull 以前好像是这个默认值 imagePullPolicy: IfNotPresent 默认值,本地有则使用本地镜像,不拉取 imagePullPolicy: Never 只使用本地镜像,从不拉取
k8s删除pod
1、先删除pod2、再删除对应的deployment否则只是删除pod是不管用的,还会看到pod,因为deployment.yaml文件中定义了副本数量 实例如下: 删除pod [root@test2 ~]# kubectl get pod -n jenkins NAME READY STATUS RESTARTS AGE jenkins2-8698b5449c-grbdm 1/1 Running 0 8s [root@test2 ~]# kubectl delete pod jenkins2-8698b5449c-grbdm -n jenkins pod "jenkins2-8698b5449c-grbdm" deleted 查看pod仍然存储 [root@test2 ~]# kubectl get pod -n jenkins NAME READY STATUS RESTARTS AGE jenkins2-8698b5449c-dbqqb 1/1 Running 0 8s [root@test2 ~]# 删除deployment [root@test2 ~]# kubectl get deployment -n jenkins NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE jenkins2 1 1 1 1 17h [root@test2 ~]# kubectl delete deployment jenkins2 -n jenkins 再次查看pod消失 deployment.extensions "jenkins2" deleted [root@test2 ~]# kubectl get deployment -n jenkins No resources found. [root@test2 ~]# [root@test2 ~]# kubectl get pod -n jenkins No resources found.
[ k8s中正确删除一个pod k8s中正确删除一个pod ]
CrashLoopBackOff的解决方法
记录一次修复k8s pod长时间处于CrashLoopBackOff状态问题
k8s启动Pod遇到CrashLoopBackOff的解决方法