Skip to content

Commit e81a72e

Browse files
authored
Merge pull request #405 from sassoftware/staging
10.0.0 - October 31, 2024
2 parents dcf9250 + 36c8b46 commit e81a72e

File tree

25 files changed

+112
-309
lines changed

25 files changed

+112
-309
lines changed

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG TERRAFORM_VERSION=1.8.2
2-
ARG AZURECLI_VERSION=2.59.0
1+
ARG TERRAFORM_VERSION=1.9.6
2+
ARG AZURECLI_VERSION=2.64.0
33

44
FROM hashicorp/terraform:$TERRAFORM_VERSION as terraform
55
FROM mcr.microsoft.com/azure-cli:$AZURECLI_VERSION
@@ -10,9 +10,8 @@ WORKDIR /viya4-iac-azure
1010
COPY --from=terraform /bin/terraform /bin/terraform
1111
COPY . .
1212

13-
RUN apk update \
14-
&& apk upgrade \
15-
&& apk add --no-cache git openssh curl\
13+
RUN yum -y install git openssh jq which curl \
14+
&& yum clean all && rm -rf /var/cache/yum \
1615
&& curl -sLO https://storage.googleapis.com/kubernetes-release/release/v$KUBECTL_VERSION/bin/linux/amd64/kubectl \
1716
&& chmod 755 ./kubectl /viya4-iac-azure/docker-entrypoint.sh \
1817
&& mv ./kubectl /usr/local/bin/kubectl \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ This project supports two options for running Terraform scripts:
5757
Access to an **Azure Subscription** and an [**Identity**](./docs/user/TerraformAzureAuthentication.md) with the *Contributor* role are required.
5858

