Replace Traefik with kamal-proxy

[kamal-proxy](https://github.com/basecamp/kamal-proxy) is a custom
minimal proxy designed specifically for Kamal.

It has some advantages over Traefik:
1. Imperative deployments - we tell it to switch from container A to
   container B, and it waits for container B to start then switches. No
   need to poll for health checks ourselves or mess around with forcing
   health checks to fail.
2. Support for multiple apps - as much as possible, configuration is
   supplied at runtime by the deploy command, allowing us to have
   multiple apps share a proxy without conflicting config.
3. First class support for Kamal operations - rather than trying to
   work out how to make Traefik do what we want, we can build features
   directly into the proxy, making configuration simpler and avoiding
   obscure errors
This commit is contained in:
Donal McBreen
2024-03-08 08:19:48 +00:00
parent 90ecb6a12a
commit 6568cef868
66 changed files with 746 additions and 1161 deletions

View File

@@ -136,18 +136,18 @@ class CommanderTest < ActiveSupport::TestCase
assert_equal [ "1.1.1.3", "1.1.1.4", "1.1.1.1", "1.1.1.2" ], @kamal.hosts
end
test "traefik hosts should observe filtered roles" do
test "proxy hosts should observe filtered roles" do
configure_with(:deploy_with_aliases)
@kamal.specific_roles = [ "web_tokyo" ]
assert_equal [ "1.1.1.3", "1.1.1.4" ], @kamal.traefik_hosts
assert_equal [ "1.1.1.3", "1.1.1.4" ], @kamal.proxy_hosts
end
test "traefik hosts should observe filtered hosts" do
test "proxy hosts should observe filtered hosts" do
configure_with(:deploy_with_aliases)
@kamal.specific_hosts = [ "1.1.1.4" ]
assert_equal [ "1.1.1.4" ], @kamal.traefik_hosts
assert_equal [ "1.1.1.4" ], @kamal.proxy_hosts
end
private