Skip to content

Commit 28ba84d

Browse files
authored
Update limit-egress-traffic.md
1 parent 198cf31 commit 28ba84d

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

articles/aks/limit-egress-traffic.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ You'll define the outbound type to use the UDR that already exists on the subnet
458458
>
459459
> The AKS feature for [**API server authorized IP ranges**](api-server-authorized-ip-ranges.md) can be added to limit API server access to only the firewall's public endpoint. The authorized IP ranges feature is denoted in the diagram as optional. When enabling the authorized IP range feature to limit API server access, your developer tools must use a jumpbox from the firewall's virtual network or you must add all developer endpoints to the authorized IP range.
460460
461+
#### Create an AKS cluster with system-assigned identities
462+
463+
> [!NOTE]
464+
> AKS will create a system-assigned kubelet identity in the Node resource group if you do not [specify your own kubelet managed identity][Use a pre-created kubelet managed identity].
465+
466+
You can create an AKS cluster using a system-assigned managed identity by running the following CLI command.
467+
461468
```azurecli
462469
az aks create -g $RG -n $AKSNAME -l $LOC \
463470
--node-count 3 \
@@ -472,6 +479,71 @@ az aks create -g $RG -n $AKSNAME -l $LOC \
472479
>
473480
> If you are not using the CLI but using your own VNet or route table which are outside of the worker node resource group, it's recommended to use [user-assigned control plane identity][Bring your own control plane managed identity]. For system-assigned control plane identity, we cannot get the identity ID before creating cluster, which causes delay for role assignment to take effect.
474481
482+
#### Create an AKS cluster with user-assigned identities
483+
484+
##### Create user-assigned managed identities
485+
486+
If you don't have a control plane managed identity, you can create by running the following [az identity create][az-identity-create] command:
487+
488+
```azurecli-interactive
489+
az identity create --name myIdentity --resource-group myResourceGroup
490+
```
491+
492+
The output should resemble the following:
493+
494+
```output
495+
{
496+
"clientId": "<client-id>",
497+
"clientSecretUrl": "<clientSecretUrl>",
498+
"id": "/subscriptions/<subscriptionid>/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity",
499+
"location": "westus2",
500+
"name": "myIdentity",
501+
"principalId": "<principal-id>",
502+
"resourceGroup": "myResourceGroup",
503+
"tags": {},
504+
"tenantId": "<tenant-id>",
505+
"type": "Microsoft.ManagedIdentity/userAssignedIdentities"
506+
}
507+
```
508+
509+
If you don't have a kubelet managed identity, you can create one by running the following [az identity create][az-identity-create] command:
510+
511+
```azurecli-interactive
512+
az identity create --name myKubeletIdentity --resource-group myResourceGroup
513+
```
514+
515+
The output should resemble the following:
516+
517+
```output
518+
{
519+
"clientId": "<client-id>",
520+
"clientSecretUrl": "<clientSecretUrl>",
521+
"id": "/subscriptions/<subscriptionid>/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myKubeletIdentity",
522+
"location": "westus2",
523+
"name": "myKubeletIdentity",
524+
"principalId": "<principal-id>",
525+
"resourceGroup": "myResourceGroup",
526+
"tags": {},
527+
"tenantId": "<tenant-id>",
528+
"type": "Microsoft.ManagedIdentity/userAssignedIdentities"
529+
}
530+
```
531+
532+
##### Create an AKS cluster with user-assigned identities
533+
534+
Now you can use the following command to create your AKS cluster with your existing identities in the subnet. Provide the control plane identity resource ID via `assign-identity` and the kubelet managed identity via `assign-kubelet-identity`:
535+
536+
```azurecli
537+
az aks create -g $RG -n $AKSNAME -l $LOC \
538+
--node-count 3 \
539+
--network-plugin $PLUGIN \
540+
--outbound-type userDefinedRouting \
541+
--vnet-subnet-id $SUBNETID \
542+
--api-server-authorized-ip-ranges $FWPUBLIC_IP
543+
--enable-managed-identity \
544+
--assign-identity <identity-resource-id> \
545+
--assign-kubelet-identity <kubelet-identity-resource-id>
546+
```
475547

476548
### Enable developer access to the API server
477549

@@ -797,3 +869,4 @@ If you want to restrict how pods communicate between themselves and East-West tr
797869
[aks-private-clusters]: private-clusters.md
798870
[add role to identity]: use-managed-identity.md#add-role-assignment-for-control-plane-identity
799871
[Bring your own control plane managed identity]: use-managed-identity.md#bring-your-own-control-plane-managed-identity
872+
[Use a pre-created kubelet managed identity]: use-managed-identity.md#use-a-pre-created-kubelet-managed-identity

0 commit comments

Comments
 (0)