Deploying Rancher 2.0 on Vagrant

A week ago Rancher Labs released (announcement) a technology preview of the What’s new, a container management platform built on Kubernetes. This post will drive you through the process to deploy without any effort a Rancher platform using Vagrant and VirtualBox.

Source: rancher.com

Details

I have never used Rancher before, so I wanted to try it on my MBP on some way but without the need to natively install Docker containers on it. Since I have been actively working with Vagrant the last month, I decide to develop a Vagrantfile with the following characteristics:

  • VirtualBox version 5.1.28
  • Vagrant version 2.0.0
    • Box: Ubuntu/Xenial64. I tried with CentOS 7 atomic and Ubuntu/Trusty64, but the platform was unstable with the core CNI-driver service.
    • Hostmanager plugin (pre-requisite)
  • Rancher version 2.0.0-alpha7
    • Single master server
      • 2x CPUs
      • 2GB memory (4GB recommended)
      • Linked clone
      • IP address 192.168.34.10
      • FQDN master.rancher.local
    • Two node servers
      • 1x CPU
      • 1GB memory
      • Linked clone
      • IP addresses 192.168.34.[11-254]
      • FQDN node[1-244].rancher.local

Usage

Download Rancher Vagrantfile

You can download the Vagrant file from my GitHub repo (GitHub pipoe2h repository). This Vagrantfile will create the platform above. Depending on your Internet speed and hardware performance the initial provisioning can take around 5-10 minutes for a single node (master is always included)

Initial deployment and scaling out

Once the initial provisioning has finished, you can access to your container platform on http://master.rancher.local:8080. You don’t need to manually add the nodes, they are automatically added during the initial provisioning. Also, if later on you scale your platform out changing the NODE_COUNT variable and re-run vagrant up, the new nodes will be also automatically added into your cluster.

Health

Before you start with the provisioning of any container, check that all the core and Kubernetes services are up and healthy. You can do it on http://master.rancher.local:8080/env/1a8/containers, or doing click on drop-down list on the right top corner with the value Default and choose System.

Next

I will be posting during the next weeks my evolution with this promising container management platform. So far and only with few hours of use, I have been able to provision Jenkins, Gitlab, Confluence and other many solutions that I need to test CI/CD for network automation.

If you have found this post interesting, don’t hesitate to share it!

1 thought on “Deploying Rancher 2.0 on Vagrant”

  1. Pingback: Deploying Rancher 2.0 on Vagrant | thechrisshort

Leave a Comment

Your email address will not be published. Required fields are marked *