Skip to content

Commit a3b05a5

Browse files
Merge pull request #232088 from asudbring/vnet-old-review-2
Review of deploy container networking article
2 parents 892482c + d77e2a1 commit a3b05a5

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

articles/virtual-network/deploy-container-networking.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
---
22
title: Deploy Azure virtual network container networking
33
description: Learn how to deploy the Azure Virtual Network container network interface (CNI) plug-in for Kubernetes clusters.
4-
services: virtual-network
54
author: asudbring
6-
manager: NarayanAnnamalai
7-
tags: azure-resource-manager
85
ms.service: virtual-network
96
ms.topic: how-to
10-
ms.workload: infrastructure-services
11-
ms.date: 9/18/2018
7+
ms.date: 03/24/2023
128
ms.author: allensu
139
---
1410

@@ -22,7 +18,7 @@ The ACS-Engine deploys a Kubernetes cluster with an Azure Resource Manager templ
2218

2319
| Setting | Description |
2420
|--------------------------------------|------------------------------------------------------------------------------------------------------ |
25-
| firstConsecutiveStaticIP | The IP address that is allocated to the Master node. This is a mandatory setting. |
21+
| firstConsecutiveStaticIP | The IP address that is allocated to the main node. This setting is mandatory. |
2622
| clusterSubnet under kubernetesConfig | CIDR of the virtual network subnet where the cluster is deployed, and from which IP addresses are allocated to Pods |
2723
| vnetSubnetId under masterProfile | Specifies the Azure Resource Manager resource ID of the subnet where the cluster is to be deployed |
2824
| vnetCidr | CIDR of the virtual network where the cluster is deployed |
@@ -31,8 +27,10 @@ The ACS-Engine deploys a Kubernetes cluster with an Azure Resource Manager templ
3127
### Example configuration
3228

3329
The json example that follows is for a cluster with the following properties:
34-
- 1 Master node and 2 Agent nodes
35-
- Is deployed in a subnet named *KubeClusterSubnet* (10.0.0.0/20), with both Master and Agent nodes residing in it.
30+
31+
- One main node and two agent nodes
32+
33+
- Deployed in a subnet named *KubeClusterSubnet* (10.0.0.0/20), with both main and agent nodes residing in it.
3634

