Windows Nodes NAT exclusion 10.0.0.0/8
What happened: When creating an AKS cluster with a windows node pool, the windows nodes with CNI have by default a NAT exclusion for 10.0.0.0/8 and the CIDR range of the vNET is not added. When creating AKS cluster in an existing vNET that is not in 10.0.0.0/8, this results in traffic destined for other subnets in the vNET being natted. For example vNET is 15.0.0.0/8 Subnet for AKS is 15.0.0.0/16 Subnet for Application Gateway is 15.1.0.0/16 The windows nodes cni.conf contains NAT exclusions for AKS subnet but not for AppGW subnet or the rest of the vNET. It does however contain an exclusion for 10.0.0.0/8 which seems to be the default.
What you expected to happen: NAT exclusions should reflect the values from actual environment ( vNET CIDR, Service CIDR,)
How to reproduce it (as minimally and precisely as possible): Create AKS cluster with windows nodes and using App.Gateway as Ingress: pods are not reachable from application gateway.
Anything else we need to know?: In AKS-Engine there is a vNETCidr parameter that can be added and that changes the default exclusion. I believe the issue is described here: https://github.com/Azure/aks-engine/issues/2080 https://github.com/Azure/application-gateway-kubernetes-ingress/issues/535 How would we implement vnetcidr parameter using ARM / Terraform ?
Environment:
- Kubernetes version (use
kubectl version):1.16.3 - Size of cluster (how many worker nodes are in the cluster?): 2
- General description of workloads in the cluster (e.g. HTTP microservices, Java app, Ruby on Rails, machine learning, etc.) .NET services
- Others:
@MikkelHegn fyi
This is a bug in how AKS provisions Windows nodes. We will look in to this as soon as possible, there is no way to work around this, but trying to manipulate individual node configurations. Please open a support ticket through the Azure portal if you need assistance in work around the issue.
@frankvdbh Could you help to confirm whether this issue still exists now after Azure/aks-engine#2080 is fixed
@AbelHu we currently have this issue using "aksEngineVersion: v0.45.0-1" on our windows nodes. We followed https://azure.github.io/application-gateway-kubernetes-ingress/troubleshooting/ and it works when we host the app on the linux nodes. So it is cleary a issue with the windows nodes.
The application gateway points to the correct ip of the pod.

Pod:

@qmalexander: as a workaround, could you try to change the NAT exception rules in C:\k\azurecni\netconf\10-azure.conflist?
In the below example remove the default 10.0.0.0/8 - and change the AKS Subnet to be the whole VNET range.

A drain and reboot of the node should pick up the configuration.
@frankvdbh Could you help to confirm whether this issue still exists now after Azure/aks-engine#2080 is fixed
I deployed a new cluster. Using AKS Engine v0.45.0-1-aks It still has the issue. The exception list in the conf file contains the AKS Subnet but not the whole vNET and has the default 10.0.0.0/8 exception instead of the vnet. Anyway we can control the vNETCidr parameter for AKS-Engine? it should change this default exclusion.
Hi @MikkelHegn, during the day we have tried with your suggestion but it did not resolve the issue.
Our test To be on the safe side we deploy a simple iis container and added a loadbalancer using nginx. We can confirm that the iis works with both http and https when going to nginx but when switching to AG we get:

Application Gateway:

Pod:

