The OpenShift Vagrant
project aims to make it easy to bring up a real OKD cluster by provisioning pre-configured Vagrantfile
of several major releases of OKD on your local machine.
- Host machine must have at least 4GB memory
- Oracle VirtualBox installed on your host machine
- Vagrant (2.0 or above) installed on your host machine
- Vagrant plugin
vagrant-hostmanager
must be installed
Currently this project pre-configured and support 3 major versions of the OKD, which are
But, it's very easy to customize the respected ansible hosts file in order to support other incoming major versions.
The Vagrantfile
uses Origin 3.10
and openshift-ansible release-3.10
branch by default. Feel free to adjust your versions by updating the following 2 variables in Vagrantfile:
OPENSHIFT_RELEASE
OPENSHIFT_ANSIBLE_BRANCH
The following table lists the corresponding version relationships between Origin and openshift-ansible:
OKD version | openshift-ansible branch |
---|---|
3.11.x | release-3.11 |
3.10.x | release-3.10 |
3.9.x | release-3.9 |
3.7.x | release-3.7 |
3.6.x | release-3.6 |
After adjusting your expected version information, now it's time to bring your cluster up and running.
This Vagrantfile will create 3 VMs in VirtualBox and the network base will be specified by variable NETWORK_BASE
.
Checkout the table below for more details:
VM Node | Private IP | Roles |
---|---|---|
master | #{NETWORK_BASE}.101 | node, master, etcd |
node01 | #{NETWORK_BASE}.102 | node |
node02 | #{NETWORK_BASE}.103 | node |
$ vagrant up
$ vagrant provision --provision-with master-key,node01-key,node02-key
Run the following command if you would like to install origin previous to release-3.8:
$ vagrant ssh master -c 'ansible-playbook /home/vagrant/openshift-ansible/playbooks/byo/config.yml'
Run the following command for origin 3.8 or above:
vagrant ssh master \
-c 'ansible-playbook /home/vagrant/openshift-ansible/playbooks/prerequisites.yml &&
ansible-playbook /home/vagrant/openshift-ansible/playbooks/deploy_cluster.yml'
The above 3 steps have been grouped together as one script for you. To bring your cluster up, just use the following command:
$ ./oc-up.sh
In browser of your host, open the following page: https://master.example.com:8443/ and you should see OpenShift Web Console login page. The default login account is admin/handhand
Have fun with OKD and Vagrant :p