5959
#### Terraform Requirements:
60-
- [Terraform](https://www.terraform.io/downloads.html) - v1.8.2
60+
- [Terraform](https://www.terraform.io/downloads.html) - v1.9.6
6161
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) - v1.29.7
6262
- [jq](https://stedolan.github.io/jq/) - v1.6
63-
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.59.0
63+
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure) - (optional - useful as an alternative to the Azure Portal) - v2.64.0
6464

6565
#### Docker Requirements:
6666
- [Docker](https://docs.docker.com/get-docker/)

container-structure-test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ fileExistenceTests:
99
shouldExist: true
1010
permissions: '-rwxr-xr-x'
1111
- name: 'azure-cli'
12-
path: '/usr/local/bin/az'
12+
path: '/usr/bin/az'
1313
shouldExist: true
1414
permissions: '-rwxr-xr-x'
1515

1616
commandTests:
1717
- name: "terraform version"
1818
command: "terraform"
1919
args: ["--version"]
20-
expectedOutput: ["Terraform v1.8.2"]
20+
expectedOutput: ["Terraform v1.9.6"]
2121
- name: "python version"
2222
command: "python3"
2323
args: ["--version"]
@@ -29,7 +29,7 @@ commandTests:
2929
- -c
3030
- |
3131
az version -o tsv
32-
expectedOutput: ["2.59.0\t2.59.0\t1.1.0"]
32+
expectedOutput: ["2.64.0\t2.64.0\t1.1.0"]
3333

3434
metadataTest:
3535
workdir: "/viya4-iac-azure"

docs/CONFIG-VARS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ The default values for the `subnets` variable are as follows:
127127
aks = {
128128
"prefixes": ["192.168.0.0/23"],
129129
"service_endpoints": ["Microsoft.Sql"],
130-
"private_endpoint_network_policies_enabled": false,
130+
"private_endpoint_network_policies": "Disabled",
131131
"private_link_service_network_policies_enabled": false,
132132
"service_delegations": {},
133133
}
134134
misc = {
135135
"prefixes": ["192.168.2.0/24"],
136136
"service_endpoints": ["Microsoft.Sql"],
137-
"private_endpoint_network_policies_enabled": false,
137+
"private_endpoint_network_policies": "Disabled",
138138
"private_link_service_network_policies_enabled": false,
139139
"service_delegations": {},
140140
}
141141
## If using ha storage then the following is also added
142142
netapp = {
143143
"prefixes": ["192.168.3.0/24"],
144144
"service_endpoints": [],
145-
"private_endpoint_network_policies_enabled": false,
145+
"private_endpoint_network_policies": "Disabled",
146146
"private_link_service_network_policies_enabled": false,
147147
"service_delegations": {
148148
netapp = {

examples/sample-input-postgres.tfvars

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@ postgres_servers = {
4343
# aks = {
4444
# "prefixes" : ["192.168.0.0/23"],
4545
# "service_endpoints" : ["Microsoft.Sql"],
46-
# "private_endpoint_network_policies_enabled" : true,
46+
# "private_endpoint_network_policies" : "Enabled",
4747
# "private_link_service_network_policies_enabled" : false,
4848
# "service_delegations" : {},
4949
# }
5050
# misc = {
5151
# "prefixes" : ["192.168.2.0/24"],
5252
# "service_endpoints" : ["Microsoft.Sql"],
53-
# "private_endpoint_network_policies_enabled" : true,
53+
# "private_endpoint_network_policies" : "Enabled",
5454
# "private_link_service_network_policies_enabled" : false,
5555
# "service_delegations" : {},
5656
# }
5757
# netapp = {
5858
# "prefixes" : ["192.168.3.0/24"],
5959
# "service_endpoints" : [],
60-
# "private_endpoint_network_policies_enabled" : false,
60+
# "private_endpoint_network_policies" : "Disabled",
6161
# "private_link_service_network_policies_enabled" : false,
6262
# "service_delegations" : {
6363
# netapp = {
@@ -69,7 +69,7 @@ postgres_servers = {
6969
# postgresql = {
7070
# "prefixes": ["192.168.4.0/24"],
7171
# "service_endpoints": ["Microsoft.Sql"],
72-
# "private_endpoint_network_policies_enabled": true,
72+
# "private_endpoint_network_policies": "Enabled",
7373
# "private_link_service_network_policies_enabled": false,
7474
# "service_delegations": {
7575
# flexpostgres = {

examples/sample-input-singlestore.tfvars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,22 @@ subnets = {
133133
aks = {
134134
"prefixes": ["192.168.0.0/21"],
135135
"service_endpoints": ["Microsoft.Sql"],
136-
"private_endpoint_network_policies_enabled": false,
136+
"private_endpoint_network_policies": "Disabled",
137137
"private_link_service_network_policies_enabled": false,
138138
"service_delegations": {},
139139
}
140140
misc = {
141141
"prefixes": ["192.168.8.0/24"],
142142
"service_endpoints": ["Microsoft.Sql"],
143-
"private_endpoint_network_policies_enabled": false,
143+
"private_endpoint_network_policies": "Disabled",
144144
"private_link_service_network_policies_enabled": false,
145145
"service_delegations": {},
146146
}
147147
## If using ha storage then the following is also added
148148
netapp = {
149149
"prefixes": ["192.168.9.0/24"],
150150
"service_endpoints": [],
151-
"private_endpoint_network_policies_enabled": false,
151+
"private_endpoint_network_policies": "Disabled",
152152
"private_link_service_network_policies_enabled": false,
153153
"service_delegations": {
154154
netapp = {

linting-configs/.hadolint.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ignored:
2-
- DL3018 # https://github.com/hadolint/hadolint/wiki/DL3018
2+
# Specify version with yum install -y <package>-<version> - https://github.com/hadolint/hadolint/wiki/DL3033
3+
- DL3033

main.tf

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ module "aks" {
159159
aks_network_policy = var.aks_network_policy
160160
aks_network_plugin_mode = var.aks_network_plugin_mode
161161
aks_dns_service_ip = var.aks_dns_service_ip
162-
aks_docker_bridge_cidr = var.aks_docker_bridge_cidr
163162
cluster_egress_type = local.cluster_egress_type
164163
aks_pod_cidr = var.aks_pod_cidr
165164
aks_service_cidr = var.aks_service_cidr
@@ -194,15 +193,13 @@ module "node_pools" {
194193

195194
for_each = var.node_pools
196195

197-
node_pool_name = each.key
198-
aks_cluster_id = module.aks.cluster_id
199-
vnet_subnet_id = module.vnet.subnets["aks"].id
200-
machine_type = each.value.machine_type
201-
fips_enabled = var.fips_enabled
202-
os_disk_size = each.value.os_disk_size
203-
# TODO: enable with azurerm v2.37.0
204-
# os_disk_type = each.value.os_disk_type
205-
enable_auto_scaling = each.value.min_nodes == each.value.max_nodes ? false : true
196+
node_pool_name = each.key
197+
aks_cluster_id = module.aks.cluster_id
198+
vnet_subnet_id = module.vnet.subnets["aks"].id
199+
machine_type = each.value.machine_type
200+
fips_enabled = var.fips_enabled
201+
os_disk_size = each.value.os_disk_size
202+
auto_scaling_enabled = each.value.min_nodes == each.value.max_nodes ? false : true
206203
node_count = each.value.min_nodes
207204
min_nodes = each.value.min_nodes == each.value.max_nodes ? null : each.value.min_nodes
208205
max_nodes = each.value.min_nodes == each.value.max_nodes ? null : each.value.max_nodes
@@ -212,7 +209,7 @@ module "node_pools" {
212209
zones = (var.node_pools_availability_zone == "" || var.node_pools_proximity_placement == true) ? [] : (var.node_pools_availability_zones != null) ? var.node_pools_availability_zones : [var.node_pools_availability_zone]
213210
proximity_placement_group_id = element(coalescelist(azurerm_proximity_placement_group.proximity[*].id, [""]), 0)
214211
orchestrator_version = var.kubernetes_version
215-
enable_host_encryption = var.aks_cluster_enable_host_encryption
212+
host_encryption_enabled = var.aks_cluster_enable_host_encryption
216213
tags = var.tags
217214
}
218215

@@ -260,19 +257,6 @@ module "netapp" {
260257
depends_on = [module.vnet]
261258
}
262259

263-
module "message_broker" {
264-
source = "./modules/azurerm_message_broker"
265-
count = var.create_azure_message_broker ? 1 : 0
266-
267-
resource_group_name = local.aks_rg.name
268-
location = var.location
269-
prefix = var.prefix
270-
message_broker_sku = var.message_broker_sku
271-
message_broker_name = var.message_broker_name
272-
message_broker_capacity = var.message_broker_capacity
273-
tags = var.tags
274-
}
275-
276260
data "external" "git_hash" {
277261
program = ["files/tools/iac_git_info.sh"]
278262
}

modules/aks_node_pool/main.tf

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,52 @@
44
# Reference: https://www.terraform.io/docs/providers/azurerm/r/kubernetes_cluster_node_pool.html
55

66
resource "azurerm_kubernetes_cluster_node_pool" "autoscale_node_pool" {
7-
count = var.enable_auto_scaling ? 1 : 0
7+
count = var.auto_scaling_enabled ? 1 : 0
88
name = var.node_pool_name
99
kubernetes_cluster_id = var.aks_cluster_id
1010
vnet_subnet_id = var.vnet_subnet_id
1111
zones = var.zones
1212
fips_enabled = var.fips_enabled
13-
enable_host_encryption = var.enable_host_encryption
13+
host_encryption_enabled = var.host_encryption_enabled
1414
proximity_placement_group_id = var.proximity_placement_group_id == "" ? null : var.proximity_placement_group_id
1515
vm_size = var.machine_type
1616
os_disk_size_gb = var.os_disk_size
17-
# TODO: enable after azurerm v2.37.0
18-
# os_disk_type = var.os_disk_type
19-
os_type = var.os_type
20-
enable_auto_scaling = var.enable_auto_scaling
21-
# Still in preview, revisit if needed later - https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools-preview
22-
# enable_node_public_ip = var.enable_node_public_ip
23-
node_count = var.node_count
24-
max_count = var.max_nodes
25-
min_count = var.min_nodes
26-
max_pods = var.max_pods
27-
node_labels = var.node_labels
28-
node_taints = var.node_taints
29-
orchestrator_version = var.orchestrator_version
30-
tags = var.tags
17+
os_type = var.os_type
18+
auto_scaling_enabled = var.auto_scaling_enabled
19+
node_public_ip_enabled = var.node_public_ip_enabled
20+
node_count = var.node_count
21+
max_count = var.max_nodes
22+
min_count = var.min_nodes
23+
max_pods = var.max_pods
24+
node_labels = var.node_labels
25+
node_taints = var.node_taints
26+
orchestrator_version = var.orchestrator_version
27+
tags = var.tags
3128

3229
lifecycle {
3330
ignore_changes = [node_count]
3431
}
3532
}
3633

3734
resource "azurerm_kubernetes_cluster_node_pool" "static_node_pool" {
38-
count = var.enable_auto_scaling ? 0 : 1
35+
count = var.auto_scaling_enabled ? 0 : 1
3936
name = var.node_pool_name
4037
kubernetes_cluster_id = var.aks_cluster_id
4138
vnet_subnet_id = var.vnet_subnet_id
4239
zones = var.zones
4340
fips_enabled = var.fips_enabled
44-
enable_host_encryption = var.enable_host_encryption
41+
host_encryption_enabled = var.host_encryption_enabled
4542
proximity_placement_group_id = var.proximity_placement_group_id == "" ? null : var.proximity_placement_group_id
4643
vm_size = var.machine_type
4744
os_disk_size_gb = var.os_disk_size
48-
# TODO: enable after azurerm v2.37.0
49-
# os_disk_type = var.os_disk_type
50-
os_type = var.os_type
51-
enable_auto_scaling = var.enable_auto_scaling
52-
node_count = var.node_count
53-
max_count = var.max_nodes
54-
min_count = var.min_nodes
55-
max_pods = var.max_pods
56-
node_labels = var.node_labels
57-
node_taints = var.node_taints
58-
orchestrator_version = var.orchestrator_version
59-
tags = var.tags
45+
os_type = var.os_type
46+
auto_scaling_enabled = var.auto_scaling_enabled
47+
node_count = var.node_count
48+
max_count = var.max_nodes
49+
min_count = var.min_nodes
50+
max_pods = var.max_pods
51+
node_labels = var.node_labels
52+
node_taints = var.node_taints
53+
orchestrator_version = var.orchestrator_version
54+
tags = var.tags
6055
}

modules/aks_node_pool/variables.tf

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ variable "fips_enabled" {
2323
default = false
2424
}
2525

26-
variable "enable_host_encryption" {
26+
variable "host_encryption_enabled" {
2727
description = "Enables host encryption on all the nodes in the Node Pool. Changing this forces a new resource to be created."
2828
type = bool
2929
default = false
@@ -46,13 +46,6 @@ variable "os_disk_size" {
4646
default = 100
4747
}
4848

49-
# TODO: enable after azurerm v2.37.0
50-
# variable "os_disk_type" {
51-
# description = "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"
52-
# type = string
53-
# default = "Managed"
54-
# }
55-
5649
variable "os_type" {
5750
description = "The Operating System which should be used for this Node Pool. Changing this forces a new resource to be created. Possible values are Linux and Windows. Defaults to Linux"
5851
type = string
@@ -65,12 +58,18 @@ variable "node_count" {
6558
default = 1
6659
}
6760

68-
variable "enable_auto_scaling" {
61+
variable "auto_scaling_enabled" {
6962
description = "Whether to enable auto-scaler."
7063
type = bool
7164
default = false
7265
}
7366

67+
variable "node_public_ip_enabled" {
68+
description = "Should nodes in this Node Pool have a Public IP Address"
69+
type = bool
70+
default = false
71+
}
72+
7473
variable "max_pods" {
7574
description = "The maximum number of pods that can run on each agent. Changing this forces a new resource to be created."
7675
type = number
@@ -116,23 +115,3 @@ variable "proximity_placement_group_id" {
116115
type = string
117116
default = ""
118117
}
119-
120-
# For future - https://docs.microsoft.com/en-us/azure/aks/spot-node-pool
121-
#
122-
# variable "priority" {
123-
# description = "The Priority for Virtual Machines within the Virtual Machine Scale Set that powers this Node Pool. Possible values are Regular and Spot. Defaults to Regular. Changing this forces a new resource to be created."
124-
# type = string
125-
# default = "Regular"
126-
# }
127-
128-
# variable "eviction_policy" {
129-
# description = "The Eviction Policy which should be used for Virtual Machines within the Virtual Machine Scale Set powering this Node Pool. Possible values are Deallocate and Delete. Changing this forces a new resource to be created. An Eviction Policy can only be configured when priority is set to Spot"
130-
# type = string
131-
# default = null
132-
# }
133-
134-
# variable "spot_max_price" {
135-
# description = "The maximum price you're willing to pay in USD per Virtual Machine. Valid values are -1 (the current on-demand price for a Virtual Machine) or a positive value with up to five decimal places. Changing this forces a new resource to be created."
136-
# type = number
137-
# default = -1
138-
# }

0 commit comments

Comments
 (0)