The world of hosting is changing, and so is the world of application development. Today we are turning less and less to dedicated hosting for a single application, but more to build the infrastructure that will support it.
In this sense, we prefer to use an Iaas solution on dedicated “bare metal” for our application overlay than pure “bare metal” per service.
Application deployment missions pushed by developers must fit with the technology and logic of production. Which pipelines
should we use for our CI
, CD
?
This post will not aim at answering the question of the pipelines to be implemented, it will be a question of Ranching
, coupled with its Cattle
orchestrator, on Public Cloud OVH Openstack
.
Installation :
The installation of PCI
(Public Cloud) instances is the fastest step. We need to start with 5 instances:
- 1 LoadBalancer/ReverseProxy (
HA-Proxy
orNginx
) for €299 - 3 RancherServer in Cluster under
Galera
at 5€99 - 1 Node Worker (for our applications) at the price you want to put for your performance
#### LoadBalancer Nginx :
For Nginx installation, nothing very complex, a €2.99 instance will be more than enough since the only job of the server will be to forward the request to our rancher cluster.
The conf file will be :
|
|
Replace the upstream
by the ips of your servers.
Note that it is also possible to dockerize this service. This way, the day you put a second LB on the front end, there will only be one container to place on your instance.
Rancher installation :
For Rancher part, there are no great difficulties either. 5€99 instances will be more than enough for the needs.
I recommend the official Rancher documentation on this subject.
We will start by deploying on each Rancher server:
|
|
Then we will add the servers to each other via the UI. (Infrastructure > Hosts > Add Host)
You should get the following code to run on each node :
|
|
Once this step is done, it will then be possible to use the Galera
image proposed by Rancher (in the catalog) on our 3 servers.
A node will then be present on each server.
We will be able to initialize the cluster on a Galera node:
|
|
Then check on the other two servers that the basic entries are also present.
Then let’s stop one Rancher server and start it using Galera for persistence of its data :
|
|
Where :
|
|
Do the same for the other two servers so each Rancher launches using the Galera database.
Expected result:
It is possible to check if Rancher is clustered
via the UI in: Admin > High Availability.
Addition of Worker Nodes.
You now have your Rancher
cluster with a front-end LB, it is now possible to add Worker
nodes to your cluster.
It’s very easy to add them directly with the Rancher utility. Now it’s up to you to see which type of instance best suits your resource needs.
Rancher’s default environment uses the Cattle' orchestrator, so once your Workers nodes are configured, you can deploy your
Docker’ containers directly from your cluster.
Conclusion
The installation of a Rancher environment is fast, the Public Cloud OVH allows to quickly deploy the necessary instances of Rancher. The ease of use offered by the Rancher/Cattle duo allows an efficient and fluid commissioning.
We will see in a next article how to set up an HA environment with Kubernetes
, still under the OVH PCI and using the environment template proposed by Rancher.