Skip to content

Commit 70e2b72

Browse files
Merge pull request #220128 from schaffererin/freshness-pass-deploy-cluster
Freshness pass: Deploy an AKS cluster tutorial
2 parents 810d424 + 90b2715 commit 70e2b72

File tree

1 file changed

+42
-33
lines changed

1 file changed

+42
-33
lines changed

articles/aks/tutorial-kubernetes-deploy-cluster.md

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Kubernetes on Azure tutorial - Deploy a cluster
33
description: In this Azure Kubernetes Service (AKS) tutorial, you create an AKS cluster and use kubectl to connect to the Kubernetes master node.
44
services: container-service
55
ms.topic: tutorial
6-
ms.date: 05/24/2021
6+
ms.date: 12/01/2022
77

88
ms.custom: mvc, devx-track-azurecli, devx-track-azurepowershell
99

@@ -12,38 +12,38 @@ ms.custom: mvc, devx-track-azurecli, devx-track-azurepowershell
1212

1313
# Tutorial: Deploy an Azure Kubernetes Service (AKS) cluster
1414

15-
Kubernetes provides a distributed platform for containerized applications. With AKS, you can quickly create a production ready Kubernetes cluster. In this tutorial, part three of seven, a Kubernetes cluster is deployed in AKS. You learn how to:
15+
Kubernetes provides a distributed platform for containerized applications. With AKS, you can quickly create a production ready Kubernetes cluster. In this tutorial, part three of seven, you deploy a Kubernetes cluster in AKS. You learn how to:
1616

1717
> [!div class="checklist"]
18-
> * Deploy a Kubernetes AKS cluster that can authenticate to an Azure container registry
19-
> * Install the Kubernetes CLI (kubectl)
20-
> * Configure kubectl to connect to your AKS cluster
2118
22-
In later tutorials, the Azure Vote application is deployed to the cluster, scaled, and updated.
19+
> * Deploy a Kubernetes AKS cluster that can authenticate to an Azure Container Registry (ACR).
20+
> * Install the Kubernetes CLI, `kubectl`.
21+
> * Configure `kubectl` to connect to your AKS cluster.
2322
24-
## Before you begin
25-
26-
In previous tutorials, a container image was created and uploaded to an Azure Container Registry instance. If you haven't done these steps, and would like to follow along, start at [Tutorial 1 – Create container images][aks-tutorial-prepare-app].
23+
In later tutorials, you'll deploy the Azure Vote application to your AKS cluster and scale and update your application.
2724

28-
### [Azure CLI](#tab/azure-cli)
29-
30-
This tutorial requires that you're running the Azure CLI version 2.0.53 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
25+
## Before you begin
3126

32-
### [Azure PowerShell](#tab/azure-powershell)
27+
In previous tutorials, you created a container image and uploaded it to an ACR instance. If you haven't done these steps and would like to follow along, start with [Tutorial 1: Prepare an application for AKS][aks-tutorial-prepare-app].
3328

34-
This tutorial requires that you're running Azure PowerShell version 5.9.0 or later. Run `Get-InstalledModule -Name Az` to find the version. If you need to install or upgrade, see [Install Azure PowerShell][azure-powershell-install].
29+
* If you're using Azure CLI, this tutorial requires that you're running the Azure CLI version 2.0.53 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
30+
* If you're using Azure PowerShell, this tutorial requires that you're running Azure PowerShell version 5.9.0 or later. Run `Get-InstalledModule -Name Az` to find the version. If you need to install or upgrade, see [Install Azure PowerShell][azure-powershell-install].
3531

3632
---
3733

3834
## Create a Kubernetes cluster
3935

40-
AKS clusters can use Kubernetes role-based access control (Kubernetes RBAC). These controls let you define access to resources based on roles assigned to users. Permissions are combined if a user is assigned multiple roles, and permissions can be scoped to either a single namespace or across the whole cluster. By default, the Azure CLI automatically enables Kubernetes RBAC when you create an AKS cluster.
36+
AKS clusters can use [Kubernetes role-based access control (Kubernetes RBAC)][k8s-rbac], which allows you to define access to resources based on roles assigned to users. If a user is assigned multiple roles, permissions are combined. Permissions can be scoped to either a single namespace or across the whole cluster.
37+
38+
To learn more about AKS and Kubernetes RBAC, see [Control access to cluster resources using Kubernetes RBAC and Azure Active Directory identities in AKS][aks-k8s-rbac].
4139

