{"id":10624,"date":"2016-02-05T16:11:21","date_gmt":"2016-02-05T14:11:21","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=10624"},"modified":"2016-01-29T11:53:55","modified_gmt":"2016-01-29T09:53:55","slug":"using-swarm-calico-docker-machine","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/","title":{"rendered":"Using Swarm with Calico on Docker Machine"},"content":{"rendered":"<p>In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During <a href=\"https:\/\/www.docker.com\/docker-global-hack-day-3\">Docker Global Hackday #3<\/a>, we started playing with Swarm and Calico \u2014 however the tooling and integration at that stage made it difficult to implement.<\/p>\n<p>Thanks to the hard work of contributors to both projects, the barrier to entry for implementing Swam and Calico has been greatly reduced. In this article, we\u2019ll look into implementing a Docker Swarm and using Calico as a network plugin, using Docker Machine.<\/p>\n<p><a href=\"https:\/\/docs.docker.com\/swarm\/\">Swarm<\/a> allows a set of Docker hosts to be clustered, presenting a container API which abstracts scheduling of containers. By using a swarm instead of a set of hosts, much of the complexity around managing application availability and distributing resources is taken care of.<\/p>\n<p><a href=\"http:\/\/www.projectcalico.org\/\">Project Calico<\/a> provides a layer 3 network implementation, aimed at scalable datacenter deployments. Compared to traditional network overlays, Calico provides a more efficient implementation with minimal packet encapsulation. This allows better usage of node resources and a simple yet powerful network stack for your infrastructure.<\/p>\n<p>While Calico is a great SDN solution for many cases, it has drawbacks in <a href=\"http:\/\/blog.ipspace.net\/2015\/06\/project-calico-is-it-any-good.html\">advanced cases<\/a>. You can read more about why you should use Calico <a href=\"http:\/\/www.projectcalico.org\/why-calico\/\">here<\/a>.<\/p>\n<p>To prototype using Swarm with Calico, I\u2019ll be using <a href=\"https:\/\/docs.docker.com\/machine\/\">Docker Machine<\/a> creating VMs on <a href=\"https:\/\/www.virtualbox.org\/\">VirtualBox<\/a>. There may be some minor changes when using a different driver, but the core process should be the same.<\/p>\n<blockquote><p>Many of the steps taken here are not production safe \u2014 keep an eye out for warnings around implementation specifics in this document, as well as in the relevant provider docs.<\/p><\/blockquote>\n<h2>Implementing Docker Swarm without Calico<\/h2>\n<p>Let\u2019s start by creating a non-Calico Docker swarm using the standard Docker Machine interface. This is purely an exercise for comparison. We\u2019ll be following the documentation listed in the <a href=\"https:\/\/docs.docker.com\/swarm\/install-w-machine\/\">Swarm docs<\/a>.<\/p>\n<p>You\u2019ll need an existing Docker instance to get started, purely to create a Swarm discovery token, so if need be, create a Docker Machine instance just for this. Let\u2019s create a Swarm discovery token:<\/p>\n<pre class=\" brush:php\">$ docker run --rm swarm create\r\nc25aa882df76a92ae962f4b4fc26168d<\/pre>\n<p>Next we can launch the necessary Swarm containers using this token to coordinate the swarm.<\/p>\n<pre class=\" brush:php\">$ docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token:\/\/c25aa882df76a92ae962f4b4fc26168d swarm-master\r\nRunning pre-create checks...\r\nCreating machine...\r\nWaiting for machine to be running, this may take a few minutes...\r\nMachine is running, waiting for SSH to be available...\r\nDetecting operating system of created instance...\r\nProvisioning created instance...\r\nCopying certs to the local machine directory...\r\nCopying certs to the remote machine...\r\nSetting Docker configuration on the remote daemon...\r\nConfiguring swarm...\r\nTo see how to connect Docker to this machine, run: docker-machine env swarm-master\r\n\r\n$ docker-machine create -d virtualbox --swarm --swarm-discovery token:\/\/c25aa882df76a92ae962f4b4fc26168d swarm-agent-00\r\nRunning pre-create checks...\r\nCreating machine...\r\nWaiting for machine to be running, this may take a few minutes...\r\nMachine is running, waiting for SSH to be available...\r\nDetecting operating system of created instance...\r\nProvisioning created instance...\r\nCopying certs to the local machine directory...\r\nCopying certs to the remote machine...\r\nSetting Docker configuration on the remote daemon...\r\nConfiguring swarm...\r\nTo see how to connect Docker to this machine, run: docker-machine env swarm-agent-00\r\n\u2026.\r\n$ docker-machine create -d virtualbox --swarm --swarm-discovery token:\/\/c25aa882df76a92ae962f4b4fc26168d swarm-agent-NN\r\n...<\/pre>\n<p>At this point, you should have a running Swarm cluster. Let\u2019s take a look at it.<\/p>\n<pre class=\" brush:php\">$ docker-machine ls\r\nNAME             ACTIVE   DRIVER       STATE     URL                         SWARM\r\nswarm-agent-00   -        virtualbox   Running   tcp:\/\/192.168.99.101:2376   swarm-master\r\nswarm-agent-01   -        virtualbox   Running   tcp:\/\/192.168.99.102:2376   swarm-master\r\nswarm-master     *        virtualbox   Running   tcp:\/\/192.168.99.100:2376   swarm-master (master)\r\n$ eval $(docker-machine env --swarm swarm-master)\r\n$ docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                     NAMES\r\n8f4cef9a02b3        swarm:latest        \"\/swarm join --advert\"   9 minutes ago       Up 9 minutes        2375\/tcp                                  swarm-agent-01\/swarm-agent\r\n01a3712457c7        swarm:latest        \"\/swarm join --advert\"   10 minutes ago      Up 10 minutes       2375\/tcp                                  swarm-agent-00\/swarm-agent\r\n5220dca465d2        swarm:latest        \"\/swarm join --advert\"   12 minutes ago      Up 12 minutes       2375\/tcp                                  swarm-master\/swarm-agent\r\n1205877156ee        swarm:latest        \"\/swarm manage --tlsv\"   12 minutes ago      Up 12 minutes       2375\/tcp, 192.168.99.100:3376-&gt;3376\/tcp   swarm-master\/swarm-agent-master\r\n$ docker info\r\nContainers: 4\r\nImages: 3\r\nRole: primary\r\nStrategy: spread\r\nFilters: health, port, dependency, affinity, constraint\r\nNodes: 3\r\n swarm-agent-00: 192.168.99.101:2376\r\n  \u2514 Status: Healthy\r\n  \u2514 Containers: 1\r\n  \u2514 Reserved CPUs: 0 \/ 1\r\n  \u2514 Reserved Memory: 0 B \/ 1.021 GiB\r\n  \u2514 Labels: executiondriver=native-0.2, kernelversion=4.1.13-boot2docker, operatingsystem=Boot2Docker 1.9.1 (TCL 6.4.1); master : cef800b - Fri Nov 20 19:33:59 UTC 2015, provider=virtualbox, storagedriver=aufs\r\n swarm-agent-01: 192.168.99.102:2376\r\n  \u2514 Status: Healthy\r\n  \u2514 Containers: 1\r\n  \u2514 Reserved CPUs: 0 \/ 1\r\n  \u2514 Reserved Memory: 0 B \/ 1.021 GiB\r\n  \u2514 Labels: executiondriver=native-0.2, kernelversion=4.1.13-boot2docker, operatingsystem=Boot2Docker 1.9.1 (TCL 6.4.1); master : cef800b - Fri Nov 20 19:33:59 UTC 2015, provider=virtualbox, storagedriver=aufs\r\n swarm-master: 192.168.99.100:2376\r\n  \u2514 Status: Healthy\r\n  \u2514 Containers: 2\r\n  \u2514 Reserved CPUs: 0 \/ 1\r\n  \u2514 Reserved Memory: 0 B \/ 1.021 GiB\r\n  \u2514 Labels: executiondriver=native-0.2, kernelversion=4.1.13-boot2docker, operatingsystem=Boot2Docker 1.9.1 (TCL 6.4.1); master : cef800b - Fri Nov 20 19:33:59 UTC 2015, provider=virtualbox, storagedriver=aufs\r\nCPUs: 3\r\nTotal Memory: 3.064 GiB\r\nName: 1205877156ee<\/pre>\n<p><code>docker ps<\/code> now shows containers running on all nodes. You can interact with containers on the swarm as a whole using the Docker CLI.<\/p>\n<h2>Integrating Calico<\/h2>\n<p>Using Swarm with Calico requires a few changes from the standard swarm creation process.<\/p>\n<p>Each node within the Swarm cluster must be configured to offload the cluster store to a location also accessible to the Calico cluster. Each host also needs to create a Calico node using the <code>calicoctl<\/code> binary. This configures the host and creates a set of Docker containers to maintain the cluster.<\/p>\n<p>Because of these changes, we can\u2019t create a swarm using the Docker Machine helpers. We will need to create individual machine hosts and then manually create Swarm and Calico clusters. We\u2019ll be following the guide from the Calico docs for implementing Calico as a <a href=\"https:\/\/github.com\/projectcalico\/calico-containers\/blob\/master\/docs\/calico-with-docker\/docker-network-plugin\/CalicoSwarm.md\">Docker network plugin<\/a>. We hope to see more direct plugin support around the <code>docker-machine<\/code> tool in the future.<\/p>\n<h3>Create a machine cluster<\/h3>\n<p>To implement a Calico cluster, we\u2019ll need a set of unclustered Docker hosts.<\/p>\n<pre class=\" brush:php\">$ docker-machine create -d virtualbox node-00\r\nRunning pre-create checks...\r\nCreating machine...\r\nWaiting for machine to be running, this may take a few minutes...\r\nMachine is running, waiting for SSH to be available...\r\nDetecting operating system of created instance...\r\nProvisioning created instance...\r\nCopying certs to the local machine directory...\r\nCopying certs to the remote machine...\r\nSetting Docker configuration on the remote daemon...\r\nTo see how to connect Docker to this machine, run: docker-machine env node-00\r\n\r\n$ docker-machine create -d virtualbox node-01\r\nRunning pre-create checks...\r\nCreating machine...\r\nWaiting for machine to be running, this may take a few minutes...\r\nMachine is running, waiting for SSH to be available...\r\nDetecting operating system of created instance...\r\nProvisioning created instance...\r\nCopying certs to the local machine directory...\r\nCopying certs to the remote machine...\r\nSetting Docker configuration on the remote daemon...\r\nTo see how to connect Docker to this machine, run: docker-machine env node-01\r\n...\r\n$ docker-machine create -d virtualbox node-NN\r\n\u2026\r\n$ docker-machine ls\r\nNAME      ACTIVE   DRIVER       STATE     URL                         SWARM\r\nnode-00   *        virtualbox   Running   tcp:\/\/192.168.99.100:2376   \r\nnode-01   -        virtualbox   Running   tcp:\/\/192.168.99.101:2376   \r\nnode-02   -        virtualbox   Running   tcp:\/\/192.168.99.102:2376<\/pre>\n<h3>Set up a cluster store<\/h3>\n<p>We need to use an external cluster store, etcd, in order to synchronize the Calico and Swarm clusters.<\/p>\n<p>We can run this etcd store on our cluster. In a production environment, this should be a <a href=\"https:\/\/coreos.com\/etcd\/docs\/latest\/clustering.html\">scaled cluster supporting HA<\/a>. However in this example, we\u2019ll just run a single instance. We\u2019ll run this single instance of etcd on <code>node-00<\/code>, which is on IP <code>192.168.99.100<\/code>.<\/p>\n<pre class=\" brush:php\">$ eval $(docker-machine env node-00)\r\n$ docker run -d -p 2379:2379 quay.io\/coreos\/etcd -advertise-client-urls http:\/\/192.168.99.100:2379 -listen-client-urls http:\/\/0.0.0.0:2379\r\n...\r\n$ curl 192.168.99.100:2379\/v2\/keys\r\n{\"action\":\"get\",\"node\":{\"dir\":true}}<\/pre>\n<h3>Set up a Calico cluster<\/h3>\n<p>Thanks to tooling and the fact that we\u2019re using boot2docker as a base OS in Docker Machine, Calico requires very little setup.<\/p>\n<p>We simply need to download <code>calicoctl<\/code> and use it to set up the cluster on each host. The <code>ETCD_AUTHORITY<\/code> variable will remain the same on each host, however <code>NODE_IP<\/code> should be the IP of the host.<\/p>\n<pre class=\" brush:php\">$ docker-machine ssh node-00\r\n...\r\ndocker $ wget http:\/\/www.projectcalico.org\/latest\/calicoctl\r\nConnecting to www.projectcalico.org (64.91.234.195:80)\r\nConnecting to www.projectcalico.org (64.91.234.195:80)\r\nConnecting to github.com (192.30.252.128:443)\r\nConnecting to github-cloud.s3.amazonaws.com (54.231.114.122:443)\r\ncalicoctl            100% |*******************************|  5428k  0:00:00 ETA\r\ndocker $ chmod +x calicoctl\r\ndocker $ sudo ETCD_AUTHORITY=192.168.99.100:2379 .\/calicoctl node --libnetwork --ip=$NODE_IP\r\nPulling Docker image calico\/node:v0.14.0\r\n\r\nCalico node is running with id: 3cb0b50060d2bf423bd22f51ec30b9408bf5d199f631a70da7ca340902e7e134\r\nPulling Docker image calico\/node-libnetwork:v0.7.0\r\n\r\nCalico libnetwork driver is running with id: a8a9e8bd63e2540de76fb89fc40e31652b2df08392366046d3304626387e5b01\r\ndocker $ sudo  ETCD_AUTHORITY=192.168.99.100:2379  .\/calicoctl status\r\ncalico-node container is running. Status: Up 7 minutes\r\nRunning felix version 1.3.0rc6\r\n\r\nIPv4 BGP status\r\nIP: 192.168.99.100    AS Number: 64511 (inherited)\r\n+--------------+-----------+-------+-------+------+\r\n| Peer address | Peer type | State | Since | Info |\r\n+--------------+-----------+-------+-------+------+\r\n+--------------+-----------+-------+-------+------+\r\n\r\nIPv6 BGP status\r\nNo IPv6 address configured.<\/pre>\n<p>This needs to be run on every host, using the relevant host IP. Once this is done, <code>calicotl<\/code> should list all connected nodes.<\/p>\n<pre class=\" brush:php\">docker $ sudo ETCD_AUTHORITY=192.168.99.100:2379 .\/calicoctl status\r\ncalico-node container is running. Status: Up 19 seconds\r\nRunning felix version 1.3.0rc6\r\n\r\nIPv4 BGP status\r\nIP: 192.168.99.102    AS Number: 64511 (inherited)\r\n+----------------+-------------------+-------+----------+-------------+\r\n|  Peer address  |     Peer type     | State |  Since   |     Info    |\r\n+----------------+-------------------+-------+----------+-------------+\r\n| 192.168.99.100 | node-to-node mesh |   up  | 23:38:29 | Established |\r\n| 192.168.99.101 | node-to-node mesh |   up  | 23:38:30 | Established |\r\n+----------------+-------------------+-------+----------+-------------+\r\n\r\nIPv6 BGP status\r\nNo IPv6 address configured.<\/pre>\n<h3>Configure your Docker hosts<\/h3>\n<p>Before we can set up a Swarm, we need to reconfigure each host to use the same cluster store as Calico.<\/p>\n<p>This is complicated by the fact we are using boot2docker. However we can still reconfigure our Docker initialization parameters with an external cluster store. We can do this by adding a <code>--cluster-store<\/code> argument to <code>\/var\/lib\/boot2docker\/profile<\/code>.<\/p>\n<pre class=\" brush:php\">$ cat &lt;&lt;EOF &gt; profile.new\r\n\r\nEXTRA_ARGS='\r\n--label provider=virtualbox\r\n--cluster-store=etcd:\/\/192.168.99.100:2379\r\n'\r\nCACERT=\/var\/lib\/boot2docker\/ca.pem\r\nDOCKER_HOST='-H tcp:\/\/0.0.0.0:2376'\r\nDOCKER_STORAGE=aufs\r\nDOCKER_TLS=auto\r\nSERVERKEY=\/var\/lib\/boot2docker\/server-key.pem\r\nSERVERCERT=\/var\/lib\/boot2docker\/server.pem\r\n\r\nEOF\r\n$ sudo chown root:root profile.new &amp;&amp; sudo mv profile.new \/var\/l\r\nib\/boot2docker\/profile &amp;&amp; sudo \/etc\/init.d\/docker restart<\/pre>\n<p>Now your Docker hosts are configured to use the same cluster store as Calico.<\/p>\n<h3>Setting up a Swarm<\/h3>\n<p>Just like with the simple Swarm example, we first need to create a cluster token and then Swarm nodes and a manager.<\/p>\n<p>If you plan on deploying Swarm in a production environment, be sure to read the Swarm docs on <a href=\"https:\/\/docs.docker.com\/swarm\/discovery\/\">discovery methods<\/a> and use something other than the standard Swarm token service.<\/p>\n<p>Starting Swarm nodes is fairly standard. However we need to configure the manager with TLS enabled and mount the generated boot2docker certificates when starting the container.<\/p>\n<p>Keep in mind that in this configuration the Swarm manager is a single point of failure. For production environments, be sure to follow the <a href=\"https:\/\/docs.docker.com\/swarm\/multi-manager-setup\/\">Swarm docs on HA deployments<\/a>.<\/p>\n<pre class=\" brush:php\">$ docker run --rm swarm create\r\n938891a526e627d6ab11dd2e92cb8694\r\n$ docker-machine ls\r\nNAME      ACTIVE   DRIVER       STATE     URL                         SWARM\r\nnode-00   -        virtualbox   Running   tcp:\/\/192.168.99.100:2376   \r\nnode-01   -        virtualbox   Running   tcp:\/\/192.168.99.101:2376   \r\nnode-02   *        virtualbox   Running   tcp:\/\/192.168.99.102:2376  \r\n$ eval $(docker-machine env node-00)\r\n$ docker run -d swarm join --addr=192.168.99.100:2376 token:\/\/938891a526e627d6ab11dd2e92cb8694\r\n$ eval $(docker-machine env node-01)\r\n$ docker run -d swarm join --addr=192.168.99.101:2376 token:\/\/938891a526e627d6ab11dd2e92cb8694\r\n$ eval $(docker-machine env node-02)\r\n$ docker run -d swarm join --addr=192.168.99.102:2376 token:\/\/938891a526e627d6ab11dd2e92cb8694\r\n$ docker run -dp 2377:2375 -v \/var\/lib\/boot2docker:\/var\/lib\/boot2docker swarm manage --tlsverify --tlscert \/var\/lib\/boot2docker\/server.pem --tlscacert \/var\/lib\/boot2docker\/ca.pem --tlskey \/var\/lib\/boot2docker\/server-key.pem token:\/\/938891a526e627d6ab11dd2e92cb8694<\/pre>\n<p>At this point, we have a Swarm manager with control over all nodes in the cluster, available via <code>192.168.99.102:2377<\/code>. From here, we can follow the standard steps to test Docker Swarm and Calico listed in the <a href=\"https:\/\/github.com\/projectcalico\/calico-containers\/blob\/master\/docs\/calico-with-docker\/docker-network-plugin\/CalicoSwarm.md\">Calico tutorial<\/a>.<\/p>\n<p>Rather than using the -H flag, you can also just redefine the DOCKER_HOST variable to specify the Swarm endpoint. Be sure to check your etcd cluster store to make sure it\u2019s still running; restarting the Docker service may not have automatically started it.<\/p>\n<pre class=\" brush:php\">$ eval $(docker-machine env node-02)\r\n$ export DOCKER_HOST=tcp:\/\/192.168.99.102:2377\r\n$ docker ps\r\nfe3fcff4e0d2        calico\/node-libnetwork:v0.7.0   \".\/start.sh\"             About an hour ago   Up 56 minutes                                                                     node-02\/calico-libnetwork\r\n83a472b3ba65        calico\/node:v0.14.0             \"\/sbin\/start_runit\"      About an hour ago   Up 56 minutes                                                                     node-02\/calico-node\r\ndbe7968c4707        calico\/node-libnetwork:v0.7.0   \".\/start.sh\"             About an hour ago   Up 53 minutes                                                                     node-01\/calico-libnetwork\r\n4bddb4e3d6b4        calico\/node:v0.14.0             \"\/sbin\/start_runit\"      About an hour ago   Up 53 minutes                                                                     node-01\/calico-node\r\na8a9e8bd63e2        calico\/node-libnetwork:v0.7.0   \".\/start.sh\"             About an hour ago   Up 54 minutes                                                                     node-00\/calico-libnetwork\r\n3cb0b50060d2        calico\/node:v0.14.0             \"\/sbin\/start_runit\"      About an hour ago   Up 54 minutes                                                                     node-00\/calico-node\r\n3c9092601f5a        quay.io\/coreos\/etcd             \"\/etcd -advertise-cli\"   2 hours ago         Up About a minute   2380\/tcp, 4001\/tcp, 192.168.99.100:2379-&gt;2379\/tcp, 7001\/tcp   node-00\/boring_panini<\/pre>\n<p>It is also simpler to manage your Calico cluster by directly executing commands inline via <code>docker-machine ssh<\/code>, which can be aliased in Bash or scripted. But keep in mind that any time your Docker Machine needs to be restarted, you\u2019ll need to re-download the <code>calicoctl<\/code> binary.<\/p>\n<pre class=\" brush:php\">$ docker-machine ssh node-00 sudo ETCD_AUTHORITY=192.168.99.100:2379 .\/calicoctl pool show\r\n\r\n+----------------+---------+\r\n|   IPv4 CIDR    | Options |\r\n+----------------+---------+\r\n| 192.168.0.0\/16 |         |\r\n+----------------+---------+\r\n+--------------------------+---------+\r\n|        IPv6 CIDR         | Options |\r\n+--------------------------+---------+\r\n| fd80:24e2:f998:72d6::\/64 |         |\r\n+--------------------------+---------+<\/pre>\n<h3>Using Calico<\/h3>\n<p>Now that Calico is set up, what does that mean for your infrastructure and your applications?<\/p>\n<p>First of all, Calico is not an entirely self-managing service. Be sure to read the documentation thoroughly to ensure you are applying the correct base iptables rules and configuring your nodes in a sensible manner. It\u2019s important to understand what restrictions Calico brings to your infrastructure, as well as what it does and does not protect against. The <a href=\"http:\/\/docs.projectcalico.org\/en\/latest\/understanding.html\">Calico docs<\/a> provide information on these concerns.<\/p>\n<p>With the Calico libnetwork driver in place, you can manage networks and container IPs via the <code>docker network<\/code> interface. This means that after standard Calico node configuration, most operational changes required can be implemented through the libnetwork driver in much the same way such changes would be made using an overlay network.<\/p>\n<h2>Conclusion<\/h2>\n<p>Calico can greatly enhance your Docker infrastructure by facilitating scale and providing a more full-featured SDN than a standard overlay.<\/p>\n<p>With recent updates in Docker and Calico tooling, setting up and maintaining a cluster is far simpler, and running one in a highly available manner in production is well documented. As further tooling and integrations develops, we expect this process to be even more simplified and configurable.<\/p>\n<p>Calico provides a simple-to-implement container network, a highly scalable alternative to the standard overlay. By integrating with these networks via libnetwork and using a standard control interface, you can make it easy to switch Calico out for another network layer or connect different geographic regions as a single homogenous network.<\/p>\n<p>Before settling on Calcio, be sure to read up on its benefits and those of its alternatives such as <a href=\"https:\/\/github.com\/weaveworks\/weave\">Weave<\/a> and the standard overlay.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.codeship.com\/using-swarm-with-calico-on-docker-machine\/\">Using Swarm with Calico on Docker Machine<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started playing with Swarm and Calico \u2014 however the tooling and integration at that stage made it difficult to implement. Thanks to the hard work of contributors to both projects, the barrier &hellip;<\/p>\n","protected":false},"author":121,"featured_media":10356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[321,217,320],"class_list":["post-10624","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-calico","tag-docker","tag-swarm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using Swarm with Calico on Docker Machine - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Swarm with Calico on Docker Machine - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-05T14:11:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Brendan Fosberry\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brendanfosberry\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brendan Fosberry\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\"},\"author\":{\"name\":\"Brendan Fosberry\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1f4fc9c4817554c610890f685d463d77\"},\"headline\":\"Using Swarm with Calico on Docker Machine\",\"datePublished\":\"2016-02-05T14:11:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\"},\"wordCount\":1304,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"keywords\":[\"Calico\",\"Docker\",\"Swarm\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\",\"name\":\"Using Swarm with Calico on Docker Machine - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"datePublished\":\"2016-02-05T14:11:21+00:00\",\"description\":\"In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using Swarm with Calico on Docker Machine\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1f4fc9c4817554c610890f685d463d77\",\"name\":\"Brendan Fosberry\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1cc6c7714b253bea2b04d1f62633323f16a9609845b4e3333dfdc69cfa28213b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1cc6c7714b253bea2b04d1f62633323f16a9609845b4e3333dfdc69cfa28213b?s=96&d=mm&r=g\",\"caption\":\"Brendan Fosberry\"},\"description\":\"Brendan Fosberry is a software engineer at @codeship. He has a background in Datacenter Automation and Docker services and can usually be found fiddling in Go, Ruby or C#.\",\"sameAs\":[\"http:\/\/blog.codeship.com\/\",\"https:\/\/x.com\/brendanfosberry\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/brendan-fosberry\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Swarm with Calico on Docker Machine - Web Code Geeks - 2026","description":"In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/","og_locale":"en_US","og_type":"article","og_title":"Using Swarm with Calico on Docker Machine - Web Code Geeks - 2026","og_description":"In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2016-02-05T14:11:21+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Brendan Fosberry","twitter_card":"summary_large_image","twitter_creator":"@brendanfosberry","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Brendan Fosberry","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/"},"author":{"name":"Brendan Fosberry","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1f4fc9c4817554c610890f685d463d77"},"headline":"Using Swarm with Calico on Docker Machine","datePublished":"2016-02-05T14:11:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/"},"wordCount":1304,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","keywords":["Calico","Docker","Swarm"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/","name":"Using Swarm with Calico on Docker Machine - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","datePublished":"2016-02-05T14:11:21+00:00","description":"In 2015, Docker announced their plugin system and revealed a list of early network and storage integrators. During Docker Global Hackday #3, we started","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/using-swarm-calico-docker-machine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Using Swarm with Calico on Docker Machine"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1f4fc9c4817554c610890f685d463d77","name":"Brendan Fosberry","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1cc6c7714b253bea2b04d1f62633323f16a9609845b4e3333dfdc69cfa28213b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1cc6c7714b253bea2b04d1f62633323f16a9609845b4e3333dfdc69cfa28213b?s=96&d=mm&r=g","caption":"Brendan Fosberry"},"description":"Brendan Fosberry is a software engineer at @codeship. He has a background in Datacenter Automation and Docker services and can usually be found fiddling in Go, Ruby or C#.","sameAs":["http:\/\/blog.codeship.com\/","https:\/\/x.com\/brendanfosberry"],"url":"https:\/\/www.webcodegeeks.com\/author\/brendan-fosberry\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/10624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/121"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=10624"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/10624\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/10356"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=10624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=10624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=10624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}