Add kamal-proxy in experimental mode
The proxy can be enabled via the config:
```
proxy:
enabled: true
hosts:
- 10.0.0.1
- 10.0.0.2
```
This will enable the proxy and cause it to be run on the hosts listed
under `hosts`, after running `kamal proxy reboot`.
Enabling the proxy disables `kamal traefik` commands and replaces them
with `kamal proxy` ones. However only the marked hosts will run the
kamal-proxy container, the rest will run Traefik as before.
This commit is contained in:
committed by
Donal McBreen
parent
66d5e25834
commit
eab717e0cf
@@ -4,7 +4,7 @@ require "active_support/core_ext/object/blank"
|
||||
|
||||
class Kamal::Commander
|
||||
attr_accessor :verbosity, :holding_lock, :connected
|
||||
delegate :hosts, :roles, :primary_host, :primary_role, :roles_on, :traefik_hosts, :accessory_hosts, to: :specifics
|
||||
delegate :hosts, :roles, :primary_host, :primary_role, :roles_on, :traefik_hosts, :proxy_hosts, :proxy_host?, :accessory_hosts, to: :specifics
|
||||
|
||||
def initialize
|
||||
self.verbosity = :info
|
||||
@@ -106,6 +106,10 @@ class Kamal::Commander
|
||||
@lock ||= Kamal::Commands::Lock.new(config)
|
||||
end
|
||||
|
||||
def proxy
|
||||
@proxy ||= Kamal::Commands::Proxy.new(config)
|
||||
end
|
||||
|
||||
def prune
|
||||
@prune ||= Kamal::Commands::Prune.new(config)
|
||||
end
|
||||
@@ -127,6 +131,10 @@ class Kamal::Commander
|
||||
end
|
||||
|
||||
|
||||
def traefik_or_proxy(host)
|
||||
proxy_host?(host) ? proxy : traefik
|
||||
end
|
||||
|
||||
def with_verbosity(level)
|
||||
old_level = self.verbosity
|
||||
|
||||
|
||||
Reference in New Issue
Block a user