Skip to content

Commit 5cb94ed

Browse files
committed
updated Deploy App section
1 parent 8905d32 commit 5cb94ed

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,32 @@ az identity federated-credential create --name myfederatedIdentity --identity-na
147147
kubectl apply -f <your application>
148148
```
149149

150+
When deploying your application pods, it should reference the service account created in the Create Kubernetes service account step. The following manifest demonstrates how to reference the account, specifically `metadata\namespace` and `spec\serviceAccountName`:
151+
152+
```yml
153+
cat <<EOF | kubectl apply -f -
154+
apiVersion: v1
155+
kind: Pod
156+
metadata:
157+
name: quick-start
158+
namespace: SERVICE_ACCOUNT_NAMESPACE
159+
labels:
160+
azure.workload.identity/use: "true"
161+
spec:
162+
serviceAccountName: workload-identity-sa
163+
containers:
164+
- image: ghcr.io/azure/azure-workload-identity/msal-go
165+
name: oidc
166+
env:
167+
- name: KEYVAULT_URL
168+
value: KEYVAULT_URL
169+
- name: SECRET_NAME
170+
value: KEYVAULT_SECRET_NAME
171+
nodeSelector:
172+
kubernetes.io/os: linux
173+
EOF
174+
```
175+
150176
## Optional - Grant permissions to access Azure Key Vault
151177

152178
This step is necessary if you need to access secrets, keys, and certificates that are mounted in Azure Key Vault from a pod. Perform the following steps to configure access with a managed identity. These steps assume you have an Azure Key Vault already created and configured in your subscription. If you don't have one, see [Create an Azure Key Vault using the Azure CLI][create-key-vault-azure-cli].

0 commit comments

Comments
 (0)