add healthcheck interval option
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user