Skip to content

Commit f1b6a38

Browse files
authored
Merge pull request #4066 from btat/rke2-prov
Launch RKE2 + Azure
2 parents 877427c + fa82ee6 commit f1b6a38

File tree

2 files changed

+190
-8
lines changed
  • content/rancher/v2.6/en/cluster-provisioning/rke-clusters/node-pools/azure

2 files changed

+190
-8
lines changed

content/rancher/v2.6/en/cluster-provisioning/rke-clusters/node-pools/azure/_index.md

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 2220
66

77
In this section, you'll learn how to install an [RKE]({{<baseurl>}}/rke/latest/en/) Kubernetes cluster in Azure through Rancher.
88

9-
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.
9+
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.
1010

1111
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.
1212

@@ -25,29 +25,31 @@ For more information on configuring Azure node templates, refer to the [Azure no
2525
- [Creating an Azure Cluster](#creating-an-azure-cluster)
2626

2727
# Preparation in Azure
28-
28+
2929
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.
3030

3131
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.
3232

3333
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:
34-
34+
3535
```
3636
az ad sp create-for-rbac \
3737
--name="<Rancher ServicePrincipal name>" \
3838
--role="Contributor" \
3939
--scopes="/subscriptions/<subscription Id>"
4040
```
41-
41+
4242
The creation of this service principal returns three pieces of identification information, *The application ID, also called the client ID*, and *The client secret*. This information will be used when you create a node template for Azure.
4343

4444
# Creating an Azure Cluster
4545

46+
{{% tabs %}}
47+
{{% tab "RKE" %}}
4648

4749
1. [Create your cloud credentials](#1-create-your-cloud-credentials)
4850
2. [Create a node template with your cloud credentials](#2-create-a-node-template-with-your-cloud-credentials)
4951
3. [Create a cluster with node pools using the node template](#3-create-a-cluster-with-node-pools-using-the-node-template)
50-
52+
5153
### 1. Create your cloud credentials
5254

5355
1. Click **☰ > Cluster Management**.
@@ -57,7 +59,7 @@ The creation of this service principal returns three pieces of identification in
5759
1. Enter your Azure credentials.
5860
1. Click **Create**.
5961

60-
**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.
62+
**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.
6163

6264
### 2. Create a node template with your cloud credentials
6365

@@ -82,17 +84,76 @@ Use Rancher to create a Kubernetes cluster in Azure.
8284
1. Use **Member Roles** to configure user authorization for the cluster. Click **Add Member** to add users that can access the cluster. Use the **Role** drop-down to set permissions for each user.
8385
1. Click **Create**.
8486

85-
**Result:**
87+
{{% /tab %}}
88+
{{% tab "RKE2" %}}
89+
90+
### 1. Create your cloud credentials
91+
92+
1. Click **☰ > Cluster Management**.
93+
1. Click **Cloud Credentials**.
94+
1. Click **Create**.
95+
1. Click **Azure**.
96+
1. Enter your Azure credentials.
97+
1. Click **Create**.
98+
99+
**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.
100+
101+
### 2. Create your cluster
102+
103+
Use Rancher to create a Kubernetes cluster in Azure.
104+
105+
1. Click **☰ > Cluster Management**.
106+
1. On the **Clusters** page, click **Create**.
107+
1. Toggle the switch to **RKE2/K3s**.
108+
1. Click **Azure**.
109+
1. Enter a **Cluster Name**.
110+
1. Create a machine pool for each Kubernetes role. Refer to the [best practices]({{<baseurl>}}/rancher/v2.6/en/cluster-provisioning/rke-clusters/node-pools#node-roles-in-rke2) for recommendations on role assignments and counts.
111+
1. For each machine pool, define the machine configuration. Refer to the [Azure machine configuration reference]({{<baseurl>}}/rancher/v2.6/en/cluster-provisioning/rke-clusters/node-pools/azure/azure-machine-config/) for information on configuration options.
112+
1. Use the **Cluster Configuration** to choose the version of Kubernetes that will be installed, what network provider will be used and if you want to enable project network isolation. For help configuring the cluster, refer to the [RKE2 cluster configuration reference.]({{<baseurl>}}/rancher/v2.6/en/cluster-admin/editing-clusters/rke2-config-reference/)
113+
1. Use **Member Roles** to configure user authorization for the cluster. Click **Add Member** to add users that can access the cluster. Use the **Role** drop-down to set permissions for each user.
114+
1. Click **Create**.
115+
116+
{{% /tab %}}
117+
{{% tab "RKE2 - Cluster Template" %}}
118+
119+
### 1. Create your cloud credentials
120+
121+
1. Click **☰ > Cluster Management**.
122+
1. Click **Cloud Credentials**.
123+
1. Click **Create**.
124+
1. Click **Azure**.
125+
1. Enter your Azure credentials.
126+
1. Click **Create**.
127+
128+
### 2. Add your cluster template
129+
130+
1. Follow these [instructions]({{<baseurl>}}/rancher/v2.6/en/admin-settings/cluster-templates/#adding-a-cluster-template-to-rancher) to add a cluster template to Rancher.
131+
132+
### 3. Create your cluster using a cluster template
133+
134+
1. Click **☰ > Cluster Management**.
135+
1. Under the **Use a Catalog Template to create a cluster** section, click **catalog-template**.
136+
1. Enter a name for the cluster.
137+
1. Select cloud credentials to use.
138+
1. Select the **Infrastructure Provider**. If you are using Rancher's [example cluster templates](https://github.com/rancher/cluster-template-examples), select `azure`.
139+
1. Choose a **Kubernetes Version**.
140+
1. Configure your nodepools. For help with configurations, refer to [Azure Node Template Configuration.](./azure-node-template-config)
141+
1. Click **Install**.
142+
143+
{{% /tabs %}}
144+
145+
**Result:**
86146

87147
Your cluster is created and assigned a state of **Provisioning**. Rancher is standing up your cluster.
88148

89149
You can access your cluster after its state is updated to **Active**.
90150

91-
**Active** clusters are assigned two Projects:
151+
**Active** clusters are assigned two Projects:
92152

93153
- `Default`, containing the `default` namespace
94154
- `System`, containing the `cattle-system`, `ingress-nginx`, `kube-public`, and `kube-system` namespaces
95155

156+
96157
### Optional Next Steps
97158

98159
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:
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: Azure Machine Configuration
3+
weight: 2
4+
---
5+
6+
For more information about Azure, refer to the official [Azure documentation.](https://docs.microsoft.com/en-us/azure/?product=featured)
7+
8+
### Environment
9+
10+
Microsoft provides multiple [clouds](https://docs.microsoft.com/en-us/cli/azure/cloud?view=azure-cli-latest) for compliance with regional laws, which are available for your use:
11+
12+
- AzurePublicCloud
13+
- AzureGermanCloud
14+
- AzureChinaCloud
15+
- AzureUSGovernmentCloud
16+
17+
### Location
18+
19+
Configure the cluster and node [location](https://docs.microsoft.com/en-us/azure/virtual-machines/regions).
20+
21+
### Resource Group
22+
23+
A resource group is a container that holds related resources for an Azure solution. The resource group can include all the resources for the solution, or only those resources that you want to manage as a group. You decide how you want to allocate resources to resource groups based on what makes the most sense for your organization. Generally, add resources that share the same lifecycle to the same resource group so you can easily deploy, update, and delete them as a group.
24+
25+
Use an existing resource group or enter a resource group name and one will be created for you.
26+
27+
For information on managing resource groups, see the [Azure documentation.](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal)
28+
29+
### Availability Set (unmanaged)
30+
31+
Name or ID of an existing [availability set](https://docs.microsoft.com/en-us/azure/virtual-machines/availability-set-overview) to add the VM to.
32+
33+
### Image
34+
35+
The name of the operating system image provided as an ARM resource identifier. Requires using managed disk.
36+
37+
### VM Size
38+
39+
Choose a size for each VM in the node pool. For details about each VM size, see [this page.](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/)
40+
41+
## Advanced Options
42+
43+
### Fault Domain Count
44+
45+
Fault domains define the group of virtual machines that share a common power source and network switch. If the availability set has already been created, the fault domain count will be ignored.
46+
47+
For more information on fault domains, see [refer here](https://docs.microsoft.com/en-us/azure/virtual-machines/availability-set-overview#how-do-availability-sets-work).
48+
49+
### Update Domain Count
50+
51+
Update domains indicate groups of virtual machines and underlying physical hardware that can be rebooted at the same time. If the availability set has already been created, the update domain count will be ignored.
52+
53+
For more information on update domains, see [refer here](https://docs.microsoft.com/en-us/azure/virtual-machines/availability-set-overview#how-do-availability-sets-work).
54+
55+
### Purchase Plan
56+
57+
Some VM images in the Azure Marketplace require a plan. If applicable, select a purchase plan, formatted as `publisher:product:plan`, to use with your chosen image.
58+
59+
### Subnet
60+
61+
The name of the subnet when creating a new VNet or referencing an existing one.
62+
63+
Default: `docker-machine`
64+
65+
### Subnet Prefix
66+
67+
The subnet IP address prefix to use when creating a new VNet in CIDR format.
68+
69+
Default: `192.168.0.0/16`
70+
71+
### Virtual Network
72+
73+
The [virtual network](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview) to use or create if one does not exist. Formatted as `[resourcegroup:]name`.
74+
75+
### Public IP Options
76+
77+
#### No Public IP
78+
79+
Do not allocate a public IP address.
80+
81+
#### Static Public IP
82+
83+
Allocate a static public IP address.
84+
85+
### Use Private IP
86+
87+
Use a static private IP address.
88+
89+
### Private IP Address
90+
91+
Configure a static private IP address to use.
92+
93+
### Network Security Group
94+
95+
The [network security group](https://docs.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) to use. All nodes using this template will use the supplied network security group. If no network security group is provided, a new one will be created for each node.
96+
97+
### DNS Label
98+
99+
A unique DNS name label for the public IP address.
100+
101+
### Storage Type
102+
103+
The [storage account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview) type to use with your VMs. Options include Standard LRS, Standard ZRS, Standard GRS, Standard RAGRS, and Premium LRS.
104+
105+
### Use Managed Disks
106+
107+
[Azure managed disks](https://docs.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview) are block-level storage volumes that are managed by Azure and used with Azure Virtual Machines. Managed disks are designed for 99.999% availability. Managed disks achieve this by providing you with three replicas of your data, allowing for high durability.
108+
109+
### Managed Disk Size
110+
111+
The size in GB for the disk for each node.
112+
113+
### SSH Username
114+
115+
The username used to create an SSH connection to your nodes.
116+
117+
### Open Port
118+
119+
Opens inbound traffic on specified ports. When using an existing Network Security Group, Open Ports are ignored.
120+
121+
Default: `2379/tcp, 2380/tcp, 6443/tcp, 9796/tcp, 10250/tcp, 10251/tcp, 10252/tcp, 10256/tcp` and `8472/udp, 4789/udp`

0 commit comments

Comments
 (0)