Skip to content

Commit b65acc4

Browse files
uosjeadkayman-mk
andauthored
feat: add connection_max_age config (#1340)
## Description Currently seeing some occasional connectivity issues running behind a NAT gateway - where connections are limited to 5 minutes. The gitlab-runner config by defaults limits connections to 15 minutes. Was looking to set the connection_max_age setting with the module, but could not find an option to do so. Add connection_max_age as a configurable option to the runner config. Co-authored-by: Matthias Kay <[email protected]>
1 parent ccd754b commit b65acc4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ locals {
150150
shared_cache = var.runner_worker_cache.shared
151151
sentry_dsn = var.runner_manager.sentry_dsn
152152
prometheus_listen_address = var.runner_manager.prometheus_listen_address
153+
connection_max_age = var.runner_manager.connection_max_age
153154
auth_type = var.runner_worker_cache.authentication_type
154155
runners_docker_autoscaler = var.runner_worker.type == "docker-autoscaler" ? local.template_runner_docker_autoscaler : ""
155156
runners_docker_machine = var.runner_worker.type == "docker+machine" ? local.template_runner_docker_machine : ""

template/runner-config.tftpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ check_interval = ${runners_check_interval}
33
sentry_dsn = "${sentry_dsn}"
44
log_format = "json"
55
listen_address = "${prometheus_listen_address}"
6+
connection_max_age = "${connection_max_age}"
67

78
[[runners]]
89
name = "${runners_name}"

variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ variable "runner_manager" {
9090
maximum_concurrent_jobs = The maximum number of jobs which can be processed by all Runners at the same time (concurrent).
9191
prometheus_listen_address = Defines an address (<host>:<port>) the Prometheus metrics HTTP server should listen on (listen_address).
9292
sentry_dsn = Sentry DSN of the project for the Runner Manager to use (uses legacy DSN format) (sentry_dsn)
93+
connection_max_age = The maximum age of a connection to the Runner Manager (connection_max_age).
9394
EOT
9495
type = object({
9596
gitlab_check_interval = optional(number, 3)
9697
maximum_concurrent_jobs = optional(number, 10)
9798
prometheus_listen_address = optional(string, "")
9899
sentry_dsn = optional(string, "__SENTRY_DSN_REPLACED_BY_USER_DATA__")
100+
connection_max_age = optional(string, "15m")
99101
})
100102
default = {}
101103
}

0 commit comments

Comments
 (0)