@qmalexander Could you try below mitigation steps?
- Remove all pods in the Windows node
- Update
ExceptionListinC:\k\azurecni\netconf\10-azure.conflistin the Windows node: Change the first10.0.0.0/8to the address space of the vnet (not subnet) used by your cluster. - Reboot the Windows node
- Deploy a Windows pod to test it
- You also can check the
ExceptionListby executing the commandGet-HnsEndpoint | ConvertTo-Json -Depth 10in the Windows node.
@qmalexander Could you try below mitigation steps?
- Remove all pods in the Windows node
- Update
ExceptionListinC:\k\azurecni\netconf\10-azure.conflistin the Windows node: Change the first10.0.0.0/8to the address space of the vnet (not subnet) used by your cluster. My vnet is 10.0.0.0/8 so i tested to remove it from the ExceptionList.- Reboot the Windows node
- Deploy a Windows pod to test it
- You also can check the
ExceptionListby executing the commandGet-HnsEndpoint | ConvertTo-Json -Depth 10in the Windows node. ** PS C:\Users\testwesturopecluster> Get-HnsEndpoint | ConvertTo-Json -Depth 10 [ { "ActivityId": "CC37C6F4-D0E0-471F-ABE4-39B69D921D95", "AdditionalParams": {
},
"DNSServerList": "10.0.0.10",
"EncapOverhead": 50,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603825581638
},
"ID": "2462B2D1-C402-4024-9C86-5A6903AF7759",
"IPAddress": "10.240.0.11",
"InterfaceConstraint": {
"InterfaceGuid": "00000000-0000-0000-0000-000000000000"
},
"IsRemoteEndpoint": true,
"MacAddress": "02-11-0a-f0-00-0b",
"Name": "Ethernet",
"Namespace": {
"CompartmentGuid": "00000000-0000-0000-0000-000000000000",
"ID": "00000000-0000-0000-0000-000000000000"
},
"Policies": [
{
"Type": "L2Driver"
}
],
"PrefixLength": 16,
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 1,
"Allocators": [
{
"AdditionalParams": {
},
"AllocationOrder": 0,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603826015192
},
"ID": "C91B969F-0F56-467C-8B7F-175A8DE5A97D",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603825581638
},
"ID": "CC37C6F4-D0E0-471F-ABE4-39B69D921D95",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
],
"State": 1,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621c1c70-b7ff-4738-b518-a36d0c518a31",
"VirtualNetworkName": "azure"
},
{
"ActivityId": "38DA0FEC-3642-436C-96CA-0C088073E5C9",
"AdditionalParams": {
},
"CreateProcessingStartTime": 132261603806635571,
"DNSServerList": "10.0.0.10",
"DNSSuffix": "windowstestag.svc.cluster.local,svc.cluster.local,cluster.local",
"EncapOverhead": 50,
"GatewayAddress": "10.240.0.1",
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603806565699
},
"ID": "3152BF0B-6038-46AD-A3C9-ED69627340D1",
"IPAddress": "10.240.0.77",
"MacAddress": "00-15-5D-B4-27-4D",
"Name": "0946e8ab-eth0",
"Policies": [
{
"ExceptionList": [
"10.240.0.0/16"
],
"Type": "OutBoundNAT"
},
{
"DestinationPrefix": "10.0.0.0/16",
"NeedEncap": true,
"Type": "ROUTE"
},
{
"Type": "L2Driver"
}
],
"PrefixLength": 16,
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 5,
"Allocators": [
{
"AdapterNetCfgInstanceId": "{6562DF03-09E4-487E-B839-76B264C4CBBD}",
"AdditionalParams": {
},
"AllocationOrder": 0,
"CompartmendId": 2,
"Connected": true,
"DevicelessNic": true,
"EndpointNicGuid": "766295E5-B522-44BD-B000-EE9C9FE3CEF9",
"EndpointPortGuid": "B3A28435-6290-48D9-AB45-CBBDCB861B1F",
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603806765515
},
"Hidden": false,
"ID": "78751D95-2476-41A7-9B1F-1FB9B7A6DA2F",
"InterfaceGuid": "6562DF03-09E4-487E-B839-76B264C4CBBD",
"IsPolicy": false,
"IsolationId": 0,
"MTU": 1450,
"MacAddress": "00-15-5D-B4-27-4D",
"ManagementPort": false,
"NicFriendlyName": "0946e8ab-eth0",
"PreferredPortFriendlyName": "3152BF0B-6038-46AD-A3C9-ED69627340D1",
"State": 3,
"SwitchId": "A415F6C1-1E43-4088-A11B-112B555CEDA5",
"Tag": "Endpoint Port",
"WaitForIpv6Interface": false,
"nonPersistentPort": false
},
{
"AdditionalParams": {
},
"AllocationOrder": 1,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603808065629
},
"ID": "93D5F734-27EC-4650-92D0-DE33CA41D317",
"IsPolicy": true,
"Rules": [
{
"Action": "Allow",
"Direction": "In",
"Priority": 65500,
"Type": "ACL"
},
{
"Action": "Allow",
"Direction": "Out",
"Priority": 65500,
"Type": "ACL"
}
],
"State": 3,
"Tag": "ACL Policy"
},
{
"AdditionalParams": {
},
"AllocationOrder": 2,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603808405661
},
"ID": "91FD0C73-C8CD-4F0E-B78A-9214FB4C6501",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
},
{
"AdditionalParams": {
},
"AllocationOrder": 3,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603808415637
},
"ID": "69E509D6-AE8A-44AE-9BF8-A8C8A8B19377",
"IsPolicy": true,
"LocalRoutedVip": false,
"NatExceptions_0": "10.240.0.0/16",
"State": 3,
"Tag": "VFP OutBound NAT Policy",
"VIP": ""
},
{
"AdditionalParams": {
},
"AllocationOrder": 4,
"DestinationPrefix": "10.0.0.0/16",
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603808425645
},
"ID": "06B84DE0-9D8A-46A7-A27A-72A9A6731D99",
"IsPolicy": true,
"NeedEncap": true,
"NextHop": "",
"State": 3,
"Tag": "VFP Route Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603806575637
},
"ID": "38DA0FEC-3642-436C-96CA-0C088073E5C9",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
"0946e8ab53de40887765e3a84772c52fe158b219b5f3a9aec2b11488e5e7e758",
"78dd02b717c82960daa21febc1abb3c4d38b19d8406892386cc93d8ec1b7ec78"
],
"StartTime": 132261603808057675,
"State": 3,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621C1C70-B7FF-4738-B518-A36D0C518A31",
"VirtualNetworkName": "azure"
},
{
"ActivityId": "F7D9F05F-9F37-4872-AE39-0B324226C164",
"AdditionalParams": {
},
"DNSServerList": "10.0.0.10",
"EncapOverhead": 50,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603821932597
},
"ID": "81808B1A-82E0-4628-8DE2-0AA43E17138B",
"IPAddress": "10.240.0.33",
"InterfaceConstraint": {
"InterfaceGuid": "00000000-0000-0000-0000-000000000000"
},
"IsRemoteEndpoint": true,
"MacAddress": "02-11-0a-f0-00-21",
"Name": "Ethernet",
"Namespace": {
"CompartmentGuid": "00000000-0000-0000-0000-000000000000",
"ID": "00000000-0000-0000-0000-000000000000"
},
"Policies": [
{
"Type": "L2Driver"
}
],
"PrefixLength": 16,
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 1,
"Allocators": [
{
"AdditionalParams": {
},
"AllocationOrder": 0,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603822012577
},
"ID": "2961E92F-CD91-45E3-88B9-FD9E6C7A2C1E",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603821932597
},
"ID": "F7D9F05F-9F37-4872-AE39-0B324226C164",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
],
"State": 1,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621c1c70-b7ff-4738-b518-a36d0c518a31",
"VirtualNetworkName": "azure"
},
{
"ActivityId": "1638CA51-6374-4319-9FF3-9D3B7A1508DB",
"AdditionalParams": {
},
"DNSServerList": "10.0.0.10",
"EncapOverhead": 50,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603821692423
},
"ID": "914F8B1F-B960-4532-ADA3-B180718001EF",
"IPAddress": "10.240.0.7",
"InterfaceConstraint": {
"InterfaceGuid": "00000000-0000-0000-0000-000000000000"
},
"IsRemoteEndpoint": true,
"MacAddress": "02-11-0a-f0-00-07",
"Name": "Ethernet",
"Namespace": {
"CompartmentGuid": "00000000-0000-0000-0000-000000000000",
"ID": "00000000-0000-0000-0000-000000000000"
},
"Policies": [
{
"Type": "L2Driver"
}
],
"PrefixLength": 16,
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 1,
"Allocators": [
{
"AdditionalParams": {
},
"AllocationOrder": 0,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603821772468
},
"ID": "AEAE66BD-D07D-4013-8B41-8A24DDD72D85",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603821692423
},
"ID": "1638CA51-6374-4319-9FF3-9D3B7A1508DB",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
],
"State": 1,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621c1c70-b7ff-4738-b518-a36d0c518a31",
"VirtualNetworkName": "azure"
},
{
"ActivityId": "FF011113-47A9-43F7-BDA9-D367E0969BF3",
"AdditionalParams": {
},
"DNSServerList": "10.0.0.10",
"EncapOverhead": 50,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603823536376
},
"ID": "806B31AA-1C20-494B-9C18-170E59276B55",
"IPAddress": "10.240.0.10",
"InterfaceConstraint": {
"InterfaceGuid": "00000000-0000-0000-0000-000000000000"
},
"IsRemoteEndpoint": true,
"MacAddress": "02-11-0a-f0-00-0a",
"Name": "Ethernet",
"Namespace": {
"CompartmentGuid": "00000000-0000-0000-0000-000000000000",
"ID": "00000000-0000-0000-0000-000000000000"
},
"Policies": [
{
"Type": "L2Driver"
}
],
"PrefixLength": 16,
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 1,
"Allocators": [
{
"AdditionalParams": {
},
"AllocationOrder": 0,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603824930377
},
"ID": "815D82DC-F624-4DF9-878E-A586C487C955",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603823536376
},
"ID": "FF011113-47A9-43F7-BDA9-D367E0969BF3",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
],
"State": 1,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621c1c70-b7ff-4738-b518-a36d0c518a31",
"VirtualNetworkName": "azure"
},
{
"ActivityId": "B567288B-010C-490C-B514-CF24E8268AA5",
"AdditionalParams": {
},
"DNSServerList": "10.0.0.10",
"EncapOverhead": 50,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603826549007
},
"ID": "29FAC262-F92F-468E-A218-EA5CFAE5E265",
"IPAddress": "51.105.129.224",
"InterfaceConstraint": {
"InterfaceGuid": "00000000-0000-0000-0000-000000000000"
},
"IsRemoteEndpoint": true,
"MacAddress": "02-11-33-69-81-e0",
"Name": "Ethernet",
"Namespace": {
"CompartmentGuid": "00000000-0000-0000-0000-000000000000",
"ID": "00000000-0000-0000-0000-000000000000"
},
"Policies": [
{
"Type": "L2Driver"
}
],
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 1,
"Allocators": [
{
"AdditionalParams": {
},
"AllocationOrder": 0,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603829518722
},
"ID": "C0298EE7-8B33-479F-B53D-D3AD11651E0E",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603826549007
},
"ID": "B567288B-010C-490C-B514-CF24E8268AA5",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
],
"State": 1,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621c1c70-b7ff-4738-b518-a36d0c518a31",
"VirtualNetworkName": "azure"
},
{
"ActivityId": "C3901E54-B0B0-438F-8BF6-A1AF6EA75D44",
"AdditionalParams": {
},
"DNSServerList": "10.0.0.10",
"EncapOverhead": 50,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603830577746
},
"ID": "5E137442-AAC0-41CD-B6C2-CE0240D3443A",
"IPAddress": "10.240.0.19",
"InterfaceConstraint": {
"InterfaceGuid": "00000000-0000-0000-0000-000000000000"
},
"IsRemoteEndpoint": true,
"MacAddress": "02-11-0a-f0-00-13",
"Name": "Ethernet",
"Namespace": {
"CompartmentGuid": "00000000-0000-0000-0000-000000000000",
"ID": "00000000-0000-0000-0000-000000000000"
},
"Policies": [
{
"Type": "L2Driver"
}
],
"PrefixLength": 16,
"Resources": {
"AdditionalParams": {
},
"AllocationOrder": 1,
"Allocators": [
{
"AdditionalParams": {
},
"AllocationOrder": 0,
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603831491012
},
"ID": "79676C4C-CC95-476B-B7C4-27F786E60F48",
"IsPolicy": true,
"State": 3,
"Tag": "L2Driver Policy"
}
],
"Health": {
"LastErrorCode": 0,
"LastUpdateTime": 132261603830577746
},
"ID": "C3901E54-B0B0-438F-8BF6-A1AF6EA75D44",
"PortOperationTime": 0,
"State": 1,
"SwitchOperationTime": 0,
"VfpOperationTime": 0,
"parentId": "A9F41702-0723-4801-A20B-B17DA8BA8B5E"
},
"SharedContainers": [
],
"State": 1,
"Type": "l2bridge",
"Version": 38654705666,
"VirtualNetwork": "621c1c70-b7ff-4738-b518-a36d0c518a31",
"VirtualNetworkName": "azure"
}
] **
This did not solve the issue.
Fix in #1466