openshift-openstack
OpenShift Origin On OpenStack
Overview
The purpose of this documentation is to provide a reference guide for installing an HA’ed OpenShift Origin deployment on an OpenStack cloud infrastructure using the Openshift-Ansible deployment method, which is the basis for our TK8 installer for the OpenShift version.
This is aimed at enterprise environment, hence the need to include necessary components that meets this standard. If the interest is on stand-alone deployment there are several ways to do this, we implore the reader to check resources like mini-shift which can satisfy stand-alone deployments which are to used for testing or learning purposes.
Prerequisite
A working OpenStack environment is needed with support for LBaaS feature, any recent OpenStack version supports this, you should be fine with Mitaka and later versions.
The following softwares are needed to have a successful deployment, these must be installed on the Deployment host:
Ansible
Terraform
Python-netaddr
Jinja2
Basic Linux administration skill is needed.
DNS is needed for proper resolution of all the hostnames of the nodes including the domain name of the master and application endpoint URLs (the openshift router).
If name resolution fails, the installation will fail along the way.
Reference Architecture
N.B: The number of actual virtual machines will be different based on the final design architecture, the above is given as an example.
Below gives a brief description about the components:
Master Nova Hosts: These are the master virtual machines that are dedicated for the control aspects, this is where the controllers, APIs etc will reside, having more than one is highly encouraged for HA (even though they will not processing any payload services).
ETCD Nova Hosts: These are the virtual machines that will be dedicated to the key/value store, an odd number is required for quorum to be established.
Compute Nova Hosts: These are the virtual machines that will be dedicated for running the application containers.
Infrastructure Nova Hosts: These are the virtual machines that will be dedicated to running infrastructure services like the Docker registry and Openshift routing functionality.
LB: These are the load balancers that will be based on the LBaaS functionality of OpenStack. One LB is dedicated for the Master nodes (to access the GUI) while another is dedicated to the infrastructure nodes.
N.B: The Load Balancer for the infrastructure nodes only exposes HTTPS port, put this in mind when creating routers for your application endpoints.
Bastion Nova Host: This will be used as a jump host to the Openshift VMs, this is aligning with best security practices so that the VMs are not exposed directly to the internet. Also the actual installation will be initiated from here (i.e. it will be used as the deployment host).
Infrastructure Deployment
The infrastructure will be created using terraform, the following terraform modules are available:
Compute: Used to create the Nova compute VMs
Network: Used to create Neutron networks
IP: Used to create the needed floating IPs
LB: To create the Load balancers
Your OpenStack credentials will be needed, this will be used in the clouds.yaml
file (this is following the OpenStack recommended procedure for using your credentials to manage OpenStack).
Below are the steps to create the infrastructure nodes using terraform:
1; Clone the Openshift terraform github:
2; Edit the clouds.yaml
file with respect to your OpenStack credentials
3; Modify cluster.tfvars
with details about your OpenStack inventories like the flavour, external network name, Operating system image, proposed cluster name, path to your SSH public key, volume size, elb_api_fqdn (domain for the openshift master GUI access), openshift_master_default_subdomain (application endpoint via Openshift router), etc
4; Initialize terraform:
5; You can preview the changes that will be applied:
6; Create the infrastructure nodes:
Successful output should be similar to below snapshot:
7; Ensure you are able to resolve the all the node hostnames to their respective private IPs, the DNS solution is dependent on your specific environment.
On your DNS configure the master FQDN to resolve to the public IP of the master LB. Sample resolution is given below:
Also configure application URL endpoint FQDN to resolve to the public IP of the infrastructure node LB. Sample resolution is given below:
Openshift Origin Installation
The installation is done using Ansible with the respective playbooks. The steps are given below:
1; Clone the Openshift-Ansible repository:
N.B: Don’t clone the master branch, this is always been updated and it is very likely that it has not been tested properly, hence the reason to specify the release version.
2; Copy the hosts.ini
file from the openshift folder to /openshift-ansible/inventory/
(the terraform scripts will have helped out in filling out most of the parameters):
Make sure that your host.ini
file is aligned with the above example, the only thing that will different will be actual hostnames for the nodes which will be according to what you have configured in the clusters.tfvars
file.
If the node labels are not properly configured then you might end with a broken installation.
3; Prepare the nodes by running the NetworkManager and pre-requisite playbooks:
4; Finally initiate the installation of the Openshift cluster:
If everything goes on fine, you should an output like the one below:
Post-Installation
1; Check the status of the Openshift cluster:
2; Generate admin username/password (this will be done on the master node) that will be used to access the webpage:
Note: The tk8 cli doesn't support openshift yet due to some shortcomings by terraform to create the inventory file.
Last updated