The guide uses command line tools to provision an AKS cluster with an ingress. If you prefer to provision your cluster using the Azure portal, refer to the official documentation.
If you already have an AKS Kubernetes cluster, skip to the step about Then install the Rancher Helm chart following the instructions on this page.
Prerequisites
- Microsoft Azure Account: A Microsoft Azure Account is required to create resources for deploying Rancher and Kubernetes.
- : Use this link to follow a tutorial to create a Microsoft Azure subscription if you don’t have one yet.
- Micsoroft Azure Tenant: Use this link and follow instructions to create a Microsoft Azure tenant.
1. Prepare your Workstation
Install the following command line tools on your workstation:
- The Azure CLI, az: For help, refer to these installation steps.
- kubectl: For help, refer to these
- helm: For help, refer to these installation steps.
2. Create a Resource Group
After installing the CLI, you will need to log in with your Azure account.
Create a resource group to hold all relevant resources for your cluster. Use a location that applies to your use case.
3. Create the AKS Cluster
The cluster will take some time to be deployed.
4. Get Access Credentials
After the cluster is deployed, get the access credentials.
az aks get-credentials --resource-group rancher-rg --name rancher-server
This command merges your cluster’s credentials into the existing kubeconfig and allows kubectl
to interact with the cluster.
5. Install an Ingress
The cluster needs an Ingress so that Rancher can be accessed from outside the cluster. Installing an Ingress requires allocating a public IP address. Ensure you have sufficient quota, otherwise it will fail to assign the IP address. Limits for public IP addresses are applicable at a regional level per subscription.
The following command installs an with a Kubernetes load balancer service.
6. Get Load Balancer IP
To get the address of the load balancer, run:
Save the EXTERNAL-IP
.
7. Set up DNS
External traffic to the Rancher server will need to be directed at the load balancer you created.
Set up a DNS to point at the that you saved. This DNS will be used as the Rancher server URL.
There are many valid ways to set up the DNS. For help, refer to the Azure DNS documentation
8. Install the Rancher Helm Chart
Next, install the Rancher Helm chart by following the instructions on this page. The Helm instructions are the same for installing Rancher on any Kubernetes distribution.
Use that DNS name from the previous step as the Rancher server URL when you install Rancher. It can be passed in as a Helm option. For example, if the DNS name is rancher.my.org
, you could run the Helm installation command with the option --set hostname=rancher.my.org
.