Skip to content

Commit b3586f2

Browse files
authored
feat: (IAC-1336) Add support for specifying K8s support plan (#361)
1 parent 87a00f5 commit b3586f2

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

docs/CONFIG-VARS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ Ubuntu 20.04 LTS is the operating system used on the Jump/NFS servers. Ubuntu cr
194194
| ssh_public_key | File name of public ssh key for jump and nfs VM | string | "~/.ssh/id_rsa.pub" | Required with `create_jump_vm=true` or `storage_type=standard` |
195195
| cluster_api_mode | Public or private IP for the cluster api | string | "public" | Valid Values: "public", "private" |
196196
| aks_cluster_private_dns_zone_id | Specifies private DNS zone resource ID for AKS private cluster to use | string | "" | For `cluster_api_mode=private` if `aks_cluster_private_dns_zone_id` is not specified then the value `System` is used else it is set to null. For details see [Configure a private DNS zone](https://learn.microsoft.com/en-us/azure/aks/private-clusters?tabs=azure-portal#configure-a-private-dns-zone) |
197-
| aks_cluster_sku_tier | Optimizes api server for cost vs availability | string | "Free" | Valid Values: "Free", "Standard" |
197+
| aks_cluster_sku_tier | The SKU Tier that should be used for this Kubernetes Cluster. Optimizes api server for cost vs availability | string | "Free" | Valid Values: "Free", "Standard" and "Premium" |
198+
| cluster_support_tier | Specifies the support plan which should be used for this Kubernetes Cluster. | string | "KubernetesOfficial" | Possible values are `KubernetesOfficial` and `AKSLongTermSupport`. To enable long term K8s support is a combination of setting `aks_cluster_sku_tier` to `Premium` tier and explicitly selecting the `cluster_support_tier` as `AKSLongTermSupport`. For details see [Long term Support](https://learn.microsoft.com/en-us/azure/aks/long-term-support) and for which K8s version has long term support see [AKS Kubernetes release calendar](https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-kubernetes-release-calendar).|
198199

199200
## Node Pools
200201

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ module "aks" {
134134
aks_cluster_dns_prefix = "${var.prefix}-aks"
135135
aks_cluster_sku_tier = var.aks_cluster_sku_tier
136136
aks_cluster_location = var.location
137+
cluster_support_tier = var.cluster_support_tier
137138
fips_enabled = var.fips_enabled
138139
aks_cluster_node_auto_scaling = var.default_nodepool_min_nodes == var.default_nodepool_max_nodes ? false : true
139140
aks_cluster_node_count = var.default_nodepool_min_nodes

modules/azure_aks/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ resource "azurerm_kubernetes_cluster" "aks" {
1010
dns_prefix_private_cluster = var.aks_private_cluster && var.aks_cluster_private_dns_zone_id != "" ? var.aks_cluster_dns_prefix : null
1111

1212
sku_tier = var.aks_cluster_sku_tier
13+
support_plan = var.cluster_support_tier
1314
role_based_access_control_enabled = true
1415
http_application_routing_enabled = false
1516

modules/azure_aks/variables.tf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,22 @@ variable "aks_cluster_location" {
2323
}
2424

2525
variable "aks_cluster_sku_tier" {
26-
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Standard (which includes the Uptime SLA). Defaults to Free"
26+
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free, Standard (which includes the Uptime SLA) and Premium. Defaults to Free"
2727
type = string
2828
default = "Free"
2929

3030
validation {
31-
condition = contains(["Free", "Standard"], var.aks_cluster_sku_tier)
32-
error_message = "ERROR: Valid types are \"Free\" and \"Standard\"!"
31+
condition = contains(["Free", "Standard", "Premium"], var.aks_cluster_sku_tier)
32+
error_message = "ERROR: Valid types are \"Free\", \"Standard\" and \"Premium\"!"
3333
}
3434
}
3535

36+
variable "cluster_support_tier" {
37+
description = "Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are 'KubernetesOfficial' and 'AKSLongTermSupport'. Defaults to 'KubernetesOfficial'."
38+
type = string
39+
default = "KubernetesOfficial"
40+
}
41+
3642
variable "fips_enabled" {
3743
description = "Should the nodes in this Node Pool have Federal Information Processing Standard enabled? Changing this forces a new resource to be created."
3844
type = bool

variables.tf

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,24 @@ variable "location" {
5959
}
6060

6161
variable "aks_cluster_sku_tier" {
62-
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Standard (which includes the Uptime SLA). Defaults to Free"
62+
description = "The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free, Standard (which includes the Uptime SLA) and Premium. Defaults to Free"
6363
type = string
6464
default = "Free"
6565

6666
validation {
67-
condition = contains(["Free", "Standard"], var.aks_cluster_sku_tier)
68-
error_message = "ERROR: Valid types are \"Free\" and \"Standard\"!"
67+
condition = contains(["Free", "Standard", "Premium"], var.aks_cluster_sku_tier)
68+
error_message = "ERROR: Valid types are \"Free\", \"Standard\" and \"Premium\"!"
69+
}
70+
}
71+
72+
variable "cluster_support_tier" {
73+
description = "Specifies the support plan which should be used for this Kubernetes Cluster. Possible values are 'KubernetesOfficial' and 'AKSLongTermSupport'. Defaults to 'KubernetesOfficial'."
74+
type = string
75+
default = "KubernetesOfficial"
76+
77+
validation {
78+
condition = contains(["KubernetesOfficial", "AKSLongTermSupport"], var.cluster_support_tier)
79+
error_message = "ERROR: Valid types are \"KubernetesOfficial\" and \"AKSLongTermSupport\"!"
6980
}
7081
}
7182

0 commit comments

Comments
 (0)