docker / roadmap

Welcome to the Public Roadmap for All Things Docker! We welcome your ideas.
https://github.com/orgs/docker/projects/51
Creative Commons Zero v1.0 Universal
1.8k stars 266 forks source link

Docker swarm API works on workers #484

Open singlesly opened 1 year ago

singlesly commented 1 year ago

Tell us about your request Add the ability to get information about the docker swarm when requested through the Docker Engine API to workers

Which service(s) is this request for? Docker Swarm. Docker Engine API

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? There is a group of virtual servers. To which there is access through the Docker Engine API at different times, different nodes can be connected to different Docker Swarm, and when you try to get information about which server the node is connected to, when you request /v1.42/swarm you get the error

This node is not a swarm manager. Worker nodes can't be used to view or modify cluster state. Please run this command on a manager node or promote the current node to a manager.

Are you currently working around the issue? to solve it, you have to disconnect all swarms and all nodes from the swarm, and deploy the desired set of swarms with nodes from scratch

Additional context

thaJeztah commented 1 year ago

It's by design that workers don't have privileged access to the swarm control API (which is only accessible to manager nodes).

The docker info command should provide information about the managers that the worker is connected to though.