Can I delete a single pod with a PodDisruptionBudget?

0
5
Asked By TechyNinja42 On

I'm wondering about the implications of a PodDisruptionBudget when I only have one pod running. Here's my setup:

spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/component: ui

If I try to delete this single pod, will it actually be allowed?

2 Answers

Answered By DevOpsDynamo On

Actually, that's not correct. If you have only one pod, you won't be able to delete it safely because the PDB is set to allow a maximum of one pod to be unavailable. To go around this, you'd need to scale up your deployment to at least two replicas before you can safely delete or drain it.

Answered By CloudGuru99 On

Yes, you can delete the pod directly using a command like `kubectl delete pod `. However, if you try to drain the node using `kubectl drain`, it will fail because that operation requires an eviction, which the PodDisruptionBudget would prevent. So in short, direct deletion is fine, but evictions are blocked if you only have one pod.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.