Running the Calico rkt tutorials on CoreOS Container Linux using Vagrant and VirtualBox
This is a Quick Start guide that uses Vagrant and VirtualBox to create a two-node Calico cluster that can be used to run through the tutorial for Calico in a pure rkt environment.
This section contains the requirements and steps required to ensure your local environment is correctly configured.
1. Install dependencies
You will need to install the following software:
2. Clone this project
Clone the calico project into a suitable location on your local host.
git clone https://github.com/projectcalico/calico.git
3. Startup and SSH
Change into the directory for this guide:
To start the cluster, run:
To connect to your servers:
- Linux/Mac OS X
vagrant ssh <hostname>
- Follow instructions from https://github.com/nickryand/vagrant-multi-putty
vagrant putty <hostname>
4. Verify environment
You should now have two CoreOS Container Linux servers. The servers are named calico-01 and calico-02 and have IP addresses 172.18.18.101 and 172.18.18.102.
At this point, it’s worth checking that your servers can ping each other.
If you see ping failures, the likely culprit is a problem with the VirtualBox network between the VMs. You should
check that each host is connected to the same virtual network adapter in VirtualBox and rebooting the host may also
help. Remember to shut down the VMs with
vagrant halt before you reboot.
You should also verify each host can access etcd. The following will return an error if etcd is not available.
curl -L http://172.18.18.101:2379/version
rkt is running on both hosts by running
sudo rkt list
calicoctl (the Calico CLI) is installed by running
5. Start the Calico service
Start the Calico service on both hosts
sudo rkt run --stage1-path=/usr/share/rkt/stage1-fly.aci \ --set-env=ETCD_ENDPOINTS=http://172.18.18.101:2379 \ --insecure-options=image \ --volume=birdctl,kind=host,source=/var/run/calico,readOnly=false \ --mount=volume=birdctl,target=/var/run/calico \ --volume=mods,kind=host,source=/lib/modules,readOnly=false \ --mount=volume=mods,target=/lib/modules \ --volume=logs,kind=host,source=/var/log/calico,readOnly=false \ --mount=volume=logs,target=/var/log/calico \ --set-env=IP=autodetect \ --net=host \ quay.io/calico/node:v1.0.2 &
This will create a calico/node rkt container.
You can check that it’s running using
sudo rkt list.
$ sudo rkt list UUID APP IMAGE NAME STATE CREATED STARTED NETWORKS b52bba11 node quay.io/calico/node:v1.0.2 running 10 seconds ago 10 seconds ago
Try out Calico networking
Now that you have a basic two node CoreOS Container Linux cluster setup, see the Basic Network Isolation guide for an example of managing Calico policy with your rkt containers.