4240
### [Azure CLI](#tab/azure-cli)
4341

44-
Create an AKS cluster using [az aks create][]. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region. The following example does not specify a region so the AKS cluster is also created in the *eastus* region. For more information, see [Quotas, virtual machine size restrictions, and region availability in Azure Kubernetes Service (AKS)][quotas-skus-regions] for more information about resource limits and region availability for AKS.
42+
Create an AKS cluster using [`az aks create`][az aks create]. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region. The AKS cluster will also be created in the *eastus* region.
43+
44+
For more information about AKS resource limits and region availability, see [Quotas, virtual machine size restrictions, and region availability in AKS][quotas-skus-regions].
4545

46-
To allow an AKS cluster to interact with other Azure resources, a cluster identity is automatically created, since you did not specify one. Here, this cluster identity is [granted the right to pull images][container-registry-integration] from the Azure Container Registry (ACR) instance you created in the previous tutorial. To execute the command successfully, you're required to have an **Owner** or **Azure account administrator** role on the Azure subscription.
46+
To allow an AKS cluster to interact with other Azure resources, a cluster identity is automatically created. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you're required to have an **Owner** or **Azure account administrator** role in your Azure subscription.
4747

4848
```azurecli
4949
az aks create \
@@ -56,9 +56,11 @@ az aks create \
5656

5757
### [Azure PowerShell](#tab/azure-powershell)
5858

59-
Create an AKS cluster using [New-AzAksCluster][new-azakscluster]. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region. The following example does not specify a region so the AKS cluster is also created in the *eastus* region. For more information, see [Quotas, virtual machine size restrictions, and region availability in Azure Kubernetes Service (AKS)][quotas-skus-regions] for more information about resource limits and region availability for AKS.
59+
Create an AKS cluster using [`New-AzAksCluster`][new-azakscluster]. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region. The AKS cluster will also be created in the *eastus* region.
6060

61-
To allow an AKS cluster to interact with other Azure resources, a cluster identity is automatically created, since you did not specify one. Here, this cluster identity is [granted the right to pull images][container-registry-integration] from the Azure Container Registry (ACR) instance you created in the previous tutorial. To execute the command successfully, you're required to have an **Owner** or **Azure account administrator** role on the Azure subscription.
61+
For more information about AKS resource limits and region availability, see [Quotas, virtual machine size restrictions, and region availability in AKS][quotas-skus-regions].
62+
63+
To allow an AKS cluster to interact with other Azure resources, a cluster identity is automatically created. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you're required to have an **Owner** or **Azure account administrator** role in your Azure subscription.
6264

6365
```azurepowershell
6466
New-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 2 -GenerateSshKey -AcrNameToAttach <acrName>
@@ -68,25 +70,26 @@ New-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCoun
6870

6971
To avoid needing an **Owner** or **Azure account administrator** role, you can also manually configure a service principal to pull images from ACR. For more information, see [ACR authentication with service principals](../container-registry/container-registry-auth-service-principal.md) or [Authenticate from Kubernetes with a pull secret](../container-registry/container-registry-auth-kubernetes.md). Alternatively, you can use a [managed identity](use-managed-identity.md) instead of a service principal for easier management.
7072

71-
After a few minutes, the deployment completes, and returns JSON-formatted information about the AKS deployment.
73+
After a few minutes, the deployment completes and returns JSON-formatted information about the AKS deployment.
7274

7375
> [!NOTE]
74-
> To ensure your cluster to operate reliably, you should run at least 2 (two) nodes.
76+
> To ensure your cluster operates reliably, you should run at least two nodes.
7577
7678
## Install the Kubernetes CLI
7779

78-
To connect to the Kubernetes cluster from your local computer, you use [kubectl][kubectl], the Kubernetes command-line client.
80+
Use the Kubernetes CLI, [`kubectl`][kubectl], to connect to the Kubernetes cluster from your local computer.
7981

8082
### [Azure CLI](#tab/azure-cli)
8183

82-
If you use the Azure Cloud Shell, `kubectl` is already installed. You can also install it locally using the [az aks install-cli][] command:
84+
If you use the Azure Cloud Shell, `kubectl` is already installed. You can also install it locally using the [`az aks install-cli`][az aks install-cli] command.
8385

8486
```azurecli
8587
az aks install-cli
8688
```
89+
8790
### [Azure PowerShell](#tab/azure-powershell)
8891

