For full information regarding the Rancher installation you can refer to the official documentation.
You can install Rancher within your OpenNebula cloud by using one of the following options:
Once the machine is created, you can proceed to install the Rancher server on the Docker host using the following command:
$ docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest
For all the different options to run Rancher on a single Docker Host, you can check the Rancher documentation
For production environments, it is recommended to install Rancher in a high-availability configuration. When installed in a Kubernetes cluster, Rancher will integrate with the cluster’s etcd database and take advantage of Kubernetes scheduling for high-availability.
Rancher can be installed on a Kubernetes Single Node or on a multiple-node Kubernetes Clusters using Helm.
Once you setup a Kubernetes cluster within OpenNebula you can follow the documentation to install Rancher on a Kubernetes Cluster by using Helm.
Adding OpenNebula Provider to Rancher
Once Rancher is up and running, you can connect to it and bring up the Rancher UI.
To add OpenNebula as a provider to Rancher, we need to add the OpenNebula docker machine driver to the Rancher Node Drivers that are used to provision hosts which Rancher uses to launch and manage Kubernetes clusters.
A Linux binary of the OpenNebula machine driver is available at https://github.com/OpenNebula/docker-machine-opennebula/releases/download/release-0.2.0/docker-machine-driver-opennebula.tgz.
Once you added the OpenNebula docker machine driver, it should be active and available in Rancher for creating Kubernetes Clusters.
Create OpenNebula Kubernetes Clusters
In order to deploying Kubernetes clusters with Rancher on OpenNebula, you need to add node templates
In the node template, select the OpenNebula driver, and insert in the available options at the least the following ones:
- Authentication: user, password
- OpenNebula endpoint: xmlrpcurl (http://one:2633/RPC2)
Once you have created the OpenNebula node templates
you can proceed to create the first OpenNebula Kubernetes cluster in Rancher
Once the cluster has been provisioned, you can deploy containers on it using Rancher.