Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First make sure you have the OpenStack command-line tools installed. These instructions will detail how.and Docker installed.

Next, install the python-magnumclient package:

...


Code Block
languagebash
$ openstack server list -c Name -c Networks
+---------------------------------------------+---------------------------------------------------------------------------+
| Name                                        | Networks                                                                  |
+---------------------------------------------+---------------------------------------------------------------------------+
| swarm-cluster-aq5dpyxwpte5-node-1           | default=2605:fd00:4:1000:f816:3eff:feb5:293d, 10.1.2.187                  |
| swarm-cluster-aq5dpyxwpte5-node-0           | default=2605:fd00:4:1000:f816:3eff:fe09:ca6a, 10.1.2.188                  |
| swarm-cluster-aq5dpyxwpte5-node-2           | default=2605:fd00:4:1000:f816:3eff:fe15:8882, 10.1.2.185                  |
| swarm-cluster-aq5dpyxwpte5-primary-master-0 | default=2605:fd00:4:1000:f816:3eff:fe2a:b323, 10.1.2.184, 162.246.156.5   |


Note either the Floating IP (162.246.156.5 in the example above) or the IPv6 address of the Master node. Then do:

Code Block
languagebash
$ export DOCKER_HOST=tcp://162.246.156.5:2375


After that, you now have access to a fully functional Docker Swarm cluster:

NoteMake sure you have Docker installed on your workstation! https

:

//docs.docker.com/install/



Code Block
languagebash
$ docker node ls
ID                            HOSTNAME                                                STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
jqm3pmupwxlcdy4bodp3ak7n2     swarm-cluster-aq5dpyxwpte5-node-0.novalocal             Ready               Active                                  1.13.1
qseo32fewgiprqqxmf9otg7mb     swarm-cluster-aq5dpyxwpte5-node-1.novalocal             Ready               Active                                  1.13.1
vegmr4raoiyq4j5upkvy9o6pi     swarm-cluster-aq5dpyxwpte5-node-2.novalocal             Ready               Active                                  1.13.1
zpgho4soqk3qk74dbrny3r4es *   swarm-cluster-aq5dpyxwpte5-primary-master-0.novalocal   Ready               Active              Leader              1.13.1


$ docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
sha256:3e1764d0f546ceac4565547df2ac4907fe46f007ea229fd7ef2718514bcec35d: Pulling from docker.io/library/hello-world
9bb5a5d4561a: Pull complete
Digest: sha256:3e1764d0f546ceac4565547df2ac4907fe46f007ea229fd7ef2718514bcec35d
Status: Downloaded newer image for docker.io/hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.


$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
a375d7b710d8        hello-world         "/hello"            25 seconds ago      Exited (0) 23 seconds ago                       confident_kirch

Security Groups

By default, your COE cluster has a very strict security group configured. This is to prevent security incident mishaps such as accidentally publishing ElasticSearch, MongoDB, or similar services. When you want to make a service publicly accessible, edit your cluster's security group. You can see the group by doing the following:

Code Block
$ openstack security group list | grep cluster

| c22cd9ba-6098-42b9-8a36-ff00b48924b4 | swarm-cluster-aq5dpyxwpte5-secgroup_swarm_manager-rzqnqkkw4mfd |
| ee5d6145-373e-42bf-9b5d-57372f8f20a3 | swarm-cluster-aq5dpyxwpte5-secgroup_swarm_node-iyghtvtxxg3l    |

And then adding a rule to the "manager" group using either the command-line or dashboard.