Ingress-nginx: Ingress-nginx always PENDING

Created on 25 Nov 2019  路  8Comments  路  Source: kubernetes/ingress-nginx

Environment:

  • Cloud provider or hardware configuration: GKE

What happened:
I'm following the deployment tutorial here https://kubernetes.github.io/ingress-nginx/deploy/ on a GKE cluster. I've made all the commands.

When I arrive at the btoom the ingress-nginx is always PENDING. On the GKE console I'm able to see
PodUnschedulable: Cannot schedule pods: node(s) didn't match node selector.

I didn't change anything, I've just copied and pasted the commands from the documentation to the cluster

Is this outdated? Can someone update?
Thanks

Most helpful comment

@ricardopt because of the below selector its not able to find the kube nodes.
Try to open the this link for the code. I hope you have deployed the link code only.

https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

      nodeSelector:
        kubernetes.io/os: linux

Solution: Run the below command. It will update the label on all the kube nodes and then the container will find the node.

kubectl label node --all kubernetes.io/os=linux

All 8 comments

@ricardopt because of the below selector its not able to find the kube nodes.
Try to open the this link for the code. I hope you have deployed the link code only.

https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

      nodeSelector:
        kubernetes.io/os: linux

Solution: Run the below command. It will update the label on all the kube nodes and then the container will find the node.

kubectl label node --all kubernetes.io/os=linux

OR remove the nodeSelector from the deployment file.

Hi @git4suvendu,

Thanks for your answer. Running the command worked perfectly. Just a question with the autoscalling will that work?

best regards,

It should not be a problem. You can define your node selector. Please close the issue as it has been resolved.

Sorry @git4suvendu but I have to run the command again? I didn't edited the default file. I've just run the command you suggested.

To clarify, if you only run the command it will not work in the long run, because if the nodes go down the configuration will not be automatically deployed in the new nodes. The solution was to edit the original files and delete the nodeSelector.

Thanks

@ricardopt because of the below selector its not able to find the kube nodes.
Try to open the this link for the code. I hope you have deployed the link code only.

https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

      nodeSelector:
        kubernetes.io/os: linux

Solution: Run the below command. It will update the label on all the kube nodes and then the container will find the node.

kubectl label node --all kubernetes.io/os=linux

it didnt work for me. gave the following error:
'kubernetes.io/os' already has a value (linux), and --overwrite is false
'kubernetes.io/os' already has a value (linux), and --overwrite is false
'kubernetes.io/os' already has a value (linux), and --overwrite is false

@ricardopt because of the below selector its not able to find the kube nodes.
Try to open the this link for the code. I hope you have deployed the link code only.
https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml

      nodeSelector:
        kubernetes.io/os: linux

Solution: Run the below command. It will update the label on all the kube nodes and then the container will find the node.
kubectl label node --all kubernetes.io/os=linux

it didnt work for me. gave the following error:
'kubernetes.io/os' already has a value (linux), and --overwrite is false
'kubernetes.io/os' already has a value (linux), and --overwrite is false
'kubernetes.io/os' already has a value (linux), and --overwrite is false

@Gauravjaitly see my post above yours. You have to edit the original file and delete the nodeSelector

Was this page helpful?
0 / 5 - 0 ratings