1

I am getting - when installing Cilium:

Warning  FailedScheduling  4m21s (x17 over 84m)  default-scheduler  0/1 nodes are available: 1 node(s) didn't match pod anti-affinity rules. preemption: 0/1 nodes are available: 1 node(s) didn't match pod anti-affinity rules.

How can I see the rule and can I change it?

If I do kubectl describe node, id do not have anyy nodeAffinity settings. And the Node has Taints:<none>

Chris G.
  • 23,930
  • 48
  • 177
  • 302
  • Affinities are defined on the pod (probably via deployment/statefulset/daemonset). Do a kubectl describe pod – Chris Nov 25 '22 at 12:16
  • Thanks, the strange thing is that there is no nodeAffinity when describing the pod? – Chris G. Nov 25 '22 at 12:26
  • 1
    Sorry, my bad. You need to get the pods as yaml to see it: `kubectl get pod -o yaml`. There you'll find `spec.affinity`. – Chris Nov 25 '22 at 12:32

1 Answers1

1

Run $ kubectl get pods , it shows Pending status. (kubectl get pods -o wide)

To describe the pod run $ kubectl describe pod POD_NAME, it shows a warning as part of events, if not works, try as suggested by @ Chris run kubectl get pod <name> -o yaml. There you'll find spec.affinity.

After identifying which anti-affinity rules triggers the warning. You can choose to

either rectify the rule or make some changes in the cluster to support the rule

For example : let's take a case, try to deploy 4 replicas of Ngnix deployment with podAntiAffinity rule in a 3 Node cluster. Here the last replica cannot be scheduled because no available Nodes left.

You can choose to reduce the number of replicas, increase the number of Nodes, adjust the rule to use soft/preference requirements or remove the podAntiAffinity rule.

Veera Nagireddy
  • 1,656
  • 1
  • 3
  • 12