Skip to content

Commit ccd8397

Browse files
committed
DTOSS-11646: Add a startup probe and PR fixes
1 parent 2fdcd65 commit ccd8397

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
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.exposed_port != null ? var.exposed_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.exposed_port != null ? var.exposed_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: 1 addition & 8 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"
@@ -215,6 +209,5 @@ locals {
215209
PT12H = "PT5M"
216210
}
217211
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
212+
probe_enabled = var.probe_path != null && var.is_web_app
220213
}

0 commit comments

Comments
 (0)