What is the problem with this config.
Whenever I run kubectl drain <node>
this error is coming: "Cannot evict pod as it would violate the pod's disruption budget"
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment1
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
selector:
matchLabels:
app: nginx1
template:
metadata:
labels:
app: nginx1
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: pdb-nginx1
spec:
minAvailable: 1
selector:
matchLabels:
app: nginx1
-------
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment4
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: nginx4
template:
metadata:
labels:
app: nginx4
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: pdb-nginx4
spec:
maxUnavailable: 1
selector:
matchLabels:
app: nginx4
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment2
spec:
replicas: 20
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
selector:
matchLabels:
app: nginx2
template:
metadata:
labels:
app: nginx2
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: pdb-nginx2
spec:
maxUnavailable: 50%
selector:
matchLabels:
app: nginx2