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/workload-identity-deploy-cluster.md
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,8 @@ az provider register --namespace Microsoft.ContainerService
67
67
Create an AKS cluster using the [az aks create][az-aks-create] command with the `--enable-oidc-issuer` parameter to use the OIDC Issuer. The following example creates a cluster named *myAKSCluster* with one node in the *myResourceGroup*:
68
68
69
69
```azurecli-interactive
70
+
az group create --name myResourceGroup --location eastus
71
+
70
72
az aks create -g myResourceGroup -n myAKSCluster --node-count 1 --enable-oidc-issuer --enable-workload-identity --generate-ssh-keys
71
73
```
72
74
@@ -95,44 +97,49 @@ You can retrieve this information using the Azure CLI command: [az keyvault list
95
97
1. Use the Azure CLI [az account set][az-account-set] command to set a specific subscription to be the current active subscription. Then use the [az identity create][az-identity-create] command to create a managed identity.
96
98
97
99
```azurecli
98
-
az account set --subscription "subscriptionID"
99
-
```
100
+
export SUBSCRIPTION_ID="$(az account show --query id --output tsv)"
az keyvault set-policy --name "${KEYVAULT_NAME}" --secret-permissions get --spn "${USER_ASSIGNED_CLIENT_ID}"
113
117
```
114
118
115
119
## Create Kubernetes service account
116
120
117
121
Create a Kubernetes service account and annotate it with the client ID of the managed identity created in the previous step. Use the [az aks get-credentials][az-aks-get-credentials] command and replace the values for the cluster name and the resource group name.
118
122
119
123
```azurecli
120
-
az aks get-credentials -n myAKSCluster -g MyResourceGroup
124
+
az aks get-credentials -n myAKSCluster -g myResourceGroup
121
125
```
122
126
123
-
Copy and paste the following multi-line input in the Azure CLI, and update the values for `serviceAccountName` and `serviceAccountNamespace` with the Kubernetes service account name and its namespace.
127
+
Copy and paste the following multi-line input in the Azure CLI, and update the values for `SERVICE_ACCOUNT_NAME` and `SERVICE_ACCOUNT_NAMESPACE` with the Kubernetes service account name and its namespace.
@@ -144,10 +151,10 @@ Serviceaccount/workload-identity-sa created
144
151
145
152
## Establish federated identity credential
146
153
147
-
Use the [az identity federated-credential create][az-identity-federated-credential-create] command to create the federated identity credential between the managed identity, the service account issuer, and the subject. Replace the values `resourceGroupName`, `userAssignedIdentityName`, `federatedIdentityName`, `serviceAccountNamespace`, and `serviceAccountName`.
154
+
Use the [az identity federated-credential create][az-identity-federated-credential-create] command to create the federated identity credential between the managed identity, the service account issuer, and the subject.
0 commit comments