Skip to content

Commit 296efda

Browse files
committed
clean up
1 parent 9ceac62 commit 296efda

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

articles/aks/workload-identity-deploy-cluster.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,21 @@ az account set --subscription <subscription-id>
4242

4343
## Export environment variables
4444

45-
To help simplify steps to configure the identities required, the steps below define environment variables that are referenced in the examples in this article.
46-
47-
* Create these variables using the following commands. Replace the values shown with your own values.
48-
49-
```bash
50-
export RESOURCE_GROUP="myResourceGroup"
51-
export LOCATION="eastus"
52-
export CLUSTER_NAME="myAKSCluster"
53-
export SERVICE_ACCOUNT_NAMESPACE="default"
54-
export SERVICE_ACCOUNT_NAME="workload-identity-sa"
55-
export SUBSCRIPTION="$(az account show --query id --output tsv)"
56-
export USER_ASSIGNED_IDENTITY_NAME="myIdentity"
57-
export FEDERATED_IDENTITY_CREDENTIAL_NAME="myFedIdentity"
58-
# Include these variables to access key vault secrets from a pod in the cluster.
59-
export KEYVAULT_NAME="keyvault-workload-id"
60-
export KEYVAULT_SECRET_NAME="my-secret"
61-
```
45+
To help simplify steps to configure the identities required, the steps below define environment variables that are referenced in the examples in this article. Remember to replace the values shown with your own values:
46+
47+
```bash
48+
export RESOURCE_GROUP="myResourceGroup"
49+
export LOCATION="eastus"
50+
export CLUSTER_NAME="myAKSCluster"
51+
export SERVICE_ACCOUNT_NAMESPACE="default"
52+
export SERVICE_ACCOUNT_NAME="workload-identity-sa"
53+
export SUBSCRIPTION="$(az account show --query id --output tsv)"
54+
export USER_ASSIGNED_IDENTITY_NAME="myIdentity"
55+
export FEDERATED_IDENTITY_CREDENTIAL_NAME="myFedIdentity"
56+
# Include these variables to access key vault secrets from a pod in the cluster.
57+
export KEYVAULT_NAME="keyvault-workload-id"
58+
export KEYVAULT_SECRET_NAME="my-secret"
59+
```
6260

6361
## Create a resource group
6462

@@ -203,7 +201,7 @@ az identity federated-credential create \
203201
204202
## Deploy your application
205203

206-
When you deploy your application pods, the manifest should reference the service account created in the **Create Kubernetes service account** step. The following manifest shows how to reference the account, specifically _metadata\namespace_ and _spec\serviceAccountName_ properties. Make sure to specify an image for `<image>` and a container name for `<containerName>`:
204+
When you deploy your application pods, the manifest should reference the service account created in the **Create Kubernetes service account** step. The following manifest shows how to reference the account, specifically the _metadata\namespace_ and _spec\serviceAccountName_ properties. Make sure to specify an image for `<image>` and a container name for `<containerName>`:
207205

208206
```yml
209207
cat <<EOF | kubectl apply -f -
@@ -247,6 +245,7 @@ The following example shows how to use the Azure role-based access control (Azur
247245
248246
1. Assign yourself the RBAC [Key Vault Secrets Officer](../role-based-access-control/built-in-roles/security.md#key-vault-secrets-officer) role so that you can create a secret in the new key vault:
249247
248+
```azurecli-interactive
250249
export KEYVAULT_RESOURCE_ID=$(az keyvault show --resource-group "${KEYVAULT_RESOURCE_GROUP}" \
251250
--name "${KEYVAULT_NAME}" \
252251
--query id \
@@ -255,6 +254,7 @@ The following example shows how to use the Azure role-based access control (Azur
255254
az role assignment create --assignee "\<user-email\>" \
256255
--role "Key Vault Secrets Officer" \
257256
--scope "${KEYVAULT_RESOURCE_ID}"
257+
```
258258
259259
1. Create a secret in the key vault:
260260
@@ -267,7 +267,7 @@ The following example shows how to use the Azure role-based access control (Azur
267267
--value "Hello\!"
268268
```
269269
270-
1. Assign the [Key Vault Secrets User](../role-based-access-control/built-in-roles/security.md#key-vault-secrets-user) role to the user-assigned managed identity that you created previously. This step gives the managed identity the ability to read secrets from the key vault.
270+
1. Assign the [Key Vault Secrets User](../role-based-access-control/built-in-roles/security.md#key-vault-secrets-user) role to the user-assigned managed identity that you created previously. This step gives the managed identity permission to read secrets from the key vault:
271271
272272
```azurecli-interactive
273273
export IDENTITY_PRINCIPAL_ID=$(az identity show \
@@ -283,7 +283,7 @@ The following example shows how to use the Azure role-based access control (Azur
283283
--assignee-principal-type ServicePrincipal
284284
```
285285
286-
1. Export the key vault URL:
286+
1. Create an environment variable for the key vault URL:
287287
288288
```azurecli-interactive
289289
export KEYVAULT_URL="$(az keyvault show \
@@ -293,7 +293,7 @@ The following example shows how to use the Azure role-based access control (Azur
293293
--output tsv)"
294294
```
295295
296-
1. Deploy a pod that references the service account and key vault URL above:
296+
1. Deploy a pod that references the service account and key vault URL:
297297
298298
```yml
299299
cat <<EOF | kubectl apply -f -

0 commit comments

Comments
 (0)