I installed a "nginx ingress controller" on my GKE cluster. I followed this guide to install the nginx ingress controller in the GKE.
When deploying resources for the service and ingress resource I realized that the ingress controller was at 0/1
Events telling me:
0/1 nodes are available: 1 node(s) didn't match node selector.
Now I checked the yaml/describe: https://pastebin.com/QG3GKxh1 And found that:
nodeSelector:
kubernetes.io/os: linux
Which looks fine in my opinion. Since I just used the command of the guide to install the controller I have no idea what went wrong from my side.
The provided answer showed me the way. My node was labeled with beta.kubernetes/io: linux
while the controller was looking for kubernetes/io: linux
. Renaming the nodeSelector
in the controller worked.
nodeSelector
is used to constraint the nodes on which your Pods can be scheduled.
With:
nodeSelector:
kubernetes.io/os: linux
You are saying that Pods must be assigned to a node that has the label kubernetes.io/os: linux
. If none of your nodes has that label, the Pod will never get scheduled.
Removing the selector from the nginx ingress controller or adding the label kubernetes.io/os: linux
to any node should fix your issue.