From f0ca8cdabdf0410480ca2fa3f6b6f857ed82ea6d Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 28 Jun 2017 14:22:54 +0100 Subject: [PATCH] swarmd: Update README.md Signed-off-by: Ian Campbell --- projects/swarmd/README.md | 32 ++++++++++++++++++------------- projects/swarmd/swarmd/Dockerfile | 2 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/projects/swarmd/README.md b/projects/swarmd/README.md index 0fe0d7cb7..03cb866a9 100644 --- a/projects/swarmd/README.md +++ b/projects/swarmd/README.md @@ -3,27 +3,33 @@ This adds a `swarmd` package for Moby which contains the standalone swarmkit orchestration daemon (`swarmd`) and CLI tool (`swarmctl`). -The package tracks [docker/swarmkit#1965][PR1965] which -is a WIP PR adding a containerd executor to swarmkit. +The package tracks [ijc's `container-wip` branch][containerd-wip]. +Compared with mainline swarmkit (which container a basic containerd +executor merged in [PR1965]) this reworks the executor to use the +container client library and adds support for CNI networking. -With a suitable moby image (such as `swarmd.yml` from this directory) -something like this should work: +With a suitable LinuxKit image (such as `swarmd.yml` from this +directory) something like this should work: - runc exec swarmd swarmctl service create --image docker.io/library/nginx:alpine --name nginx - runc exec swarmd swarmctl service ls + ctr exec -- swarmd swarmd swarmctl service create --image docker.io/library/nginx:alpine --name nginx + ctr exec -- swarmd swarmd swarmctl service ls + +Note that `swarmd` uses the "swarmd" containerd namespace, so to see +swarmd managed containers you will need to use `-n swarmd` on all +`ctr` commands e.g.: + + ctr -n swarmd containers ls + +Alternatively you may export `CONTAINERD_NAMESPACE=swarmd`. ### TODO -Currently the swarm state directory needs to be at a path which is -identical from the PoV of both the `containerd` and `swarmd` -processes. For now this means that the swarmkit state is put in -`/var/lib/containerd/swarmd`. - -Bootstrapping a cluster needs more invesigation. Tokens and join +Bootstrapping a cluster needs more investigation. Tokens and join addresses can currently only be passed on the `swarmd` command line which is inconvenient for automated image deployment. Swarmkit [PR 1965][PR1965] also contains a number of TODOs which are not separately listed here. -[PR1665]: https://github.com/docker/swarmkit/pull/1965 +[PR1965]: https://github.com/docker/swarmkit/pull/1965 +[containerd-wip]: https://github.com/ijc/swarmkit/tree/containerd-wip diff --git a/projects/swarmd/swarmd/Dockerfile b/projects/swarmd/swarmd/Dockerfile index b7fb8f948..749291519 100644 --- a/projects/swarmd/swarmd/Dockerfile +++ b/projects/swarmd/swarmd/Dockerfile @@ -39,7 +39,7 @@ RUN mkdir -p /out/usr/bin/ /out/etc /out/opt/cni/bin /out/etc/cni/net.d ##################################################################### # Swarmd -# https://github.com/ijc25/swarmkit/tree/containerd-wip +# https://github.com/ijc/swarmkit/tree/containerd-wip ENV SWARMKIT_REPO=https://github.com/ijc25/swarmkit ENV SWARMKIT_BRANCH=containerd-wip ENV SWARMKIT_COMMIT=4a484ccb498bee117fe6167d5a5e7ea0f6d4f2e9