Skip to content

Commit 2906ac5

Browse files
committed
DTOSS-11646: Add a startup probe and PR fixes
1 parent 1853e5b commit 2906ac5

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

infrastructure/modules/container-app/main.tf

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,29 @@ resource "azurerm_container_app" "main" {
104104
}
105105
}
106106

107+
dynamic "startup_probe" {
108+
for_each = local.probe_enabled ? [1] : []
109+
110+
content {
111+
transport = "HTTP"
112+
path = var.probe_path
113+
port = var.port
114+
interval_seconds = 5
115+
timeout = 2
116+
failure_count_threshold = 30
117+
}
118+
}
119+
107120
dynamic "liveness_probe" {
108121
for_each = local.probe_enabled ? [1] : []
109122

110123
content {
111124
transport = "HTTP"
112125
path = var.probe_path
113-
port = local.effective_liveness_port
114-
initial_delay = 45
115-
interval_seconds = 10
126+
port = var.port
127+
interval_seconds = 5
116128
timeout = 2
117-
failure_count_threshold = 4
129+
failure_count_threshold = 2
118130
}
119131
}
120132
}

infrastructure/modules/container-app/variables.tf

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ variable "exposed_port" {
9393
default = null
9494
}
9595

96-
variable "liveness_probe_port" {
97-
description = "Port for the liveness probe to check. Default is var.port."
98-
type = number
99-
default = null
100-
}
101-
10296
variable "memory" {
10397
description = "Memory allocated to the app (GiB). Also dictates the CPU allocation: CPU(%)=MEMORY(Gi)/2. Maximum: 4Gi"
10498
default = "0.5"
@@ -197,7 +191,7 @@ variable "replica_restart_alert_threshold" {
197191
}
198192

199193
variable "probe_path" {
200-
description = "Path for the liveness probe. If null, liveness probe is disabled."
194+
description = "Path for the HTTP health probe. If null, HTTP health probe is disabled. Note /healthcheck is the normal convention."
201195
type = string
202196
default = null
203197
}
@@ -214,7 +208,6 @@ locals {
214208
PT6H = "PT5M"
215209
PT12H = "PT5M"
216210
}
217-
alert_frequency = local.alert_frequency_map[var.alert_window_size]
218-
probe_enabled = var.probe_path != null
219-
effective_liveness_port = var.liveness_probe_port != null ? var.liveness_probe_port : var.port
211+
alert_frequency = local.alert_frequency_map[var.alert_window_size]
212+
probe_enabled = var.probe_path != null && var.is_web_app
220213
}

0 commit comments

Comments
 (0)