Continental Innovates with Rancher and Kubernetes
In this section, you’ll learn how to install an RKE Kubernetes cluster in Azure through Rancher.
First, you will set up your Azure cloud credentials in Rancher. Then you will use your cloud credentials to create a node template, which Rancher will use to provision new nodes in Azure.
Then you will create an Azure cluster in Rancher, and when configuring the new cluster, you will define node pools for it. Each node pool will have a Kubernetes role of etcd, controlplane, or worker. Rancher will install Kubernetes on the new nodes, and it will set up each node with the Kubernetes role defined by the node pool.
For more information on configuring the Kubernetes cluster that Rancher will install on the Azure nodes, refer to the RKE cluster configuration reference.
For more information on configuring Azure node templates, refer to the Azure node template configuration reference.
Before creating a node template in Rancher using a cloud infrastructure such as Azure, we must configure Rancher to allow the manipulation of resources in an Azure subscription.
To do this, we will first create a new Azure service principal (SP) in Azure Active Directory (AD), which, in Azure, is an application user who has permission to manage Azure resources.
The following is a template az cli script that you have to run for creating an service principal, where you have to enter your SP name, role, and scope:
az cli
az ad sp create-for-rbac \ --name="<Rancher ServicePrincipal name>" \ --role="Contributor" \ --scopes="/subscriptions/<subscription Id>"
The creation of this service principal returns three pieces of identification information, The application ID, also called the client ID, The client secret, and The tenant ID. This information will be used when you create a node template for Azure.
Result: You have created the cloud credentials that will be used to provision nodes in your cluster. You can reuse these credentials for other node templates, or in other clusters.
Creating a node template for Azure will allow Rancher to provision new nodes in Azure. Node templates can be reused for other clusters.
Use Rancher to create a Kubernetes cluster in Azure.
Result:
Your cluster is created and assigned a state of Provisioning. Rancher is standing up your cluster.
You can access your cluster after its state is updated to Active.
Active clusters are assigned two Projects:
Default
default
System
cattle-system
ingress-nginx
kube-public
kube-system
After creating your cluster, you can access it through the Rancher UI. As a best practice, we recommend setting up these alternate ways of accessing your cluster: