Skip to content

Commit 3057190

Browse files
committed
Fix aks
1 parent 5e9d165 commit 3057190

File tree

6 files changed

+5
-179
lines changed

6 files changed

+5
-179
lines changed

scenarios/AksOpenAiTerraform/terraform/main.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,14 @@ module "aks_cluster" {
139139
kubernetes_version = var.kubernetes_version
140140
dns_prefix = lower(var.aks_cluster_name)
141141
private_cluster_enabled = var.private_cluster_enabled
142-
automatic_channel_upgrade = var.automatic_channel_upgrade
143142
sku_tier = var.sku_tier
144143
system_node_pool_name = var.system_node_pool_name
145144
system_node_pool_vm_size = var.system_node_pool_vm_size
146145
vnet_subnet_id = module.virtual_network.subnet_ids[var.system_node_pool_subnet_name]
147146
pod_subnet_id = module.virtual_network.subnet_ids[var.pod_subnet_name]
148147
system_node_pool_availability_zones = var.system_node_pool_availability_zones
149148
system_node_pool_node_labels = var.system_node_pool_node_labels
150-
system_node_pool_node_taints = var.system_node_pool_node_taints
151-
system_node_pool_enable_auto_scaling = var.system_node_pool_enable_auto_scaling
152-
system_node_pool_enable_host_encryption = var.system_node_pool_enable_host_encryption
153-
system_node_pool_enable_node_public_ip = var.system_node_pool_enable_node_public_ip
154149
system_node_pool_max_pods = var.system_node_pool_max_pods
155-
system_node_pool_max_count = var.system_node_pool_max_count
156-
system_node_pool_min_count = var.system_node_pool_min_count
157-
system_node_pool_node_count = var.system_node_pool_node_count
158150
system_node_pool_os_disk_type = var.system_node_pool_os_disk_type
159151
tags = var.tags
160152
network_dns_service_ip = var.network_dns_service_ip
@@ -194,14 +186,10 @@ module "node_pool" {
194186
availability_zones = var.user_node_pool_availability_zones
195187
vnet_subnet_id = module.virtual_network.subnet_ids[var.user_node_pool_subnet_name]
196188
pod_subnet_id = module.virtual_network.subnet_ids[var.pod_subnet_name]
197-
enable_auto_scaling = var.user_node_pool_enable_auto_scaling
198189
enable_host_encryption = var.user_node_pool_enable_host_encryption
199190
enable_node_public_ip = var.user_node_pool_enable_node_public_ip
200191
orchestrator_version = var.kubernetes_version
201192
max_pods = var.user_node_pool_max_pods
202-
max_count = var.user_node_pool_max_count
203-
min_count = var.user_node_pool_min_count
204-
node_count = var.user_node_pool_node_count
205193
os_type = var.user_node_pool_os_type
206194
priority = var.user_node_pool_priority
207195
tags = var.tags

scenarios/AksOpenAiTerraform/terraform/modules/aks/main.tf

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,25 @@ resource "azurerm_kubernetes_cluster" "aks_cluster" {
2828
kubernetes_version = var.kubernetes_version
2929
dns_prefix = var.dns_prefix
3030
private_cluster_enabled = var.private_cluster_enabled
31-
automatic_channel_upgrade = var.automatic_channel_upgrade
31+
automatic_upgrade_channel = "stable"
3232
sku_tier = var.sku_tier
3333
workload_identity_enabled = var.workload_identity_enabled
3434
oidc_issuer_enabled = var.oidc_issuer_enabled
3535
open_service_mesh_enabled = var.open_service_mesh_enabled
3636
image_cleaner_enabled = var.image_cleaner_enabled
3737
azure_policy_enabled = var.azure_policy_enabled
38+
image_cleaner_interval_hours = 72
3839
http_application_routing_enabled = var.http_application_routing_enabled
3940

4041
default_node_pool {
4142
name = var.system_node_pool_name
43+
node_count = 1
4244
vm_size = var.system_node_pool_vm_size
4345
vnet_subnet_id = var.vnet_subnet_id
4446
pod_subnet_id = var.pod_subnet_id
4547
zones = var.system_node_pool_availability_zones
4648
node_labels = var.system_node_pool_node_labels
47-
node_taints = var.system_node_pool_node_taints
48-
enable_auto_scaling = var.system_node_pool_enable_auto_scaling
49-
enable_host_encryption = var.system_node_pool_enable_host_encryption
50-
enable_node_public_ip = var.system_node_pool_enable_node_public_ip
5149
max_pods = var.system_node_pool_max_pods
52-
max_count = var.system_node_pool_max_count
53-
min_count = var.system_node_pool_min_count
54-
node_count = var.system_node_pool_node_count
5550
os_disk_type = var.system_node_pool_os_disk_type
5651
tags = var.tags
5752
}
@@ -91,7 +86,6 @@ resource "azurerm_kubernetes_cluster" "aks_cluster" {
9186
}
9287

9388
azure_active_directory_role_based_access_control {
94-
managed = true
9589
tenant_id = var.tenant_id
9690
admin_group_object_ids = var.admin_group_object_ids
9791
azure_rbac_enabled = var.azure_rbac_enabled

scenarios/AksOpenAiTerraform/terraform/modules/aks/variables.tf

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ variable "role_based_access_control_enabled" {
4747
type = bool
4848
}
4949

50-
variable "automatic_channel_upgrade" {
51-
description = "(Optional) The upgrade channel for this Kubernetes Cluster. Possible values are patch, rapid, and stable."
52-
default = "stable"
53-
type = string
54-
55-
validation {
56-
condition = contains( ["patch", "rapid", "stable"], var.automatic_channel_upgrade)
57-
error_message = "The upgrade mode is invalid."
58-
}
59-
}
60-
6150
variable "sku_tier" {
6251
description = "(Optional) The SKU Tier that should be used for this Kubernetes Cluster. Possible values are Free and Paid (which includes the Uptime SLA). Defaults to Free."
6352
default = "Free"
@@ -71,7 +60,6 @@ variable "sku_tier" {
7160

7261
variable "kubernetes_version" {
7362
description = "Specifies the AKS Kubernetes version"
74-
default = "1.21.1"
7563
type = string
7664
}
7765

@@ -134,24 +122,6 @@ variable "system_node_pool_subnet_address_prefix" {
134122
type = list(string)
135123
}
136124

137-
variable "system_node_pool_enable_auto_scaling" {
138-
description = "(Optional) Whether to enable auto-scaler. Defaults to false."
139-
type = bool
140-
default = true
141-
}
142-
143-
variable "system_node_pool_enable_host_encryption" {
144-
description = "(Optional) Should the nodes in this Node Pool have host encryption enabled? Defaults to false."
145-
type = bool
146-
default = false
147-
}
148-
149-
variable "system_node_pool_enable_node_public_ip" {
150-
description = "(Optional) Should each node have a Public IP Address? Defaults to false. Changing this forces a new resource to be created."
151-
type = bool
152-
default = false
153-
}
154-
155125
variable "system_node_pool_max_pods" {
156126
description = "(Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
157127
type = number
@@ -164,36 +134,12 @@ variable "system_node_pool_node_labels" {
164134
default = {}
165135
}
166136

167-
variable "system_node_pool_node_taints" {
168-
description = "(Optional) A map of Kubernetes labels which should be applied to nodes in this Node Pool. Changing this forces a new resource to be created."
169-
type = list(string)
170-
default = []
171-
}
172-
173137
variable "system_node_pool_os_disk_type" {
174138
description = "(Optional) The type of disk which should be used for the Operating System. Possible values are Ephemeral and Managed. Defaults to Managed. Changing this forces a new resource to be created."
175139
type = string
176140
default = "Ephemeral"
177141
}
178142

179-
variable "system_node_pool_max_count" {
180-
description = "(Required) The maximum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be greater than or equal to min_count."
181-
type = number
182-
default = 10
183-
}
184-
185-
variable "system_node_pool_min_count" {
186-
description = "(Required) The minimum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be less than or equal to max_count."
187-
type = number
188-
default = 3
189-
}
190-
191-
variable "system_node_pool_node_count" {
192-
description = "(Optional) The initial number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be a value in the range min_count - max_count."
193-
type = number
194-
default = 3
195-
}
196-
197143
variable "log_analytics_workspace_id" {
198144
description = "(Optional) The ID of the Log Analytics Workspace which the OMS Agent should send data to. Must be present if enabled is true."
199145
type = string

scenarios/AksOpenAiTerraform/terraform/modules/node_pool/main.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ resource "azurerm_kubernetes_cluster_node_pool" "node_pool" {
88
zones = var.availability_zones
99
vnet_subnet_id = var.vnet_subnet_id
1010
pod_subnet_id = var.pod_subnet_id
11-
enable_auto_scaling = var.enable_auto_scaling
12-
enable_host_encryption = var.enable_host_encryption
13-
enable_node_public_ip = var.enable_node_public_ip
1411
proximity_placement_group_id = var.proximity_placement_group_id
1512
orchestrator_version = var.orchestrator_version
1613
max_pods = var.max_pods
17-
max_count = var.max_count
18-
min_count = var.min_count
19-
node_count = var.node_count
2014
os_disk_size_gb = var.os_disk_size_gb
2115
os_disk_type = var.os_disk_type
2216
os_type = var.os_type

scenarios/AksOpenAiTerraform/terraform/modules/node_pool/variables.tf

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ variable "availability_zones" {
1919
default = ["1", "2", "3"]
2020
}
2121

22-
variable "enable_auto_scaling" {
23-
description = "(Optional) Whether to enable auto-scaler. Defaults to false."
24-
type = bool
25-
default = false
26-
}
27-
2822
variable "enable_host_encryption" {
2923
description = "(Optional) Should the nodes in this Node Pool have host encryption enabled? Defaults to false."
3024
type = bool
@@ -67,9 +61,8 @@ variable "tags" {
6761
}
6862

6963
variable "orchestrator_version" {
70-
description = "(Optional) Version of Kubernetes used for the Agents. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade)"
64+
description = "(Required) Version of Kubernetes used for the Agents. If not specified, the latest recommended version will be used at provisioning time (but won't auto-upgrade)"
7165
type = string
72-
default = null
7366
}
7467

7568
variable "os_disk_size_gb" {
@@ -114,24 +107,6 @@ variable "pod_subnet_id" {
114107
default = null
115108
}
116109

117-
variable "max_count" {
118-
description = "(Required) The maximum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be greater than or equal to min_count."
119-
type = number
120-
default = 10
121-
}
122-
123-
variable "min_count" {
124-
description = "(Required) The minimum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be less than or equal to max_count."
125-
type = number
126-
default = 3
127-
}
128-
129-
variable "node_count" {
130-
description = "(Optional) The initial number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be a value in the range min_count - max_count."
131-
type = number
132-
default = 3
133-
}
134-
135110
variable resource_group_name {
136111
description = "Specifies the resource group name"
137112
type = string

scenarios/AksOpenAiTerraform/terraform/variables.tf

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,6 @@ variable "role_based_access_control_enabled" {
124124
type = bool
125125
}
126126

127-
variable "automatic_channel_upgrade" {
128-
description = "(Optional) The upgrade channel for this Kubernetes Cluster. Possible values are patch, rapid, and stable."
129-
default = "stable"
130-
type = string
131-
132-
validation {
133-
condition = contains( ["patch", "rapid", "stable"], var.automatic_channel_upgrade)
134-
error_message = "The upgrade mode is invalid."
135-
}
136-
}
137-
138127
variable "admin_group_object_ids" {
139128
description = "(Optional) A list of Object IDs of Azure Active Directory Groups which should have Admin Role on the Cluster."
140129
default = []
@@ -160,7 +149,7 @@ variable "sku_tier" {
160149

161150
variable "kubernetes_version" {
162151
description = "Specifies the AKS Kubernetes version"
163-
default = "1.26.3"
152+
default = "1.31.1"
164153
type = string
165154
}
166155

@@ -200,24 +189,6 @@ variable "system_node_pool_name" {
200189
type = string
201190
}
202191

203-
variable "system_node_pool_enable_auto_scaling" {
204-
description = "(Optional) Whether to enable auto-scaler. Defaults to false."
205-
type = bool
206-
default = true
207-
}
208-
209-
variable "system_node_pool_enable_host_encryption" {
210-
description = "(Optional) Should the nodes in this Node Pool have host encryption enabled? Defaults to false."
211-
type = bool
212-
default = false
213-
}
214-
215-
variable "system_node_pool_enable_node_public_ip" {
216-
description = "(Optional) Should each node have a Public IP Address? Defaults to false. Changing this forces a new resource to be created."
217-
type = bool
218-
default = false
219-
}
220-
221192
variable "system_node_pool_max_pods" {
222193
description = "(Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
223194
type = number
@@ -242,24 +213,6 @@ variable "system_node_pool_os_disk_type" {
242213
default = "Ephemeral"
243214
}
244215

245-
variable "system_node_pool_max_count" {
246-
description = "(Required) The maximum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be greater than or equal to min_count."
247-
type = number
248-
default = 10
249-
}
250-
251-
variable "system_node_pool_min_count" {
252-
description = "(Required) The minimum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be less than or equal to max_count."
253-
type = number
254-
default = 3
255-
}
256-
257-
variable "system_node_pool_node_count" {
258-
description = "(Optional) The initial number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be a value in the range min_count - max_count."
259-
type = number
260-
default = 3
261-
}
262-
263216
variable "user_node_pool_name" {
264217
description = "(Required) Specifies the name of the node pool."
265218
type = string
@@ -278,12 +231,6 @@ variable "user_node_pool_availability_zones" {
278231
default = ["1", "2", "3"]
279232
}
280233

281-
variable "user_node_pool_enable_auto_scaling" {
282-
description = "(Optional) Whether to enable auto-scaler. Defaults to false."
283-
type = bool
284-
default = true
285-
}
286-
287234
variable "user_node_pool_enable_host_encryption" {
288235
description = "(Optional) Should the nodes in this Node Pool have host encryption enabled? Defaults to false."
289236
type = bool
@@ -338,24 +285,6 @@ variable "user_node_pool_priority" {
338285
default = "Regular"
339286
}
340287

341-
variable "user_node_pool_max_count" {
342-
description = "(Required) The maximum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be greater than or equal to min_count."
343-
type = number
344-
default = 10
345-
}
346-
347-
variable "user_node_pool_min_count" {
348-
description = "(Required) The minimum number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be less than or equal to max_count."
349-
type = number
350-
default = 3
351-
}
352-
353-
variable "user_node_pool_node_count" {
354-
description = "(Optional) The initial number of nodes which should exist within this Node Pool. Valid values are between 0 and 1000 and must be a value in the range min_count - max_count."
355-
type = number
356-
default = 3
357-
}
358-
359288
variable "storage_account_kind" {
360289
description = "(Optional) Specifies the account kind of the storage account"
361290
default = "StorageV2"

0 commit comments

Comments
 (0)