Skip to content

Commit 3915256

Browse files
Merge pull request #106982 from laurenhughes/lh-1683225-aks-managed-identities
lh-1683225-aks-managed-identities
2 parents 6c56de4 + adcd6d2 commit 3915256

File tree

5 files changed

+19
-40
lines changed

5 files changed

+19
-40
lines changed

articles/aks/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
items:
201201
- name: Create service principal
202202
href: kubernetes-service-principal.md
203-
- name: Use managed identities (preview)
203+
- name: Use managed identities
204204
href: use-managed-identity.md
205205
- name: Limit access to cluster configuration file
206206
href: control-kubeconfig-access.md

articles/aks/azure-disk-volume.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You also need the Azure CLI version 2.0.59 or later installed and configured. Ru
2626

2727
## Create an Azure disk
2828

29-
When you create an Azure disk for use with AKS, you can create the disk resource in the **node** resource group. This approach allows the AKS cluster to access and manage the disk resource. If you instead create the disk in a separate resource group, you must grant the Azure Kubernetes Service (AKS) service principal for your cluster the `Contributor` role to the disk's resource group.
29+
When you create an Azure disk for use with AKS, you can create the disk resource in the **node** resource group. This approach allows the AKS cluster to access and manage the disk resource. If you instead create the disk in a separate resource group, you must grant the Azure Kubernetes Service (AKS) service principal for your cluster the `Contributor` role to the disk's resource group. Alternatively, you can use the system assigned managed identity for permissions instead of the service principal. For more information, see [Use managed identities](use-managed-identity.md).
3030

3131
For this article, create the disk in the node resource group. First, get the resource group name with the [az aks show][az-aks-show] command and add the `--query nodeResourceGroup` query parameter. The following example gets the node resource group for the AKS cluster name *myAKSCluster* in the resource group name *myResourceGroup*:
3232

