This vagrant file is provided strictly for demonstration purposes to help setup a cluster environment that installs Docker EE, UCP, and DTR with embedded DNS. This can be used as a demo environment on your local machine, when internet access is not present. The organization of this repo is as follows:
env
- where environment variables are stored and read for bringing up EE platformfiles
- configuration files for load balancers, etcscripts
- scripts executed by VagrantFileMakefile
- file used to create simple commands viamake
which invoke the Vagrant CLIVagrantfile
- file used to provisioning of infrastructure as invoked by Vagrant CLI
By default, after running make start
the following will be provisioned and installed:
- UCP node - UCP will be accessible from
https:\\ucp.local
resolved through DNS (login: docker / dockeradmin ), provisioned with 2.5 GB RAM and 2 CPU - DTR node - DTR will be accessible from
https:\\dtr.local
resolved through DNS, provisioned with 2 GB RAM and 2 CPU - 2 worker nodes (
worker-node1
andworker-node2
) - provisioned with 1GB RAM and 2 CPU each - Gitlab CE node (Optional) - Gitlab will be accessible from
https:\\gitlab.local
resolved through DNS, provisioned with 2.5 GB RAM and 2 CPU - Jenkins worker node (Optional) - worker node that runs Jenkins container, provisioned with 1GB RAM and 2 CPU each
This template will also setup the VMs with static ip addresses as follows (if IP addresses are already in use, change them inside of the Vagrantfile):
ucp
(UCP manager node): 172.28.128.31ucp-node2
(UCP manager node2): 172.28.128.32 - Optionalucp-node3
(UCP manager node3): 172.28.128.33 - Optionaldtr
(DTR replica): 172.28.128.34worker-node1
(Worker node): 172.28.128.35worker-node2
(Worker node): 172.28.128.36gitlab
(Gitlab node): 172.28.128.37 - Optionalhaproxy
(HA Proxy node): 172.28.128.30 - Optional, HAProxy Stats will be accessible fromhttps:\\haproxy.local:9000
(login:admin
/admin
)jenkins
(Jenkins node): 172.28.128.38 - Optional
DNS entries for landrush:
dtr.local
: 172.28.128.34ucp.local
: 172.28.128.31wordpress.local
: 172.28.128.35jenkins.local
: 172.28.128.35nodeapp.local
: 172.28.128.35visualizer.local
: 172.28.128.35gitlab.local
: 172.28.128.31
ee_url
ucp_username
For the ee_url
file make sure the format of the ee_url is like the following
https://storebits.docker.com/ee/linux/sub-xxx-xxx-xxx-xxx-xxx
docker_subscription.lic
-
Install vagrant-landrush plugin
vagrant plugin install landrush
vagrant plugin install vagrant-hostsupdater
If you are thinking of customizing the start up of the cluster (i.e. no DTR, HA UCP, etc) modify the Makefile
to describe the start
, stop
, and destroy
targets to manage certain nodes, if you only need a UCP manager node you can just edit the file to have the following entry for the start
target.
start:
@vagrant up haproxy ucp worker-node1 worker-node2
...
destroy:
@vagrant destroy -f ucp worker-node1 worker-node2
First lets set up a manager node to start our cluster, we'll use the ucp
target instead to build a cluster with both swarm and kubernetes workers. If you want to just provision UCP and two swarm workers, use the make start
target instead.
make ucp
You should now be able access UCP on https://ucp.local
and login with docker/dockeradmin
. Next, lets bring up kubernetes worker nodes by running the following commands to first set the orchestration mode to Kubernes and then provisioning and joining the kubernetes workers to the cluster.
# Switch orchestration to Kubernetes
make orch
# Provision and join workers
make workers
After setting up a swarm or kubernetes cluster with the previous commands, we'll go ahead and set up DTR. Before installing DTR, ensure that orchestration mode is set to Swarm. The following commands will first switch orchestration mode (back to Kubernetes from Swarm) and then provision a swarm worker node and install DTR.
# Switch orchestration mode to Swarm
make orch
# Provision node and install DTR
make dtr
-
- If you want to bring up a Gitlab CE node you can run the following command to bring up a VM that runs Gitlab CE without Docker
make gitlab
Then go login as
root
/5iveL!fe
and create an Access Token by to going to Settings -> Access Tokens and export the token as an environment variables.EXPORT GITLAB_TOKEN=<insert token>
- Run the following command to configure Gitlab with a new project and webhooks using the GITLAB_TOKEN
make config-gitlab
- After bringing up a Gitlab CE node you can then provision a Swarm node to run Jenkins on Docker EE.
make jenkins
You can SSH directly into the nodes by specifying the names of each Vagrant VM
vagrant ssh ucp
Take initial snapshot of nodes
make snap
Restore initial snapshot
make rollback
make stop
make destroy