Adds: - `kamal upgrade` to upgrade all app hosts and accessory hosts - `kamal proxy upgrade` to upgrade the proxy on all hosts - `kamal accessory upgrade [name]` to upgrade accessories on all hosts Upgrade takes rolling and confirmed options and calls `proxy upgrade` and `accessory upgrade` in turn. To just upgrade a single host add -h [host] to the command. But the upgrade should run on all hosts, not just those running the proxy. Calling upgrade on a host that has already been upgraded should work ok. Upgrading hosts causes downtime but you can avoid if you run multiple hosts by: 1. Implementing the pre-proxy-reboot and post-proxy-reboot hooks to remove the host from external load balancers 2. Running the upgrade with the --rolling option **kamal proxy upgrade** 1. Creates a `kamal` network if required 2. Stops and removes the old proxy (whether Traefik or kamal-proxy) 3. Starts a kamal-proxy container in the `kamal` network 4. Reboots the app containers in the `kamal` network **kamal accessory upgrade [name]** 1. Creates a `kamal` network if required 2. Reboots the accessory containers in the `kamal` network A matching `downgrade` command will be added to Kamal 1.9.
43 lines
642 B
YAML
43 lines
642 B
YAML
service: app
|
|
image: dhh/app
|
|
servers:
|
|
web:
|
|
- "1.1.1.1"
|
|
- "1.1.1.2"
|
|
workers:
|
|
- "1.1.1.3"
|
|
- "1.1.1.4"
|
|
registry:
|
|
username: user
|
|
password: pw
|
|
builder:
|
|
arch: amd64
|
|
|
|
proxy:
|
|
deploy_timeout: 6s
|
|
|
|
accessories:
|
|
mysql:
|
|
image: mysql:5.7
|
|
host: 1.1.1.3
|
|
port: 3306
|
|
env:
|
|
clear:
|
|
MYSQL_ROOT_HOST: '%'
|
|
secret:
|
|
- MYSQL_ROOT_PASSWORD
|
|
files:
|
|
- test/fixtures/files/my.cnf:/etc/mysql/my.cnf
|
|
directories:
|
|
- data:/var/lib/mysql
|
|
redis:
|
|
image: redis:latest
|
|
roles:
|
|
- web
|
|
port: 6379
|
|
directories:
|
|
- data:/data
|
|
|
|
readiness_delay: 0
|
|
readiness_timeout: 1
|