articles/aks/configure-azure-cni.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This article shows you how to use *Azure CNI* networking to create and use a vir
2222
* The service principal used by the AKS cluster must have at least [Network Contributor](../role-based-access-control/built-in-roles.md#network-contributor) permissions on the subnet within your virtual network. If you wish to define a [custom role](../role-based-access-control/custom-roles.md) instead of using the built-in Network Contributor role, the following permissions are required:
2323
* `Microsoft.Network/virtualNetworks/subnets/join/action`
2424
* `Microsoft.Network/virtualNetworks/subnets/read`
25+
* Instead of a service principal, you can use the system assigned managed identity for permissions. For more information, see [Use managed identities](use-managed-identity.md).
2526

2627
## Plan IP addressing for your cluster
2728

articles/aks/static-ip.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ az role assignment create \
6969
--scope /subscriptions/<subscription id>/resourceGroups/<resource group name>
7070
```
7171

72+
Alternatively, you can use the system assigned managed identity for permissions instead of the service principal. For more information, see [Use managed identities](use-managed-identity.md).
73+
7274
To create a *LoadBalancer* service with the static public IP address, add the `loadBalancerIP` property and the value of the static public IP address to the YAML manifest. Create a file named `load-balancer-service.yaml` and copy in the following YAML. Provide your own public IP address created in the previous step. The following example also sets the annotation to the resource group named *myResourceGroup*. Provide your own resource group name.
7375

7476
```yaml

articles/aks/use-managed-identity.md

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ services: container-service
55
author: saudas
66
manager: saudas
77
ms.topic: article
8-
ms.date: 09/11/2019
8+
ms.date: 03/10/2019
99
ms.author: saudas
1010
---
1111

12-
# Preview - Use managed identities in Azure Kubernetes Service
12+
# Use managed identities in Azure Kubernetes Service
1313

1414
Currently, an Azure Kubernetes Service (AKS) cluster (specifically, the Kubernetes cloud provider) requires a *service principal* to create additional resources like load balancers and managed disks in Azure. Either you must provide a service principal or AKS creates one on your behalf. Service principals typically have an expiration date. Clusters eventually reach a state in which the service principal must be renewed to keep the cluster working. Managing service principals adds complexity.
1515

@@ -20,46 +20,13 @@ AKS creates two managed identities:
2020
- **System-assigned managed identity**: The identity that the Kubernetes cloud provider uses to create Azure resources on behalf of the user. The life cycle of the system-assigned identity is tied to that of the cluster. The identity is deleted when the cluster is deleted.
2121
- **User-assigned managed identity**: The identity that's used for authorization in the cluster. For example, the user-assigned identity is used to authorize AKS to use access control records (ACRs), or to authorize the kubelet to get metadata from Azure.
2222

23-
In this preview period, a service principal is still required. It's used for authorization of add-ons such as monitoring, virtual nodes, Azure Policy, and HTTP application routing. Work is underway to remove the dependency of add-ons on the service principal name (SPN). Eventually, the requirement of an SPN in AKS will be removed completely.
24-
25-
> [!IMPORTANT]
26-
> AKS preview features are available on a self-service, opt-in basis. Previews are provided "as-is" and "as available," and are excluded from the Service Level Agreements and limited warranty. AKS previews are partially covered by customer support on best-effort basis. As such, these features are not meant for production use. For more information, see the following support articles:
27-
>
28-
> - [AKS Support Policies](support-policies.md)
29-
> - [Azure Support FAQ](faq.md)
23+
Add-ons also authenticate using a managed identity. For each add-on, a managed identity is created by AKS and lasts for the life of the add-on. For creating and using your own VNet, static IP address, or attached Azure disk where the resources are outside of the MC_* resource group, use the PrincipalID of the cluster to perform a role assignment. For more information on role assignment, see [Delegate access to other Azure resources](kubernetes-service-principal.md#delegate-access-to-other-azure-resources).
3024

3125
## Before you begin
3226

33-
You must have the following resources installed:
34-
35-
- The Azure CLI, version 2.0.70 or later
36-
- The aks-preview 0.4.14 extension
37-
38-
To install the aks-preview 0.4.14 extension or later, use the following Azure CLI commands:
39-
40-
```azurecli
41-
az extension add --name aks-preview
42-
az extension list
43-
```
44-
45-
> [!CAUTION]
46-
> After you register a feature on a subscription, you can't currently unregister that feature. When you enable some preview features, defaults might be used for all AKS clusters created afterward in the subscription. Don't enable preview features on production subscriptions. Instead, use a separate subscription to test preview features and gather feedback.
47-
48-
```azurecli-interactive
49-
az feature register --name MSIPreview --namespace Microsoft.ContainerService
50-
```
27+
You must have the following resource installed:
5128

52-
It might take several minutes for the status to show as **Registered**. You can check the registration status by using the [az feature list](https://docs.microsoft.com/cli/azure/feature?view=azure-cli-latest#az-feature-list) command:
53-
54-
```azurecli-interactive
55-
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/MSIPreview')].{Name:name,State:properties.state}"
56-
```
57-
58-
When the status shows as registered, refresh the registration of the `Microsoft.ContainerService` resource provider by using the [az provider register](https://docs.microsoft.com/cli/azure/provider?view=azure-cli-latest#az-provider-register) command:
59-
60-
```azurecli-interactive
61-
az provider register --namespace Microsoft.ContainerService
62-
```
29+
- The Azure CLI, version 2.2.0 or later
6330

6431
## Create an AKS cluster with managed identities
6532

@@ -78,6 +45,15 @@ Then, create an AKS cluster:
7845
az aks create -g MyResourceGroup -n MyManagedCluster --enable-managed-identity
7946
```
8047

48+
A successful cluster creation using managed identities contains this service principal profile information:
49+
50+
```json
51+
"servicePrincipalProfile": {
52+
"clientId": "msi",
53+
"secret": null
54+
}
55+
```
56+
8157
Finally, get credentials to access the cluster:
8258

8359
```azurecli-interactive

0 commit comments

Comments
 (0)