Healthcheck bypass
I want to deploy an app that is not a webserver, with Kamal. There's only one thing preventing me from doing this: I need to respond to the healthcheck for the deployment to go through (I'm deploying with a proxy).
Is there any way to deploy without a healthcheck involved?
healthcheck: cmd: true
try this
It fails on kamal setup with error:
ERROR (Kamal::ConfigurationError): proxy/healthcheck: unknown key: cmd
@Towerthousand, @krasylnikov : I don't think you can bypass. But you can use Docker's healthcheck, or simply add a non-https route which responds 200
You should find more information in this issue : https://github.com/basecamp/kamal/issues/1041#issuecomment-2399018829 We have discussions about helathcheck.
@Towerthousand - if the deployment is not a web app, you can set proxy: false which will then skip running the proxy.
Then Kamal will either wait for the container to reach the healthy state if it has a Docker healthcheck.
If there's no healthcheck it waits for the container to reach the running state, then waits for readiness_delay (default 7s) and confirms that the container is still running.
the docs are really rich with information, https://kamal-deploy.org/docs/configuration/proxy/
The cmd option was part of Kamal 1.x, that's been dropped with Kamal 2.
I think you can still accomplish a command-based healthcheck approach to get Docker to change the state to healthy by passing options to your role.
servers:
web:
proxy: false
options:
health-cmd: "date"
Swapping date with something that returns a zero-exit code.
https://docs.docker.com/engine/containers/run/#healthchecks