-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Proposal: API endpoint for listing nodes in cluster #735
Comments
Would it help? https://docs.docker.com/swarm/ Once the manager is running, check your configuration by running docker info as follows:
|
OK, it looks like ➜ ~ curl -s http://localhost:2375/info | jq '.'
{
"Containers": 149,
"DriverStatus": [
[
"\bStrategy",
"random"
],
[
"\bFilters",
"affinity, health, constraint, port, dependency"
],
[
"\bNodes",
"2"
],
[
"hostname1",
"hostname1:2376"
],
"..."],
"NEventsListener": 0,
"Debug": false
} It is not documented at https://docs.docker.com/swarm/API/#endpoints-which-behave-differently –it probably should be, because it's essentially behaving quite differently than any normal docker engine. Also it looks like this endpoint is somewhat hacky and designed to make human-readable Something like
|
I agree that it's is not well parsable. Actually I had some issues with that because addition labels (I suppose not only labels) changes this output and I have to go though all items and search for Nodes entry. +1 to add swarm specific API. |
@ahmetalpbalkan no, we want to abstract nodes from the API, for example when using swarm with the mesos scheduler backend, there is no concept of nodes. |
@vieux I see. Is that the case because the Mesos framework for Swarm would advertise the available resources (i.e. nodes) from Swarm to Mesos (instead of Mesos asking Swarm). I understand the concern that Swarm must abstract the nodes in "Docker Remote API", but how about a Swarm-specific API (not a superset/subset of Docker Remote API) that provides info about the Swarm cluster itself and its nodes? If someone was building another sort of tool on top of Swarm, and they need list of nodes, is there any way they could get that? |
As @ahmetalpbalkan mentioned this is a feature which could be very useful for tools looking to integrate with Swarm. As an example I am working on heapster source implementation for Swarm (see here for details: kubernetes-retired/heapster#367) and right now we have not way of getting the list of nodes other than running @vieux if the concept of node does not exist when using swarm with the mesos scheduler backend, then what would be the output of a call to |
I also would like to have an API for selecting and returning a node (not placing the new container just selecting). This is ver useful for the cluster-wide build process. |
Maybe we should put together a list of pros and cons so we can reach a Bests, Yoanis Le vendredi 26 juin 2015, Chanwit Kaewkasi notifications@github.com a
|
Following these. I +1 for
|
Sorry for not following up on this discussion I started earlier. :-) @vieux what is being asked here is not related to Docker Remote API at all. And Mesos might be working without this piece of info. What we're proposing a different set of API endpoints (that look like Remote API of course) which provide various info about cluster. This could be simply for building GUIs/visualizations on top of Swarm, collecting data about Swarm, or orchestrating/extending Swarm further. At the end, Swarm API will be a superset of Docker Remote API, and will include a few extra endpoints. Based on @chanwit's suggestion, I would like to propose having What do maintainers think about this? |
@vieux these kinds of change are really important for us to unlock the barrier between platforms using Swarm. For example we can |
Following up with what @ahmetalpbalkan and @chanwit endpoints such as /nodes, which provides the list of nodes on the cluster alone with the information describing some of the nodes characteristics (CPU, RAM, etc) will ease the integration with monitoring tools such as heapster. For instance I'd like to implement a heapster metrics source which integrates with Swam. The very first step towards this is to get the list of nodes available in the cluster. This endpoint will be called on a regular basis since nodes can come and go. Right now there is no reliable/consistent/standard way of doing this other than parsing the output from Also I don't think adding and endpoint to get the list of nodes will do any harm, nor I think its something entirely new, specially when you consider that the command |
I tend to agree with this. We had a bunch of conversations at DockerCon around APIs with many contributors (including @icecrime and @shykes). One of the ideas we've been toying around (not sure everyone agrees) is that the current Docker API could become the Container Management API, which both the Engine and Swarm implement. Swarm would also implement the Cluster Management API, which could provide among other things Thoughts? |
@aluzzardi Not sure what exactly you mean by Container Management API nor by Cluster Management API. Is this some sort of documentation which already exists? I am sorry if I'm missing something obvious. Generally speaking, it would be nice to have such APIs. I imagine what you call the Cluster Management API will be a superset, as many others has mentioned here, of the Seems to me a fair set of questions to ask is:
|
@aluzzardi thank you for the info. It seems that we can focus on defining the How should we start? I think all extra information provided by Actually, I did hack |
TL;DR Summary: Let's do this. I'm for @yoanisgil Container Management API is basically the Docker API - pretty much all it does is expose endpoints to manage containers (creation and operation). Cluster Management is basically what is proposed here: listing nodes for starter and something like @chanwit mentioned to get container positioning. But this could evolve in many ways: Moving/migrating containers, draining nodes (as in, moving all containers elsewhere for instance if the node has to be brought down for maintenance), adding/removing nodes, manipulating node labels, ... Technically speaking, it doesn't change anything - it's just a matter of nomenclature. Instead of saying "the engine defines the Docker API which Swarm implements along with a super set", we'd say: here's the Docker API. It contains primitives to manage containers (current Docker API), clusters (future Swarm API), machines (Machine API?) and stacks (Compose API?). Swarm speaks both the Container and Cluster APIs while the Engine only the Container API. In that world, maybe Swarm could eventually speak the Stack Composition API, meaning that it'd be able to digest Compose files directly and things such as I realize the conversation is quite meta but I promise it's going to materialize into short-term doable stuff. |
Yes, let's do this 👍 |
Too bad no one can see me behind my keyboard because I'm +1'ing this like crazy. Even though this should be something worth of a Proposal I guess? |
+1 from me as well :) On Tue, Jun 30, 2015 at 12:40 AM, Alexandre Beslic <notifications@github.com
|
I am all in for this. Personally, I'd love to see Swarm be able to natively handle Compose ;), given that I am currently working on a deployment procedure based on Compose. I think at the very least the Container Management API should provide node discovery and management. Just wondering what's next ? |
Hi everyone, sorry for not being able to participate more (currently on Both daemons perform the same fundamental task: orchestrate In the single-host daemon, the backends are processes, directories, network In both cases there is the need to express desired state vs actual state, I completely support the idea of a new cluster-aware API. I also would like To support this use case, I would also like to request first-class support Sorry for the wall of text. On Tuesday, June 30, 2015, Yoanis Gil notifications@github.com wrote:
|
@shykes there quite a few interesting things in your comment:
I am quite new to Docker but I would really love to see this work. Maybe we could start by creating a Draft of what endpoints are required to render the Swarm API more cluster aware. This document could define some sort of roadmap which in turn will help people know how to help and contribute to this effort. |
Since Swarm now supports multi-manager set up, the managers also have a knowledge of leader and followers. Therefore I'm extending the proposal:
Also can we mark this issue as |
+1 for adding specific stuff to swarm API. I think that would help manager make smarter decision as the scheduler becomes more mature. |
Sorry if I rehash discussions here, or am not on the right issue. Please tell me if so. I hope to help clarify things for potential newcomers here later who will, like me, arrive here after searching/googling ;-) Hi, currently trying to monitor how full my swam cluster is. Where now & in the future should I try to retrieve that information? My goal is to be able to be alerted of potential issues with stale containers filling the cluster, or be able to react to that event by adding nodes to the swarm cluster. I would like to avoid monitoring the nodes themselves because it seems to me like a kind of waste: swarm already has to know if there's still room because I use My impression is that I should currently try and parse the /info URL (or the Thanks |
+1 |
+1 |
Any progress on this? |
👍 |
Finally some serious stuff happened in v1.12 so we're friends again. ❤️ |
@ahmetalpbalkan Thanks for taking care of closing the now irrelevant issues, much appreciated. ❤️ |
Question:Is there a plan for building an API endpoint (specific to Swarm) that would list all the active/healthy nodes in the cluster? This could help a great deal in building tools/functionality on top of Swarm. I'm not sure if this is discussed before but it sounds like a having this would be nice-to-have yet harmless to me.The text was updated successfully, but these errors were encountered: