Deploying OpenShift to the cloud as opposed to bare metal, is an ideal way to get up and going quickly, being particularly well suited to development and test environments where instant resource availability and flexibility is key. A great way to smooth the path to a successful OpenShift deployment is by using automation.
Deploying OpenShift to the cloud as opposed to bare metal, is an ideal way to get up and going quickly, being particularly well suited to development and test environments where instant resource availability and flexibility is key.
A great way to smooth the path to a successful OpenShift deployment is by using automation. You can use your favourite automation tool such as Ansible, Puppet, Chef or Terraform/Vagrant along with your cloud’s API e.g. CloudStack API or vCloud API to create ready-to-go node VMs with the correct sizing and storage, in a reproducible manner. Or, you can use your cloud’s templating facility (e.g. a vApp in VMware) to save a node VM and roll out copies as required.
As Alexander Graham Bell once said, “Before anything else, preparation is the key to success”. This certainly applies when preparing node VMs for an OpenShift deployment. Let’s say you’ve created your deployer VM with the OpenShift Ansible package installed and you’re ready to roll out a cluster with two masters and four nodes. You could manually create your nodes, but this is prone to error with all the fiddly steps involved. A poorly setup VM can cause all sorts of problems at various points during the OpenShift installation, which can be very difficult to debug and can require a tear-down and a fresh start. The official Red Hat documentation devotes quite some space to node preparation including SSH keys, DNS, Docker and much more. See for example here.
One automation method we have created at Safe Swiss Cloud is actually a combination of cloud templating and Ansible playbooks. The template is a copy of a VM which was prepared in line with the Red Hat host preparation requirements. The playbook creates and launches the VMs according to user defined node definitions (masters, nodes) in the standard Ansible hosts inventory file. Once the node VMs are up and running, the standard ‘play’
ansible-playbook -i /path/to/hosts /path/to/openshift-ansible/playbooks/byo/config.yml
deploys the OpenShift cluster.
At Safe Swiss Cloud, we aim to make life easier by providing deployer and node templates together with automation scripts. Naturally, when performance maximization is key, the same automation tools can also be used to deploy OpenShift onto bare metal. I’m looking forward to be covering this in a future blog post.
Until next time,
David Poole, Safe Swiss Cloud
Kubernetes at Safe Swiss Cloud
Learn more about the Kubernetes/OpenShift distribution as implemented at Safe Swiss Cloud