-
Bug
-
Resolution: Won't Do
-
Normal
-
None
-
4.12.0
-
Quality / Stability / Reliability
-
False
-
-
None
-
Moderate
-
No
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem:
The `PDB(PodDisruptionBudget)` with `minAvailable=0` is preventing node drain when ready pod is in crashloop,error or in notready state.
Version-Release number of selected component (if applicable):
4.12
How reproducible:
yes
Steps to Reproduce:
1. Create deployment which should fail
~~~
mdeore@mdeore-mac Manifest % cat deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-deployment
spec:
replicas: 1
selector:
matchLabels:
app: test
template:
metadata:
labels:
app: test
spec:
containers:
- name: nginx
image: registry.access.redhat.com/ubi8/nginx-120
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 3
~~~
2. Create PDB with minAvailable: 0
~~~
mdeore@mdeore-mac Manifest % cat pdb.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: test-pdb1
spec:
minAvailable: 0
selector:
matchLabels:
deployment: httpd
~~~
3. Check pod and PDB
~~~
NAME READY STATUS RESTARTS AGE
test-deployment-f7d699487-25bcd 0/1 CrashLoopBackOff 7 (9s ago) 11m
mdeore@mdeore-mac Manifest % oc get pdb
NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
test-pdb 0 N/A 0 5s
~~~
4. Drain the node in which pod is schudled
~~~
% oc adm drain worker-1.mdeore11.lab.psi.pnq2.redhat.com --delete-local-data --ignore-daemonsets --force
~~~
Actual results:
Drain is failing due to pdb
~~~
error when evicting pods/"mypod" -n "test" (will retry after 5s): Cannot evict pod as it would violate the pod's disruption budget.
~~~
Expected results:
Drain should be successfull wethoud any issue for this test pod as minAvailable is set to`0`
Additional info:
If we do same test with pod which is in ready state. Drain is working fine wethout any issue.