Skip to content

Commit 8b35082

Browse files
authored
docs: (IAC-325) document support of Azure CNI plugin (#293)
1 parent 01433e1 commit 8b35082

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

docs/CONFIG-VARS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ You can use `default_public_access_cidrs` to set a default range for all created
8383
| :--- | ---: | ---: | ---: | :--- |
8484
| vnet_address_space | Address space for created vnet | string | "192.168.0.0/16" | This variable is ignored when vnet_name is set (AKA bring your own vnet). |
8585
| subnets | Subnets to be created and their settings | map(object) | *check below* | This variable is ignored when subnet_names is set (AKA bring your own subnets). All defined subnets must exist within the vnet address space. |
86-
| cluster_egress_type | The outbound (egress) routing method to be used for this Kubernetes Cluster | string | "loadBalancer" | Possible values: <ul><li>`loadBalancer`<li>`userDefinedRouting`</ul> By default, AKS will create and use a [loadbalancer](https://docs.microsoft.com/en-us/azure/aks/load-balancer-standard) for outgoing connections.<p>Set to `userDefinedRouting` when using your own network [egress](https://docs.microsoft.com/en-us/azure/aks/egress-outboundtype). |
86+
| cluster_egress_type | The outbound (egress) routing method to be used for this Kubernetes Cluster | string | "loadBalancer" | Possible values: <ul><li>`loadBalancer`<li>`userDefinedRouting`</ul> By default, AKS will create and use a [loadbalancer](https://docs.microsoft.com/en-us/azure/aks/load-balancer-standard) for outgoing connections.<p>Set to `userDefinedRouting` when using your own network [egress](https://docs.microsoft.com/en-us/azure/aks/egress-outboundtype).|
87+
| aks_network_plugin | Network plugin to use for networking. Currently supported values are `azure` and `kubenet`| string | `kubenet`| For details see Azure's documentation on: [configure kubenet](https://docs.microsoft.com/en-us/azure/aks/configure-kubenet), [Configure Azure CNI](https://learn.microsoft.com/en-us/azure/aks/configure-azure-cni).<br>**Note**: To support Azure CNI your Subnet must be large enough to accommodate the nodes, pods, and all Kubernetes and Azure resources that might be provisioned in your cluster.<br>To calculate the minimum subnet size including an additional node for upgrade operations use formula: `(number of nodes + 1) + ((number of nodes + 1) * maximum pods per node that you configure)` <br>Example for a 5 node cluster: `(5) + (5 * 110) = 555 (/22 or larger)`|
88+
| aks_network_policy | Sets up network policy to be used with Azure CNI. Network policy allows to control the traffic flow between pods. Currently supported values are `calico` and `azure`.| string | `azure`| Network policy can only be used when `aks_network_plugin` is set to `azure`. |
8789

8890

8991
The default values for the `subnets` variable are as follows:

variables.tf

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,22 @@ variable "aks_network_plugin" {
122122
description = "Network plugin to use for networking. Currently supported values are azure and kubenet. Changing this forces a new resource to be created."
123123
type = string
124124
default = "kubenet"
125-
#TODO: add validation when value is 'azure'
125+
126+
validation {
127+
condition = contains(["kubenet", "azure"], var.aks_network_plugin)
128+
error_message = "Error: Currently the supported values are `kubenet` and `azure`"
129+
}
126130
}
127131

128132
variable "aks_network_policy" {
129-
description = "Sets up network policy to be used with Azure CNI. Network policy allows us to control the traffic flow between pods. Currently supported values are calico and azure. Changing this forces a new resource to be created."
133+
description = "Sets up network policy to be used with Azure CNI. Network policy allows to control the traffic flow between pods. Currently supported values are calico and azure. Changing this forces a new resource to be created."
130134
type = string
131135
default = "azure"
132-
#TODO: add validation
136+
137+
validation {
138+
condition = contains(["azure", "calico"], var.aks_network_policy)
139+
error_message = "Error: Currently the supported values are `calico` and `azure`"
140+
}
133141
}
134142

135143
variable "aks_dns_service_ip" {

0 commit comments

Comments
 (0)