Skip to content

Commit 60554eb

Browse files
committed
initial upload of api server vnet integration docs
1 parent d85bd8e commit 60554eb

File tree

1 file changed

+177
-0
lines changed

1 file changed

+177
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: API Server VNet Integration in Azure Kubernetes Service (AKS)
3+
description: Learn how to create an Azure Kubernetes Service (AKS) cluster with API Server VNet Integration
4+
services: container-service
5+
ms.topic: article
6+
ms.date: 06/27/2022
7+
8+
---
9+
10+
# Create an Azure Kubernetes Service cluster with API Server VNet Integration (PREVIEW)
11+
12+
An Azure Kubernetes Service (AKS) cluster with API Server VNet Integration configured projects the API server endpoint directly into a delegated subnet in the VNet where AKS is deployed. This enables network communication between the API server and the cluster nodes without any required private link or tunnel. The API server will be available behind an Internal Load Balancer VIP in the delegated subnet, which the nodes will be configured to utilize. By using API Server VNet Integration, you can ensure network traffic between your API server and your node pools remains on the private network only.
13+
14+
15+
16+
[!INCLUDE [preview features callout](./includes/preview/preview-callout.md)]
17+
18+
## API Server Connectivity
19+
20+
The control plane or API server is in an Azure Kubernetes Service (AKS)-managed Azure subscription. A customer's cluster or node pool is in the customer's subscription. The server and the virtual machines that make up the cluster nodes can communicate with each other through the API server VIP and pod IPs that are projected into the delegated subnet.
21+
22+
At this time, API Server VNet integration is only supported for private clusters. Unlike standard public clusters, the agent nodes communicate directly with the private IP address of the ILB VIP for communication to the API server without using DNS. External clients needing to communicate with the cluster should follow the same private DNS setup methodology as standard [private clusters](private-clusters.md).
23+
24+
## Region availability
25+
26+
API Server VNet Integration is available in the following regions at this time. More will be added as available:
27+
28+
- canary regions
29+
- eastus2
30+
- northcentralus
31+
- westcentralus
32+
- westus2
33+
34+
## Prerequisites
35+
36+
* Azure CLI with aks-preview extension 0.5.67 or later.
37+
* If using ARM or the REST API, the AKS API version must be 2022-04-02-preview or later.
38+
39+
### Install the aks-preview CLI extension
40+
41+
```azurecli-interactive
42+
# Install the aks-preview extension
43+
az extension add --name aks-preview
44+
45+
# Update the extension to make sure you have the latest version installed
46+
az extension update --name aks-preview
47+
```
48+
49+
### Register the `EnableAPIServerVnetIntegrationPreview` preview feature
50+
51+
To create an AKS cluster with API Server VNet Integration, you must enable the `EnableAPIServerVnetIntegrationPreview` feature flag on your subscription.
52+
53+
Register the `EnableAPIServerVnetIntegrationPreview` feature flag by using the `az feature register` command, as shown in the following example:
54+
55+
```azurecli-interactive
56+
az feature register --namespace "Microsoft.ContainerService" --name "EnableAPIServerVnetIntegrationPreview"
57+
```
58+
59+
It takes a few minutes for the status to show *Registered*. Verify the registration status by using the `az feature list` command:
60+
61+
```azurecli-interactive
62+
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/EnableAPIServerVnetIntegrationPreview')].{Name:name,State:properties.state}"
63+
```
64+
65+
When the feature has been registered, refresh the registration of the *Microsoft.ContainerService* resource provider by using the `az provider register` command:
66+
67+
```azurecli-interactive
68+
az provider register --namespace Microsoft.ContainerService
69+
```
70+
71+
## Create an AKS cluster with API Server VNet Integration using Managed VNet
72+
73+
AKS clusters with API Server VNet Integration can be configured in either managed VNet or bring-your-own VNet mode.
74+
75+
### Create a resource group
76+
77+
Create a resource group or use an existing resource group for your AKS cluster.
78+
79+
```azurecli-interactive
80+
az group create -l westus2 -n <resource-group>
81+
```
82+
83+
### Deploy the cluster
84+
85+
```azurecli-interactive
86+
az aks create -n <cluster-name> \
87+
-g <resource-group> \
88+
-l <location> \
89+
--network-plugin azure \
90+
--enable-private-cluster \
91+
--enable-apiserver-vnet-integration
92+
```
93+
94+
Where `--enable-private-cluster` is a mandatory flag for a private cluster, and `--enable-apiserver-vnet-integration` configures API Server VNet integration for Managed VNet mode.
95+
96+
## Create an AKS cluster with API Server VNet Integration using bring-your-own VNet
97+
98+
When using bring-your-own VNet, an API server subnet must be created and delegated to `Microsoft.ContainerService/managedClusters`. This grants the AKS service permissions to inject the API server pods and internal load balancer into that subnet. The subnet may not be used for any other workloads, but may be used for multiple AKS clusters located in the same virtual network. An AKS cluster will require from 2-7 IP addresses depending on cluster scale. The minimum supported API server subnet size is a /28.
99+
100+
> [!WARNING]
101+
> Running out of IP addresses may prevent API server scaling and cause an API server outage.
102+
103+
### Create a resource group
104+
105+
Create a resource group or use an existing resource group for your AKS cluster.
106+
107+
```azurecli-interactive
108+
az group create -l <location> -n <resource-group>
109+
```
110+
111+
### Create a virtual network
112+
113+
```azurecli-interactive
114+
# Create the virtual network
115+
az network vnet create -n <vnet-name> \
116+
-l <location> \
117+
--address-prefixes 172.19.0.0/16
118+
119+
# Create an API server subnet
120+
az network vnet subnet create --vnet-name <vnet-name> \
121+
--name <apiserver-subnet-name> \
122+
--delegations Microsoft.ContainerService/managedClusters \
123+
--address-prefixes 172.19.0.0/28
124+
125+
# Create a cluster subnet
126+
az network vnet subnet create --vnet-name <vnet-name> \
127+
--name <cluster-subnet-name> \
128+
--address-prefixes 172.19.1.0/24
129+
```
130+
131+
### Create a managed identity and give it permissions on the virtual network
132+
133+
```azurecli-interactive
134+
# Create the identity
135+
az identity create -n <managed-identity-name> -l <location>
136+
137+
# Assign Network Contributor to the cluster subnet
138+
az role assignment create --scope <cluster-subnet-resource-id> \
139+
--role "Network Contributor" \
140+
--assignee <managed-identity-client-id>
141+
```
142+
143+
### Create the AKS cluster
144+
145+
```azurecli-interactive
146+
az aks create -n <cluster-name> \
147+
-g <resource-group> \
148+
-l <location> \
149+
--network-plugin azure \
150+
--enable-private-cluster \
151+
--enable-apiserver-vnet-integration \
152+
--vnet-subnet-id <cluster-subnet-resource-id> \
153+
--apiserver-subnet-id <apiserver-subnet-resource-id> \
154+
--assign-identity <managed-identity-resource-id>
155+
```
156+
157+
## Limitations
158+
* Existing AKS clusters cannot be converted to API Server VNet Integration clusters at this time.
159+
* Only [private clusters](private-clusters.md) are supported at this time.
160+
* [Private Link Service][private-link-service] will not work if deployed against the API Server injected addresses at this time, so the API server cannot be exposed to other virtual networks via private link. To access the API server from outside the cluster network, utilize either [VNet peering][virtual network peering] or [AKS run command][command-invoke].
161+
162+
<!-- LINKS - internal -->
163+
[az-provider-register]: /cli/azure/provider#az_provider_register
164+
[az-feature-register]: /cli/azure/feature#az_feature_register
165+
[az-feature-list]: /cli/azure/feature#az_feature_list
166+
[az-extension-add]: /cli/azure/extension#az_extension_add
167+
[az-extension-update]: /cli/azure/extension#az_extension_update
168+
[private-link-service]: ../private-link/private-link-service-overview.md#limitations
169+
[private-endpoint-service]: ../private-link/private-endpoint-overview.md
170+
[virtual-network-peering]: ../virtual-network/virtual-network-peering-overview.md
171+
[azure-bastion]: ../bastion/tutorial-create-host-portal.md
172+
[express-route-or-vpn]: ../expressroute/expressroute-about-virtual-network-gateways.md
173+
[devops-agents]: /azure/devops/pipelines/agents/agents
174+
[availability-zones]: availability-zones.md
175+
[command-invoke]: command-invoke.md
176+
[container-registry-private-link]: ../container-registry/container-registry-private-link.md
177+
[virtual-networks-name-resolution]: ../virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances.md#name-resolution-that-uses-your-own-dns-server

0 commit comments

Comments
 (0)