Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade commands for Kamal 1.x -> 2.0 #942

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Upgrade commands for Kamal 1.x -> 2.0 #942

merged 1 commit into from
Sep 17, 2024

Conversation

djmb
Copy link
Collaborator

@djmb djmb commented Sep 17, 2024

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.

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.
@djmb djmb merged commit d6eda3d into main Sep 17, 2024
9 checks passed
@djmb djmb deleted the kamal-2-upgrade branch September 17, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant