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/azure-cni-overlay.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,7 +138,7 @@ az aks nodepool add -g $resourceGroup --cluster-name $clusterName \
138
138
>
139
139
> - The cluster is on Kubernetes version 1.22+.
140
140
> - Doesn't use the dynamic pod IP allocation feature.
141
-
> - Doesn't have network policies enabled.
141
+
> - Doesn't have network policies enabled. Network Policy engine can be uninstalled before the upgrade, see [Uninstall Azure Network Policy Manager or Calico](use-network-policies.md#uninstall-azure-network-policy-manager-or-calico-preview)
142
142
> - Doesn't use any Windows node pools with docker as the container runtime.
Copy file name to clipboardExpand all lines: articles/aks/azure-cni-powered-by-cilium.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,10 +116,13 @@ az aks create -n <clusterName> -g <resourceGroupName> -l <location> \
116
116
> You can update an existing cluster to Azure CNI Powered by Cilium if the cluster meets the following criteria:
117
117
>
118
118
> - The cluster uses either [Azure CNI Overlay](./azure-cni-overlay.md) or [Azure CNI with dynamic IP allocation](./configure-azure-cni-dynamic-ip-allocation.md). This does **not** include [Azure CNI](./configure-azure-cni.md).
119
-
> - The cluster does not have Azure NPM or Calico enabled.
120
-
> - The cluster does not have any Windows node pools.
119
+
> - The cluster does not have any Windows node pools.
121
120
122
-
The upgrade process triggers each node pool to be re-imaged simultaneously. Upgrading each node pool separately isn't supported. Any disruptions to cluster networking are similar to a node image upgrade or [Kubernetes version upgrade](./upgrade-cluster.md) where each node in a node pool is re-imaged.
121
+
> [!NOTE]
122
+
> When enabling Cilium in a cluster with a different network policy engine (Azure NPM or Calico), the network policy engine will be uninstalled and replaced with Cilium. See [Uninstall Azure Network Policy Manager or Calico](./use-network-policies.md#uninstall-azure-network-policy-manager-or-calico-preview) for more details.
123
+
124
+
> [!WARNING]
125
+
> The upgrade process triggers each node pool to be re-imaged simultaneously. Upgrading each node pool separately isn't supported. Any disruptions to cluster networking are similar to a node image upgrade or [Kubernetes version upgrade](./upgrade-cluster.md) where each node in a node pool is re-imaged.
123
126
124
127
Cilium will begin enforcing network policies only after all nodes have been re-imaged.
125
128
@@ -132,6 +135,7 @@ az aks update -n <clusterName> -g <resourceGroupName> \
> Any cluster actions taken by Microsoft/AKS are made with your consent under a built-in Kubernetes role `aks-service` and built-in role binding `aks-service-rolebinding`. This role enables AKS to troubleshoot and diagnose cluster issues, but can't modify permissions nor create roles or role bindings, or other high privilege actions. Role access is only enabled under active support tickets with just-in-time (JIT) access.
Copy file name to clipboardExpand all lines: articles/aks/use-network-policies.md
+74-21Lines changed: 74 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,28 @@ This article shows you how to install the network policy engine and create Kuber
17
17
18
18
You need the Azure CLI version 2.0.61 or later installed and configured. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
19
19
20
+
### Uninstall Azure Network Policy Manager or Calico (Preview)
21
+
Requirements:
22
+
- aks-preview Azure CLI extension version 0.5.166 or later. See [Install the aks-preview Azure CLI extension](#install-the-aks-preview-azure-cli-extension).
23
+
- Azure CLI version 2.54 or later
24
+
- AKS REST API version 2023-08-02-preview or later
25
+
26
+
Notes:
27
+
- The uninstall process does _not_ remove Custom Resource Definitions (CRDs) and Custom Resources (CRs) used by Calico. These CRDs and CRs all have names ending with either "projectcalico.org" or "tigera.io".
28
+
These CRDs and associated CRs can be manually deleted _after_ Calico is successfully uninstalled (deleting the CRDs before removing Calico breaks the cluster).
29
+
- The upgrade will not remove any NetworkPolicy resources in the cluster, but after the uninstall these policies are no longer enforced.
30
+
31
+
> [!WARNING]
32
+
> The upgrade process triggers each node pool to be re-imaged simultaneously. Upgrading each node pool separately isn't supported. Any disruptions to cluster networking are similar to a node image upgrade or [Kubernetes version upgrade](./upgrade-cluster.md) where each node in a node pool is re-imaged.
33
+
34
+
To remove Azure Network Policy Manager or Calico from a cluster, run the following command:
35
+
```azurecli
36
+
az aks update
37
+
--resource-group $RESOURCE_GROUP_NAME \
38
+
--name $CLUSTER_NAME \
39
+
--network-policy none
40
+
```
41
+
20
42
## Overview of network policy
21
43
22
44
All pods in an AKS cluster can send and receive traffic without limitations, by default. To improve security, you can define rules that control the flow of traffic. Back-end applications are often only exposed to required front-end services, for example. Or, database components are only accessible to the application tiers that connect to them.
@@ -27,23 +49,25 @@ The network policy rules are defined as YAML manifests. Network policies can be
27
49
28
50
## Network policy options in AKS
29
51
30
-
Azure provides two ways to implement network policy. You choose a network policy option when you create an AKS cluster. The policy option can't be changed after the cluster is created. The options are:
52
+
Azure provides three Network Policy engines for enforcing network policies:
31
53
32
-
-**Azure Network Policy Manager**: The implementation in Azure.
33
-
-**Calico network policy**: An open-source network and network security solution founded by [Tigera][tigera].
54
+
**Cilium* for AKS clusters that use [Azure CNI Powered by Cilium](./azure-cni-powered-by-cilium.md).
55
+
**Azure Network Policy Manager*.
56
+
**Calico*, an open-source network and network security solution founded by [Tigera][tigera].
34
57
58
+
Cilium is our recommended Network Policy engine. Cilium enforces network policy on the traffic using Linux Berkeley Packet Filter (BPF), which is generally more efficient than "IPTables". See more details in [Azure CNI Powered by Cilium documentation](./azure-cni-powered-by-cilium.md).
35
59
To enforce the specified policies, Azure Network Policy Manager for Linux uses Linux *IPTables*. Azure Network Policy Manager for Windows uses *Host Network Service (HNS) ACLPolicies*. Policies are translated into sets of allowed and disallowed IP pairs. These pairs are then programmed as `IPTable` or `HNS ACLPolicy` filter rules.
36
60
37
-
## Compare Azure Network Policy Manager and Calico network policy
| Supported platforms | Linux, Windows Server 2022. | Linux, Windows Server 2019 and 2022. |
42
-
| Supported networking options | Azure Container Networking Interface (CNI). | Azure CNI (Linux, Windows Server 2019 and 2022) and kubenet (Linux). |
43
-
| Compliance with Kubernetes specification | All policy types are supported. | All policy types are supported. |
44
-
| Other features | None. | Extended policy model consisting of Global Network Policy, Global Network Set, and Host Endpoint. For more information on using the `calicoctl` CLI to manage these extended features, see [calicoctl user reference][calicoctl]. |
45
-
| Support | Supported by Azure Support and Engineering team. | Calico community support. For more information on more paid support, see [Project Calico support options][calico-support]. |
46
-
| Logging | Logs are available with the `kubectl log -n kube-system \<network-policy-pod\>` command. | For more information, see [Calico component logs][calico-logs]. |
62
+
## Differences between Network Policy engines: Cilium, Azure NPM, and Calico
| Supported platforms | Linux, Windows Server 2022 (Preview). | Linux, Windows Server 2019 and 2022. | Linux.
67
+
| Supported networking options | Azure Container Networking Interface (CNI). | Azure CNI (Linux, Windows Server 2019 and 2022) and kubenet (Linux). | Azure CNI.
68
+
| Compliance with Kubernetes specification | All policy types supported | All policy types are supported. | All policy types are supported.
69
+
| Other features | None. | Extended policy model consisting of Global Network Policy, Global Network Set, and Host Endpoint. For more information on using the `calicoctl` CLI to manage these extended features, see [calicoctl user reference][calicoctl]. | None.
70
+
| Support | Supported by Azure Support and Engineering team. | Supported by Azure Support and Engineering team. | Supported by Azure Support and Engineering team.
47
71
48
72
## Limitations
49
73
@@ -68,15 +92,12 @@ With Azure Network Policy Manager for Linux, we don't allow scaling beyond 250 n
68
92
69
93
To see network policies in action, you create an AKS cluster that supports network policy and then work on adding policies.
70
94
71
-
> [!IMPORTANT]
72
-
>
73
-
> The network policy feature can only be enabled when the cluster is created. You can't enable network policy on an existing AKS cluster.
74
-
75
-
To use Azure Network Policy Manager, you must use the [Azure CNI plug-in][azure-cni]. Calico network policy could be used with either this same Azure CNI plug-in or with the Kubernetes CNI plug-in.
95
+
To use Azure Network Policy Manager, you must use the Azure CNI plug-in. Calico can be used with either Azure CNI plug-in or with the Kubenet CNI plug-in.
76
96
77
97
The following example script creates an AKS cluster with system-assigned identity and enables network policy by using Azure Network Policy Manager.
78
98
79
-
To use Calico as the network policy option instead, use the `--network-policy calico` parameter. Calico could be used with either `--network-plugin azure` or `--network-plugin kubenet`.
99
+
>[!Note}
100
+
> Calico can be used with either the `--network-plugin azure` or `--network-plugin kubenet` parameters.
80
101
81
102
Instead of using a system-assigned identity, you can also use a user-assigned identity. For more information, see [Use managed identities](use-managed-identity.md).
82
103
@@ -189,9 +210,9 @@ az aks nodepool add \
189
210
--node-count 1
190
211
```
191
212
192
-
### Create an AKS cluster for Calico network policy
213
+
### Create an AKS cluster with Calico enabled
193
214
194
-
Create the AKS cluster and specify `azure` for the network plug-in and `calico` for the networkpolicy. When you use `calico`as the network policy, Calico networking is enabled on both Linux and Windows node pools.
215
+
Create the AKS cluster and specify `--network-plugin azure`, and `--network-policy calico`. Specifying `--network-policycalico`enables Calico on both Linux and Windows node pools.
195
216
196
217
If you plan on adding Windows node pools to your cluster, include the `windows-admin-username` and `windows-admin-password` parameters that meet the [Windows Server password requirements][windows-server-password].
197
218
@@ -227,6 +248,38 @@ az aks nodepool add \
227
248
--node-count 1
228
249
```
229
250
251
+
## Install Azure Network Policy Manager or Calico in an existing cluster
252
+
Installing Azure Network Policy Manager or Calico on existing AKS clusters is also supported.
253
+
> [!WARNING]
254
+
> The upgrade process triggers each node pool to be re-imaged simultaneously. Upgrading each node pool separately isn't supported. Any disruptions to cluster networking are similar to a node image upgrade or [Kubernetes version upgrade](./upgrade-cluster.md) where each node in a node pool is re-imaged.
255
+
256
+
Example command to install Azure Network Policy Manager:
257
+
```azurecli
258
+
az aks update
259
+
--resource-group $RESOURCE_GROUP_NAME \
260
+
--name $CLUSTER_NAME \
261
+
--network-policy azure
262
+
```
263
+
264
+
Example command to install Calico:
265
+
> [!WARNING]
266
+
> This warning applies to upgrading Kubenet clusters with Calico enabled to Azure CNI Overlay with Calico enabled.
267
+
> - In Kubenet clusters with Calico enabled, Calico is used as both a CNI and network policy engine.
268
+
> - In Azure CNI clusters, Calico is used only for network policy enforcement, not as a CNI. This can cause a short delay between when the pod starts and when Calico allows outbound traffic from the pod.
269
+
>
270
+
> It is recommended to use Cilium instead of Calico to avoid this issue. Learn more about Cilium at [Azure CNI Powered by Cilium](./azure-cni-powered-by-cilium.md)
271
+
>
272
+
273
+
```azurecli
274
+
az aks update
275
+
--resource-group $RESOURCE_GROUP_NAME \
276
+
--name $CLUSTER_NAME \
277
+
--network-policy calico
278
+
```
279
+
280
+
## Upgrade an existing cluster that has Azure NPM or Calico installed to Azure CNI Powered by Cilium
281
+
To upgrade an existing cluster that has Network Policy engine installed to Azure CNI Powered by Cilium, see [Upgrade an existing cluster to Azure CNI Powered by Cilium](azure-cni-powered-by-cilium.md#upgrade-an-existing-cluster-to-azure-cni-powered-by-cilium)
282
+
230
283
## Verify network policy setup
231
284
232
285
When the cluster is ready, configure `kubectl` to connect to your Kubernetes cluster by using the [az aks get-credentials][az-aks-get-credentials] command. This command downloads credentials and configures the Kubernetes CLI to use them:
@@ -286,7 +339,7 @@ In the client's shell, run the following command to verify connectivity with the
286
339
287
340
### Test connectivity with network policy
288
341
289
-
Create a file named `demo-policy.yaml` and paste the following YAML manifest to add network policies:
342
+
To add network policies create a file named `demo-policy.yaml` and paste the following YAML manifest:
Copy file name to clipboardExpand all lines: articles/aks/windows-best-practices.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ To help you decide which networking mode to use, see [Choosing a network model][
57
57
58
58
> **Best practice guidance**
59
59
>
60
-
> Use network policies to secure traffic between pods. Windows supports Azure Network Policy Manager and Calico Network Policy. For more information, see [Differences between Azure Network Policy Manager and Calico Network Policy][azurenpm-vs-calico].
60
+
> Use network policies to secure traffic between pods. Windows supports Azure Network Policy Manager and Calico Network Policy. For more information, see [Differences between Network Policy engines: Cilium, Azure NPM, and Calico][azurenpm-vs-calico].
61
61
62
62
When managing traffic between pods, you should apply the principle of least privilege. The Network Policy feature in Kubernetes allows you to define and enforce ingress and egress traffic rules between the pods in your cluster. For more information, see [Secure traffic between pods using network policies in AKS][network-policies-aks].
63
63
@@ -111,7 +111,7 @@ To learn more about Windows containers on AKS, see the following resources:
0 commit comments