Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document network diagnostic tool #5558

Closed
wants to merge 3 commits into from
Closed

Document network diagnostic tool #5558

wants to merge 3 commits into from

Conversation

mdlinville
Copy link

@mdlinville mdlinville commented Dec 18, 2017

Document the network diagnostic tool introduced in moby/moby#35677

Fixes #5555

cc/ @fcrisciani

Not sure if we should really be documenting the CLI at all. It's not great that the API isn't documented in Swagger.

I'm also not 💯 clear on the use case for this or the type of info you'd use it to get.

@mdlinville mdlinville added this to the engine/17.12 milestone Dec 18, 2017
started to debug specific issues, and should not be left running all the time.

Information about networks is stored in a database, which can be examined using
the API. The database consists of one table per network.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database consists of one table per network. would remove this, it is actually 2 per network so far, but not really of interest

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you supposed to know what the table name is that you want to dump? I couldn't figure this out.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is that the majority of the people will use the client that abstracts this detail and deserialize the structures of the database.
The tables are the endpoint_table and the overlay_peer_table

started to debug specific issues, and should not be left running all the time.

Information about networks is stored in a database, which can be examined using
the API. The database consists of one table per network.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database consists of one table per network. I would remove this, the number is actually 2 at the moment, but is not really relevant

/join
```

### Join or leave the swarm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Join leave the network database cluster

The CLI is provided as a preview and is not yet stable. Commands or options may
change at any time.

The CLI executable is called `debugClient` and is made available using a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now is called diagnosticClient

@mdlinville
Copy link
Author

I think one of my questions got hidden addressing your feedback, @fcrisciani . I don't understand how the database tables are named. Can I give the user a clue, since they need to specify the table name in some of the commands?

@mdlinville
Copy link
Author

I think this is ready. PTAL again.

Copy link
Contributor

@ddebroy ddebroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Couple of minor comments

provides diagnostic information. The network debugging tool should only be
started to debug specific issues, and should not be left running all the time.

Information about networks is stored in a database, which can be examined using
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stored in a database: how about a little more details around the networkdb:

  1. What kind of information is stored?
  2. Mention that the database is shared/clustered across all nodes.

/networkpeers
/
/join
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the leave endpoint be listed here too?

### Join or leave the network database cluster

```bash
$ curl localhost:2000/join?members=ip1,ip2,...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to clarify ip1, ip2. Maybe add a note that they are the IPs of the nodes in the swarm? Ideal would be an example with a docker node ls and docker node inspect showing the IP addresses.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that's useful (at least for one of the examples)

1. To run the container, use a command like the following:

```bash
$ docker container run --name net-diagnostic -d --privileged --network host fcrisciani/network-diagnostic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we push the containerized tool to docker org in hub?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed; but that can be handled separate from this PR (and this reference updated in a follow-up)

@mdlinville
Copy link
Author

Most of these are not really docs issues. @fcrisciani can you please provide some more info here?

cc/ @thaJeztah


The Docker API exposes endpoints to query and control the network debugging
tool. CLI integration is provided as a preview, but the implementation is not
yet considered stable and commands and options may change without notice.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a big fat warning that this tool should be used with care, as (IIUC) incorrect use of the tool can destroy/damage the network (it's not a read-only tool), and also expose information about your cluster's configuration that should be kept private (so don't expose this API outside of the host).

the output, and is typically a number from 2 to 6 digits long.

```bash
$ ps aux |grep dockerd | grep -v grep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If running with systemd (perhaps it's ok to assume that's the case), it's possible to use systemctl reload docker

1. To run the container, use a command like the following:

```bash
$ docker container run --name net-diagnostic -d --privileged --network host fcrisciani/network-diagnostic
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed; but that can be handled separate from this PR (and this reference updated in a follow-up)

### Join or leave the network database cluster

```bash
$ curl localhost:2000/join?members=ip1,ip2,...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that's useful (at least for one of the examples)

@mdlinville
Copy link
Author

@fcrisciani We have decided not to doc this officially. Please use the contents of this PR to develop a README for https://github.com/docker/libnetwork/. After you have done so, please ping me to link to the readme from the dockerd doc in docker/cli repo.

@mdlinville mdlinville closed this Dec 19, 2017
@mdlinville
Copy link
Author

@fcrisciani Please also include cautions about potential to harm the network, in the upstream README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants