Skip to content

Commit 52e7aee

Browse files
committed
More fixes
1 parent 8f3b0a8 commit 52e7aee

File tree

7 files changed

+18
-65
lines changed

7 files changed

+18
-65
lines changed

scenarios/AksOpenAiTerraform/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@ Run commands below to set up AKS extensions for Azure.
2121
A Service Principal is an application within Azure Active Directory with the authentication tokens Terraform needs to perform actions on your behalf.
2222

2323
```bash
24-
export SUBSCRIPTION_ID="0c8875c7-e423-4caa-827a-1f0350bd8dd3"
25-
az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/$SUBSCRIPTION_ID"
24+
# TODO: fix
25+
# az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/$ARM_SUBSCRIPTION_ID"
26+
```
27+
28+
## Setup Infra
29+
30+
```bash
31+
export ARM_SUBSCRIPTION_ID="0c8875c7-e423-4caa-827a-1f0350bd8dd3"
32+
terraform apply
2633
```
2734

2835
## Set up environment

scenarios/AksOpenAiTerraform/terraform/main.tf

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@ module "virtual_network" {
6161
{
6262
name : var.system_node_pool_subnet_name
6363
address_prefixes : var.system_node_pool_subnet_address_prefix
64-
private_endpoint_network_policies_enabled : true
64+
private_endpoint_network_policies : "Enabled"
6565
private_link_service_network_policies_enabled : false
6666
delegation: null
6767
},
6868
{
6969
name : var.user_node_pool_subnet_name
7070
address_prefixes : var.user_node_pool_subnet_address_prefix
71-
private_endpoint_network_policies_enabled : true
71+
private_endpoint_network_policies : "Enabled"
7272
private_link_service_network_policies_enabled : false
7373
delegation: null
7474
},
7575
{
7676
name : var.pod_subnet_name
7777
address_prefixes : var.pod_subnet_address_prefix
78-
private_endpoint_network_policies_enabled : true
78+
private_endpoint_network_policies : "Enabled"
7979
private_link_service_network_policies_enabled : false
8080
delegation = {
8181
name = "delegation"
@@ -88,14 +88,14 @@ module "virtual_network" {
8888
{
8989
name : var.vm_subnet_name
9090
address_prefixes : var.vm_subnet_address_prefix
91-
private_endpoint_network_policies_enabled : true
91+
private_endpoint_network_policies : "Enabled"
9292
private_link_service_network_policies_enabled : false
9393
delegation: null
9494
},
9595
{
9696
name : "AzureBastionSubnet"
9797
address_prefixes : var.bastion_subnet_address_prefix
98-
private_endpoint_network_policies_enabled : true
98+
private_endpoint_network_policies : "Enabled"
9999
private_link_service_network_policies_enabled : false
100100
delegation: null
101101
}
@@ -137,16 +137,13 @@ module "aks_cluster" {
137137
kubernetes_version = var.kubernetes_version
138138
dns_prefix = lower(var.aks_cluster_name)
139139
private_cluster_enabled = var.private_cluster_enabled
140-
automatic_channel_upgrade = var.automatic_channel_upgrade
141140
sku_tier = var.sku_tier
142141
system_node_pool_name = var.system_node_pool_name
143142
system_node_pool_vm_size = var.system_node_pool_vm_size
144143
vnet_subnet_id = module.virtual_network.subnet_ids[var.system_node_pool_subnet_name]
145144
pod_subnet_id = module.virtual_network.subnet_ids[var.pod_subnet_name]
146145
system_node_pool_availability_zones = var.system_node_pool_availability_zones
147146
system_node_pool_node_labels = var.system_node_pool_node_labels
148-
system_node_pool_enable_host_encryption = var.system_node_pool_enable_host_encryption
149-
system_node_pool_enable_node_public_ip = var.system_node_pool_enable_node_public_ip
150147
system_node_pool_max_pods = var.system_node_pool_max_pods
151148
system_node_pool_os_disk_type = var.system_node_pool_os_disk_type
152149
tags = var.tags

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ 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
@@ -44,8 +44,6 @@ resource "azurerm_kubernetes_cluster" "aks_cluster" {
4444
pod_subnet_id = var.pod_subnet_id
4545
zones = var.system_node_pool_availability_zones
4646
node_labels = var.system_node_pool_node_labels
47-
enable_host_encryption = var.system_node_pool_enable_host_encryption
48-
enable_node_public_ip = var.system_node_pool_enable_node_public_ip
4947
max_pods = var.system_node_pool_max_pods
5048
os_disk_type = var.system_node_pool_os_disk_type
5149
tags = var.tags
@@ -86,7 +84,6 @@ resource "azurerm_kubernetes_cluster" "aks_cluster" {
8684
}
8785

8886
azure_active_directory_role_based_access_control {
89-
managed = true
9087
tenant_id = var.tenant_id
9188
admin_group_object_ids = var.admin_group_object_ids
9289
azure_rbac_enabled = var.azure_rbac_enabled

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

Lines changed: 0 additions & 23 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"
@@ -133,18 +122,6 @@ variable "system_node_pool_subnet_address_prefix" {
133122
type = list(string)
134123
}
135124

136-
variable "system_node_pool_enable_host_encryption" {
137-
description = "(Optional) Should the nodes in this Node Pool have host encryption enabled? Defaults to false."
138-
type = bool
139-
default = false
140-
}
141-
142-
variable "system_node_pool_enable_node_public_ip" {
143-
description = "(Optional) Should each node have a Public IP Address? Defaults to false. Changing this forces a new resource to be created."
144-
type = bool
145-
default = false
146-
}
147-
148125
variable "system_node_pool_max_pods" {
149126
description = "(Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
150127
type = number

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ 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_host_encryption = var.enable_host_encryption
12-
enable_node_public_ip = var.enable_node_public_ip
1311
proximity_placement_group_id = var.proximity_placement_group_id
1412
orchestrator_version = var.orchestrator_version
1513
max_pods = var.max_pods

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ resource "azurerm_subnet" "subnet" {
1919
resource_group_name = var.resource_group_name
2020
virtual_network_name = azurerm_virtual_network.vnet.name
2121
address_prefixes = each.value.address_prefixes
22-
private_endpoint_network_policies = each.value.private_endpoint_network_policies_enabled
22+
private_endpoint_network_policies = each.value.private_endpoint_network_policies
2323
private_link_service_network_policies_enabled = each.value.private_link_service_network_policies_enabled
2424

2525
dynamic "delegation" {
@@ -28,8 +28,8 @@ resource "azurerm_subnet" "subnet" {
2828
name = "delegation"
2929

3030
service_delegation {
31-
name = each.name
32-
actions = each.actions
31+
name = delegation.value.service_delegation.name
32+
actions = delegation.value.service_delegation.actions
3333
}
3434
}
3535
}

scenarios/AksOpenAiTerraform/terraform/variables.tf

Lines changed: 0 additions & 23 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 = []
@@ -200,18 +189,6 @@ variable "system_node_pool_name" {
200189
type = string
201190
}
202191

203-
variable "system_node_pool_enable_host_encryption" {
204-
description = "(Optional) Should the nodes in this Node Pool have host encryption enabled? Defaults to false."
205-
type = bool
206-
default = false
207-
}
208-
209-
variable "system_node_pool_enable_node_public_ip" {
210-
description = "(Optional) Should each node have a Public IP Address? Defaults to false. Changing this forces a new resource to be created."
211-
type = bool
212-
default = false
213-
}
214-
215192
variable "system_node_pool_max_pods" {
216193
description = "(Optional) The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
217194
type = number

0 commit comments

Comments
 (0)