3735
```json
3836
{
@@ -82,39 +80,45 @@ The json example that follows is for a cluster with the following properties:
8280
Complete the following steps to install the plug-in on every Azure virtual machine in a Kubernetes cluster:
8381

8482
1. [Download and install the plug-in](#download-and-install-the-plug-in).
85-
2. Pre-allocate a virtual network IP address pool on every virtual machine from which IP addresses will be assigned to Pods. Every Azure virtual machine comes with a primary virtual network private IP address on each network interface. The pool of IP addresses for Pods is added as secondary addresses (*ipconfigs*) on the virtual machine network interface, using one of the following options:
83+
84+
2. Preallocate a virtual network IP address pool on every virtual machine from which IP addresses are assigned to Pods. Every Azure virtual machine comes with a primary virtual network private IP address on each network interface. The pool of IP addresses for Pods is added as secondary addresses (*ipconfigs*) on the virtual machine network interface, using one of the following options:
8685

8786
- **CLI**[Assign multiple IP addresses using the Azure CLI](./ip-services/virtual-network-multiple-ip-addresses-cli.md)
87+
8888
- **PowerShell**[Assign multiple IP addresses using PowerShell](./ip-services/virtual-network-multiple-ip-addresses-powershell.md)
89+
8990
- **Portal**[Assign multiple IP addresses using the Azure portal](./ip-services/virtual-network-multiple-ip-addresses-portal.md)
91+
9092
- **Azure Resource Manager template**[Assign multiple IP addresses using templates](./template-samples.md)
9193

9294
Ensure that you add enough IP addresses for all of the Pods that you expect to bring up on the virtual machine.
9395

94-
3. Select the plug-in for providing networking for your cluster by passing Kubelet the `–network-plugin=cni` command-line option during cluster creation. Kubernetes, by default, looks for the plug-in and the configuration file in the directories where they are already installed.
96+
3. Select the plug-in for providing networking for your cluster by passing Kubelet the `–network-plugin=cni` command-line option during cluster creation. Kubernetes, by default, looks for the plug-in and the configuration file in the directories where they're already installed.
97+
9598
4. If you want your Pods to access the internet, add the following *iptables* rule on your Linux virtual machines to source-NAT internet traffic. In the following example, the specified IP range is 10.0.0.0/8.
9699

97100
```bash
98101
iptables -t nat -A POSTROUTING -m iprange ! --dst-range 168.63.129.16 -m
99102
addrtype ! --dst-type local ! -d 10.0.0.0/8 -j MASQUERADE
100103
```
101104

102-
The rules NAT traffic that is not destined to the specified IP ranges. The assumption is that all traffic outside the previous ranges is internet traffic. You can choose to specify the IP ranges of the virtual machine's virtual network, that of peered virtual networks, and on-premises networks.
105+
The rules NAT traffic that isn't destined to the specified IP ranges. The assumption is that all traffic outside the previous ranges is internet traffic. You can choose to specify the IP ranges of the virtual machine's virtual network, that of peered virtual networks, and on-premises networks.
103106

104-
Windows virtual machines automatically source NAT traffic that has a destination outside the subnet to which the virtual machine belongs. It is not possible to specify custom IP ranges.
107+
Windows virtual machines automatically source NAT traffic that has a destination outside the subnet to which the virtual machine belongs. It isn't possible to specify custom IP ranges.
105108

106-
After completing the previous steps, Pods brought up on the Kubernetes Agent virtual machines are automatically assigned private IP addresses from the virtual network.
109+
After completion of the previous steps, Pods brought up on the Kubernetes Agent virtual machines are automatically assigned private IP addresses from the virtual network.
107110

108111
## Deploy plug-in for Docker containers
109112

110113
1. [Download and install the plug-in](#download-and-install-the-plug-in).
114+
111115
2. Create Docker containers with the following command:
112116

113117
```
114118
./docker-run.sh \<container-name\> \<container-namespace\> \<image\>
115119
```
116120

117-
The containers automatically start receiving IP addresses from the allocated pool. If you want to load balance traffic to the Docker containers, they must be placed behind a software load balancer, and you must configure a load balancer probe, the same way you create a policy and probes for a virtual machine.
121+
The containers automatically start receiving IP addresses from the allocated pool. If you want to load balance traffic to the Docker containers, they must be placed behind a software load balancer with a load balancer probe.
118122

119123
### CNI network configuration file
120124

@@ -146,23 +150,29 @@ The CNI network configuration file is described in JSON format. It is, by defaul
146150

147151
#### Settings explanation
148152

149-
- **cniVersion**: The Azure Virtual Network CNI plug-ins support versions 0.3.0 and 0.3.1 of the [CNI spec](https://github.com/containernetworking/cni/blob/master/SPEC.md).
150-
- **name**: Name of the network. This property can be set to any unique value.
151-
- **type**: Name of the network plug-in. Set to *azure-vnet*.
152-
- **mode**: Operational mode. This field is optional. The only mode supported is "bridge". For more information, see [operational modes](https://github.com/Azure/azure-container-networking/blob/master/docs/network.md).
153-
- **bridge**: Name of the bridge that will be used to connect containers to a virtual network. This field is optional. If omitted, the plugin automatically picks a unique name, based on the master interface index.
154-
- **ipam type**: Name of the IPAM plug-in. Always set to *azure-vnet-ipam*.
153+
- **"cniVersion"**: The Azure Virtual Network CNI plug-ins support versions 0.3.0 and 0.3.1 of the [CNI spec](https://github.com/containernetworking/cni/blob/master/SPEC.md).
154+
155+
- **"name"**: Name of the network. This property can be set to any unique value.
156+
157+
- **"type"**: Name of the network plug-in. Set to **azure-vnet**.
158+
159+
- **"mode"**: Operational mode. This field is optional. The only mode supported is "bridge". For more information, see [operational modes](https://github.com/Azure/azure-container-networking/blob/master/docs/network.md).
160+
161+
- **"bridge"**: Name of the bridge that is used to connect containers to a virtual network. This field is optional. If omitted, the plugin automatically picks a unique name, based on the main interface index.
162+
163+
- **"ipam"** - **"type"**: Name of the IPAM plug-in. Always set to **azure-vnet-ipam**.
155164

156165
## Download and install the plug-in
157166

158167
Download the plug-in from [GitHub](https://github.com/Azure/azure-container-networking/releases). Download the latest version for the platform that you're using:
159168

160169
- **Linux**: [azure-vnet-cni-linux-amd64-\<version no.\>.tgz](https://github.com/Azure/azure-container-networking/releases/download/v1.4.20/azure-vnet-cni-linux-amd64-v1.4.20.tgz)
170+
161171
- **Windows**: [azure-vnet-cni-windows-amd64-\<version no.\>.zip](https://github.com/Azure/azure-container-networking/releases/download/v1.4.20/azure-vnet-cni-windows-amd64-v1.4.20.zip)
162172

163173
Copy the install script for [Linux](https://github.com/Azure/azure-container-networking/blob/master/scripts/install-cni-plugin.sh) or [Windows](https://github.com/Azure/azure-container-networking/blob/master/scripts/Install-CniPlugin.ps1) to your computer. Save the script to a `scripts` directory on your computer and name the file `install-cni-plugin.sh` for Linux, or `install-cni-plugin.ps1` for Windows.
164174

165-
To install the plug-in, run the appropriate script for your platform, specifying the version of the plug-in you are using. For example, you might specify *v1.4.20*. For the Linux install, you'll also need to provide an appropriate [CNI plugin version](https://github.com/containernetworking/plugins/releases), such as *v1.0.1*:
175+
To install the plug-in, run the appropriate script for your platform, specifying the version of the plug-in you're using. For example, you might specify *v1.4.20*. For the Linux install, provide an appropriate [CNI plugin version](https://github.com/containernetworking/plugins/releases), such as *v1.0.1*:
166176

167177
```bash
168178
scripts/install-cni-plugin.sh [azure-cni-plugin-version] [cni-plugin-version]

0 commit comments

Comments
 (0)