89-
If you use the Azure Cloud Shell, `kubectl` is already installed. You can also install it locally using the [Install-AzAksKubectl][install-azakskubectl] cmdlet:
92+
If you use the Azure Cloud Shell, `kubectl` is already installed. You can also install it locally using the [`Install-AzAksKubectl`][install-azakskubectl] cmdlet.
9093

9194
```azurepowershell
9295
Install-AzAksKubectl
@@ -98,23 +101,23 @@ Install-AzAksKubectl
98101

99102
### [Azure CLI](#tab/azure-cli)
100103

101-
To configure `kubectl` to connect to your Kubernetes cluster, use the [az aks get-credentials][] command. The following example gets credentials for the AKS cluster named *myAKSCluster* in the *myResourceGroup*:
104+
To configure `kubectl` to connect to your Kubernetes cluster, use the [`az aks get-credentials`][az aks get-credentials] command. The following example gets credentials for the AKS cluster named *myAKSCluster* in *myResourceGroup*.
102105

103106
```azurecli
104107
az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
105108
```
106109

107110
### [Azure PowerShell](#tab/azure-powershell)
108111

109-
To configure `kubectl` to connect to your Kubernetes cluster, use the [Import-AzAksCredential][import-azakscredential] cmdlet. The following example gets credentials for the AKS cluster named *myAKSCluster* in the *myResourceGroup*:
112+
To configure `kubectl` to connect to your Kubernetes cluster, use the [`Import-AzAksCredential`][import-azakscredential] cmdlet. The following example gets credentials for the AKS cluster named *myAKSCluster* in *myResourceGroup*.
110113

111114
```azurepowershell
112115
Import-AzAksCredential -ResourceGroupName myResourceGroup -Name myAKSCluster
113116
```
114117

115118
---
116119

117-
To verify the connection to your cluster, run the [kubectl get nodes][kubectl-get] command to return a list of the cluster nodes:
120+
To verify connection to your cluster, run [`kubectl get nodes`][kubectl-get] to return a list of cluster nodes.
118121

119122
```azurecli-interactive
120123
kubectl get nodes
@@ -132,21 +135,23 @@ aks-nodepool1-37463671-vmss000001 Ready agent 2m28s v1.18.10
132135

133136
## Next steps
134137

135-
In this tutorial, a Kubernetes cluster was deployed in AKS, and you configured `kubectl` to connect to it. You learned how to:
138+
In this tutorial, you deployed a Kubernetes cluster in AKS and configured `kubectl` to connect to the cluster. You learned how to:
136139

137140
> [!div class="checklist"]
138-
> * Deploy a Kubernetes AKS cluster that can authenticate to an Azure container registry
139-
> * Install the Kubernetes CLI (kubectl)
140-
> * Configure kubectl to connect to your AKS cluster
141+
>
142+
> * Deploy an AKS cluster that can authenticate to an ACR.
143+
> * Install the Kubernetes CLI, `kubectl`.
144+
> * Configure `kubectl` to connect to your AKS cluster.
141145
142-
Advance to the next tutorial to learn how to deploy an application to the cluster.
146+
In the next tutorial, you'll learn how to deploy an application to your cluster.
143147

144148
> [!div class="nextstepaction"]
145-
> [Deploy application in Kubernetes][aks-tutorial-deploy-app]
149+
> [Deploy an application in AKS][aks-tutorial-deploy-app]
146150
147151
<!-- LINKS - external -->
148152
[kubectl]: https://kubernetes.io/docs/user-guide/kubectl/
149153
[kubectl-get]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
154+
[k8s-rbac]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
150155

151156
<!-- LINKS - internal -->
152157
[aks-tutorial-deploy-app]: ./tutorial-kubernetes-deploy-application.md
@@ -165,3 +170,7 @@ Advance to the next tutorial to learn how to deploy an application to the cluste
165170
[new-azakscluster]: /powershell/module/az.aks/new-azakscluster
166171
[install-azakskubectl]: /powershell/module/az.aks/install-azaksclitool
167172
[import-azakscredential]: /powershell/module/az.aks/import-azakscredential
173+
[aks-k8s-rbac]: azure-ad-rbac.md
174+
[preset-config]: /quotas-skus-regions.md#cluster-configuration-presets-in-the-azure-portal
175+
[azure-managed-identities]: ../active-directory/managed-identities-azure-resources/overview.md
176+
[az-container-insights]: ../azure-monitor/containers/container-insights-overview.md

0 commit comments

Comments
 (0)