kubernetes PodDistruptionBudget阻止排出节点

rjee0c15  于 2023-11-17  发布在  Kubernetes
关注(0)|答案(1)|浏览(121)

我有一个PDB,可以防止在集群升级过程中驱逐其中一个pod。由于我将PDB的maxUnavailable设置为50%,并且一个pod已经启动并运行。因此另一个pod应该可以被驱逐。它有什么问题?

  1. apiVersion: policy/v1
  2. kind: PodDisruptionBudget
  3. metadata:
  4. labels:
  5. group: x
  6. name: mydeployment
  7. name: mydeployment-pdb
  8. namespace: test
  9. spec:
  10. maxUnavailable: 50%
  11. selector:
  12. matchLabels:
  13. group: x
  14. name: mydeployment

字符串
PDB的描述

  1. Name: mydeployment-pdb
  2. Namespace: test
  3. Max unavailable: 50%
  4. Selector: group=x,name=mydeployment
  5. Status:
  6. Allowed disruptions: 1
  7. Current: 2
  8. Desired: 1
  9. Total: 2
  10. Events: <none>


Pod:

  1. k get pods #(two pods are on the different nodes)
  2. mydeployment-7465989f54-bkwgt 1/1 Running 0 6m54s
  3. mydeployment-7465989f54-v9lg8 1/1 Running 0 2d15h


错误代码:

  1. Normal DeprovisioningBlocked 36s (x16 over 39m) karpenter Cannot deprovision node due to pdb test/mydeployment prevents pod evictions

axr492tv

axr492tv1#

您可能需要检查很多点来验证问题的根本原因。我建议出于故障排除的目的,尝试使用'kubectl drain'手动驱逐pod,看看是否会出现任何错误消息。还可以考虑检查PDB详细信息和不会干扰解除配置过程的集群配置。这里有一些文档可以帮助您解决用例。[1][2][3]
[1]https://karpenter.sh/docs/troubleshooting/#nodes-not-deprovisioned
[2][https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/](https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/)
[3]https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets

相关问题