add healthcheck interval option

This commit is contained in:
acidtib
2023-05-10 20:27:21 -06:00
parent 0defcbb640
commit 9a31c20321
2 changed files with 9 additions and 1 deletions

View File

@@ -703,6 +703,7 @@ healthcheck:
path: /healthz path: /healthz
port: 4000 port: 4000
max_attempts: 7 max_attempts: 7
interval: 20s
``` ```
This will ensure your application is configured with a traefik label for the healthcheck against `/healthz` and that the pre-deploy healthcheck that MRSK performs is done against the same path on port 4000. This will ensure your application is configured with a traefik label for the healthcheck against `/healthz` and that the pre-deploy healthcheck that MRSK performs is done against the same path on port 4000.

View File

@@ -37,7 +37,7 @@ class Mrsk::Configuration::Role
def health_check_args def health_check_args
if health_check_cmd.present? if health_check_cmd.present?
optionize({ "health-cmd" => health_check_cmd, "health-interval" => "1s" }) optionize({ "health-cmd" => health_check_cmd, "health-interval" => health_check_interval })
else else
[] []
end end
@@ -50,6 +50,13 @@ class Mrsk::Configuration::Role
options["cmd"] || http_health_check(port: options["port"], path: options["path"]) options["cmd"] || http_health_check(port: options["port"], path: options["path"])
end end
def health_check_interval
options = specializations["healthcheck"] || {}
options = config.healthcheck.merge(options) if running_traefik?
options["interval"] || "1s"
end
def cmd def cmd
specializations["cmd"] specializations["cmd"]
end end