Skip to content

Commit 9151279

Browse files
authored
Merge pull request #225 from sassoftware/staging
March Release - 4.4.0
2 parents 6b1e2f5 + e012974 commit 9151279

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

docs/CONFIG-VARS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Terraform input variables can be set in the following ways:
3232
| Name | Description | Type | Default | Notes |
3333
| :--- | ---: | ---: | ---: | ---: |
3434
| prefix | A prefix used in the name of all the Azure resources created by this script. | string | | The prefix string must start with a lowercase letter and contain only lowercase alphanumeric characters and dashes (-), but it cannot end with a dash. |
35-
| location | The Azure Region to provision all resources in this script. | string | "East US" | |
35+
| location | The Azure Region to provision all resources in this script. | string | "eastus" | |
3636

3737
### Azure Authentication
3838

@@ -80,9 +80,11 @@ You can use `default_public_access_cidrs` to set a default range for all created
8080
## Networking
8181

8282
| Name | Description | Type | Default | Notes |
83-
| :--- | ---: | ---: | ---: | ---: |
83+
| :--- | ---: | ---: | ---: | :--- |
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). |
87+
8688

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

@@ -139,8 +141,6 @@ Note: All of the following resources are expected to be in the Resource Group se
139141
| subnet_names | Existing subnets mapped to desired usage. | map(string) | null | Only required if deploying into existing subnets. See the example that follows. |
140142
| nsg_name | Name of pre-existing network security group. | string | null | Only required if deploying into existing NSG. |
141143
| aks_uai_name | Name of existing User Assigned Identity for the cluster | string | null | This Identity will need permissions as listed in [AKS Cluster Identity Permissions](https://docs.microsoft.com/en-us/azure/aks/concepts-identity#aks-cluster-identity-permissions) and [Additional Cluster Identity Permissions](https://docs.microsoft.com/en-us/azure/aks/concepts-identity#additional-cluster-identity-permissions). Alternatively, use can use the [Contributor](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role for this Identity. |
142-
| egress_public_ip_name | Name of pre-existing public ip resource for your network egress (NAT, Firewall, or similar). | string | null | Only required when using your own network [egress](https://docs.microsoft.com/en-us/azure/aks/egress-outboundtype). By default, AKS will create and use a [loadbalancer](https://docs.microsoft.com/en-us/azure/aks/load-balancer-standard) for outgoing connections. |
143-
144144

145145
Example for the `subnet_names` variable:
146146

docs/user/BYOnetwork.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Any BYO resources you bring are expected to be in the `vnet_resource_group_name`
2020
| :--- | :--- | :--- | :--- |
2121
| Use an existing VNET | `vnet_name` | <ul><li>the VNET IPv4 address space(s) must encompass the subnet cidr ranges as set by the [`subnets` variable](../CONFIG-VARS.md#networking) |creates a VNET with the primary address space as set in the [`vnet_address_space` variable](../CONFIG-VARS.md#networking).|
2222
| Use VNET with Subnets | `subnet_names` | <ul><li>a VNET set with the `vnet_name` variable.<li>use the subnet attributes as listed in the default value for the [`subnets` variable](../CONFIG-VARS.md#networking) <li>you also need to have a [Route Table and a Route to the aks subnet](https://docs.microsoft.com/en-us/azure/aks/configure-kubenet#bring-your-own-subnet-and-route-table-with-kubenet)<li>an [AKS Cluster identity](#cluster-identity) with write permissions to the aks subnet and route table | creates subnets as set in the [`subnets` variable](../CONFIG-VARS.md#networking), as well as a Route Table for the AKS subnet. Note that [AKS will modify the Route Table](https://docs.microsoft.com/en-us/azure/aks/configure-kubenet#bring-your-own-subnet-and-route-table-with-kubenet). |
23-
| Network Egress| `egress_public_ip_name` | <ul><li>A VNET and subnets set with the `vnet_name` and `subnet_names` variables. | AKS will create and use a [loadbalancer](https://docs.microsoft.com/en-us/azure/aks/load-balancer-standard) for outoing traffic.
23+
| Provide Network Egress| `cluster_egress_type="userDefinedRouting"` | <ul><li>A VNET and subnets set with the `vnet_name` and `subnet_names` variables. <li>Network [egress](https://docs.microsoft.com/en-us/azure/aks/egress-outboundtype) needs to be defined (with NAT, Azure Firewall or similar) | AKS will create and use a [loadbalancer](https://docs.microsoft.com/en-us/azure/aks/load-balancer-standard) for outgoing traffic.|
2424

2525
## Network Security Group
2626

locals.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,13 @@ locals {
5959
)
6060
: null
6161
)
62+
63+
cluster_egress_type = ( var.cluster_egress_type == null
64+
? ( var.egress_public_ip_name == null
65+
? "loadBalancer"
66+
: "userDefinedRouting"
67+
)
68+
: var.cluster_egress_type
69+
)
6270
}
6371

main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,14 @@ module "aks" {
155155
aks_network_policy = var.aks_network_policy
156156
aks_dns_service_ip = var.aks_dns_service_ip
157157
aks_docker_bridge_cidr = var.aks_docker_bridge_cidr
158-
aks_outbound_type = var.aks_outbound_type
158+
cluster_egress_type = local.cluster_egress_type
159159
aks_pod_cidr = var.aks_pod_cidr
160160
aks_service_cidr = var.aks_service_cidr
161161
aks_cluster_tags = var.tags
162162
aks_uai_id = local.aks_uai_id
163163
client_id = var.client_id
164164
client_secret = var.client_secret
165165
aks_private_cluster = var.cluster_api_mode == "private" ? true : false
166-
cluster_egress_type = var.egress_public_ip_name == null ? "loadBalancer" : "userDefinedRouting"
167166
depends_on = [module.vnet]
168167
}
169168

modules/azure_aks/variables.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ variable aks_cluster_dns_prefix {}
66

77
variable "aks_cluster_location" {
88
description = "The Azure Region in which all resources in this example should be provisioned"
9-
default = "East US"
9+
default = "eastus"
1010
}
1111

1212
variable "aks_private_cluster" {
@@ -91,11 +91,6 @@ variable "aks_docker_bridge_cidr" {
9191
default = "172.17.0.1/16"
9292
}
9393

94-
variable "aks_outbound_type" {
95-
description = "The outbound (egress) routing method which should be used for this Kubernetes Cluster. Possible values are loadBalancer and userDefinedRouting. Defaults to loadBalancer."
96-
default = "loadBalancer"
97-
}
98-
9994
variable "aks_pod_cidr" {
10095
description = "The CIDR to use for pod IP addresses. This field can only be set when network_plugin is set to kubenet. Changing this forces a new resource to be created."
10196
default = "10.244.0.0/16"

variables.tf

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ variable "prefix" {
3838
}
3939
variable "location" {
4040
description = "The Azure Region to provision all resources in this script"
41-
default = "East US"
41+
default = "eastus"
4242
}
4343

4444
variable "ssh_public_key" {
@@ -134,9 +134,14 @@ variable "aks_docker_bridge_cidr" {
134134
default = "172.17.0.1/16"
135135
}
136136

137-
variable "aks_outbound_type" {
137+
variable "cluster_egress_type" {
138138
description = "The outbound (egress) routing method which should be used for this Kubernetes Cluster. Possible values are loadBalancer and userDefinedRouting. Defaults to loadBalancer."
139-
default = "loadBalancer"
139+
default = null
140+
validation {
141+
condition = var.cluster_egress_type != null ? contains(["loadBalancer", "userDefinedRouting"], var.cluster_egress_type) : true
142+
error_message = "ERROR: Supported values for `cluster_egress_type` are: loadBalancer, userDefinedRouting."
143+
}
144+
140145
}
141146

142147
variable "aks_pod_cidr" {
@@ -513,7 +518,7 @@ variable "nsg_name" {
513518
variable "egress_public_ip_name" {
514519
type = string
515520
default = null
516-
description = "Name of pre-existing Public IP for the Network egress."
521+
description = "DEPRECATED: Name of pre-existing Public IP for the Network egress."
517522
}
518523

519524
variable "subnet_names" {

0 commit comments

Comments
 (0)