You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/kubernetes-service-principal.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ The following sections detail common delegations that you may need to make.
91
91
92
92
### Azure Container Registry
93
93
94
-
If you use Azure Container Registry (ACR) as your container image store, you need to grant permissions for your AKS cluster to read and pull images. The service principal of the AKS cluster must be delegated the *Reader* role on the registry. For detailed steps, see [Grant AKS access to ACR][aks-to-acr].
94
+
If you use Azure Container Registry (ACR) as your container image store, you need to grant permissions to the service principal for your AKS cluster to read and pull images. Currently, the recommended configuration is to use the [az aks create][az-aks-create] or [az aks update][az-aks-update] command to integrate with a registry and assign the appropriate role for the service principal. For detailed steps, see [Authenticate with Azure Container Registry from Azure Kubernetes Service][aks-to-acr].
95
95
96
96
### Networking
97
97
@@ -175,6 +175,6 @@ For information on how to update the credentials, see [Update or rotate the cred
Copy file name to clipboardExpand all lines: articles/aks/tutorial-kubernetes-deploy-application.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ To see the application in action, open a web browser to the external IP address
113
113
114
114

115
115
116
-
If the application didn't load, it might be due to an authorization problem with your image registry. To view the status of your containers, use the `kubectl get pods` command. If the container images can't be pulled, see [allow access to Container Registry with a Kubernetes secret](https://docs.microsoft.com/azure/container-registry/container-registry-auth-aks#access-with-kubernetes-secret).
116
+
If the application didn't load, it might be due to an authorization problem with your image registry. To view the status of your containers, use the `kubectl get pods` command. If the container images can't be pulled, see [Authenticate with Azure Container Registry from Azure Kubernetes Service](cluster-container-registry-integration.md).
Copy file name to clipboardExpand all lines: articles/aks/tutorial-kubernetes-deploy-cluster.md
+6-48Lines changed: 6 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,7 @@ ms.custom: mvc
18
18
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:
19
19
20
20
> [!div class="checklist"]
21
-
> * Create a service principal for resource interactions
22
-
> * Deploy a Kubernetes AKS cluster
21
+
> * Deploy a Kubernetes AKS cluster that can authenticate to an Azure container registry
23
22
> * Install the Kubernetes CLI (kubectl)
24
23
> * Configure kubectl to connect to your AKS cluster
25
24
@@ -31,60 +30,19 @@ In previous tutorials, a container image was created and uploaded to an Azure Co
31
30
32
31
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].
33
32
34
-
## Create a service principal
35
-
36
-
To allow an AKS cluster to interact with other Azure resources, an Azure Active Directory service principal is used. This service principal can be automatically created by the Azure CLI or portal, or you can pre-create one and assign additional permissions. In this tutorial, you create a service principal, grant access to the Azure Container Registry (ACR) instance created in the previous tutorial, then create an AKS cluster.
37
-
38
-
Create a service principal using the [az ad sp create-for-rbac][] command. The `--skip-assignment` parameter limits any additional permissions from being assigned. By default, this service principal is valid for one year.
Make a note of the *appId* and *password*. These values are used in the following steps.
57
-
58
-
## Configure ACR authentication
59
-
60
-
To access images stored in ACR, you must grant the AKS service principal the correct rights to pull images from ACR.
61
-
62
-
First, get the ACR resource ID using [az acr show][]. Update the `<acrName>` registry name to that of your ACR instance and the resource group where the ACR instance is located.
63
-
64
-
```azurecli
65
-
az acr show --resource-group myResourceGroup --name <acrName> --query "id" --output tsv
66
-
```
67
-
68
-
To grant the correct access for the AKS cluster to pull images stored in ACR, assign the `AcrPull` role using the [az role assignment create][] command. Replace `<appId`> and `<acrId>` with the values gathered in the previous two steps.
69
-
70
-
```azurecli
71
-
az role assignment create --assignee <appId> --scope <acrId> --role acrpull
72
-
```
73
-
74
33
## Create a Kubernetes cluster
75
34
76
35
AKS clusters can use Kubernetes role-based access controls (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 RBAC when you create an AKS cluster.
77
36
78
-
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]. Provide your own `<appId>` and `<password>` from the previous step where the service principal was created.
37
+
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]. To allow an AKS cluster to interact with other Azure resources, an Azure Active Directory service principal is automatically created, since you did not specify one. Here, this service principal is [granted the right to pull images][container-registry-integration] from the Azure Container Registry (ACR) instance you created in the previous tutorial.
79
38
80
39
```azurecli
81
40
az aks create \
82
41
--resource-group myResourceGroup \
83
42
--name myAKSCluster \
84
43
--node-count 2 \
85
-
--service-principal <appId> \
86
-
--client-secret <password> \
87
-
--generate-ssh-keys
44
+
--generate-ssh-keys \
45
+
--attach-acr <acrName>
88
46
```
89
47
90
48
After a few minutes, the deployment completes, and returns JSON-formatted information about the AKS deployment.
*[Arguments](../container-instances/container-instances-exec.md#restrictions) for exec in ACI
66
-
*[Daemonsets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
66
+
*[DaemonSets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
67
67
*[Windows Server nodes (currently in preview in AKS)](windows-container-cli.md) are not supported alongside virtual nodes. You can use virtual nodes to schedule Windows Server containers without the need for Windows Server nodes in an AKS cluster.
68
68
69
69
## Launch Azure Cloud Shell
@@ -359,6 +359,7 @@ Virtual nodes are often one component of a scaling solution in AKS. For more inf
*[Arguments](../container-instances/container-instances-exec.md#restrictions) for exec in ACI
66
-
*[Daemonsets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
66
+
*[DaemonSets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
67
67
*[Windows Server nodes (currently in preview in AKS)](windows-container-cli.md) are not supported alongside virtual nodes. You can use virtual nodes to schedule Windows Server containers without the need for Windows Server nodes in an AKS cluster.
68
68
69
69
## Sign in to Azure
@@ -233,12 +233,12 @@ Virtual nodes are one component of a scaling solution in AKS. For more informati
0 commit comments