I'm getting below this issue in GKS Pod is blocking scale down because it's a non-daemonset, non-mirrored, non-pdb-assigned kube-system pod
I have read this docs :- https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-to-set-pdbs-to-enable-ca-to-move-kube-system-pods
but still not able to understand where i need to add this line in every pods or every nodes. if pods which i need to add.
In default namespace im running my application in which pods,svc,deploy are running. So i need to add under defaults namespace of pods or kube-system namespace pods
"cluster-autoscaler.kubernetes.io/scale-down-disabled": "true" even i have add in 3 nodes like this
kubectl annotate node gke-test-default-pool-a44dbf1c-05h1 cluster-autoscaler.kubernetes.io/scale-down-disabled=true kubectl annotate node gke-test-default-pool-a44dbf1c-3j6j cluster-autoscaler.kubernetes.io/scale-down-disabled=true kubectl annotate node gke-test-default-pool-a44dbf1c-hmrf cluster-autoscaler.kubernetes.io/scale-down-disabled=true
but still the error is showing on GKE
Please tell me how to solve that error/issue in GKS from 3 days im not able to understand and solve it even i google it and ready so many website but didnt solve it.
After deploying
kubectl create poddisruptionbudget pdb --namespace=kube-system --selector k8s-app=kube-dns --max-unavailable 1
Warning: policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget
poddisruptionbudget.policy/pdb created
I Got deprecated and another issue

Previous i was having 3 nodes but i have 2 nodes only now because i have edit one node remove this line "cluster-autoscaler.kubernetes.io/scale-down-disabled": "true" which i have added in it after that i didnt check whether my nodes are 3 or 2.
Later i check found only 2 nodes are running.
Its a good or bad to edit nodes in GKE or AKS
kubectl get pdb -A
NAMESPACE NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
kube-system kube-dns-bbc N/A 1 1 69m
Here is yaml file
kubectl get pdb kube-dns-bbc -o yaml -n kube-system
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"policy/v1","kind":"PodDisruptionBudget","metadata":{"annotations":{},"labels":{"k8s-app":"kube-dns"},"name":"kube-dns-bbc","namespace":"kube-system"},"spec":{"maxUnavailable":1,"selector":{"matchLabels":{"k8s-app":"kube-dns"}}}}
creationTimestamp: "2022-02-18T17:07:53Z"
generation: 1
labels:
k8s-app: kube-dns
name: kube-dns-bbc
namespace: kube-system
resourceVersion: "230860"
uid: 7131c64d-6779-4b23-8c53-10ffcc242144
spec:
maxUnavailable: 1
selector:
matchLabels:
k8s-app: kube-dns
status:
conditions:
- lastTransitionTime: "2022-02-18T17:38:13Z"
message: ""
observedGeneration: 1
reason: SufficientPods
status: "True"
type: DisruptionAllowed
currentHealthy: 2
desiredHealthy: 1
disruptionsAllowed: 1
expectedPods: 2
observedGeneration: 1



