How to fix this problem "node does not fit (planning restrictions are not met on 1 node)" in the docker role when deploying the registry?

I have a docker swarm in a virtual machine with 2 core centers 4 GB in size.

In a swarm, when I deploy a private docker registry (registry 2.6.4), it shows the status of the service waiting forever. i used docker service ps <<registry_name>>

And when I check the use of docker inspect <<task_id>> in the message, I got this "node does not fit (scheduling restrictions are not met on 1 node)".

I tried restarting the service and redistributing.

How to fix it?

+5
source share
1 answer

I often encounter this problem when there is a mismatch between the node labels defined in the layout file and those defined in the actual node, either because I am setting the wrong label (for example, a typo), or just completely forgot the node labels.

To mark nodes:

1) For each node target, do:

docker-machine ssh <manager_node_name> 'docker node update --label-add <label_name>=<label_value> <target_node_name>'

2) Make sure they match those defined in the layout file.

3) restart docker service in node manager

, eg:

compile file:

  dummycontainer: image: group/dummyimage deploy: mode: replicated replicas: 1 placement: constraints: [node.labels.dummy_label == dummy] restart_policy: condition: on-failure 

assuming I want to deploy this replica to a node called dummy_node:

 docker-machine ssh manager_node 'docker node update --label-add dummy_label=dummy dummy_node' 

and restart the docker in the node manager.

Finally, when deploying, you should expect the dummycontainer to work in dummy_node, assuming the label was set correctly in both steps. Otherwise, you may see the error you are getting.

Best wishes

+1
source

Source: https://habr.com/ru/post/1268150/


All Articles