Rancher provides a unified front end for multiple container orchestration frameworks and environments, giving you a “single pane of glass” for deploying containers wherever you need. The steps to follow for the creation of a GKE cluster on Rancher are as follows:
Login to google account and go to console.
Next, select the project you want to work on.
Click on the navigation tab on the top left of your screen. Select VM instances under Compute Engine. This redirects you to a screen displaying a list of all the available VM instances in the project.
Click on CREATE INSTANCE option.
Next, We need to provide the necessary details such as Instance Name, Region, Zone, Machine Configuration, Boot Disk (Choose Ubuntu 16.04 LTS as an OS image, Boot Disk Type as Standard Persistent Disk and size as 10 GB), Firewall(Allow HTTP/HTTPs Traffic) and click on Create.
Now, Wait for the VM instance to get created. Click on SSH as shown in the image below.
Run the following commands in SSH window.
sudo apt-get update -y
sudo apt-get install -qy docker.io
sudo apt get update -y
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher:latest
Now go to the VM instances list dashboard.Click on the External IP of respective VM as shown in the image below.
Clicking on the External IP will redirect us to Rancher Dashboard for creating the password and saving URL. Click on Continue.
Click on Save URL.
After saving the URL, you will be redirected to cluster dashboard.
Click on Add Cluster option present at the top left corner in the cluster dashboard.
We need to specify the hosted Kubernetes provider. Click on Google GKE.
Now, enter the cluster name and give the service account private key JSON file. Click on Next: Configure Nodes.
Fill in the Kubernetes Options details such as location type, zone, kubernetes version etc.
Fill in the Node Options details such as Node Count, Machine Type, Image Type, Root Disk Type, Root Disk Size etc.
Click on Create.
You will see that the cluster is getting provisioned and is active after a few minutes.