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

Added -y option to kamal traefik reboot command #730

Merged
merged 3 commits into from Mar 22, 2024

Conversation

igor-alexandrov
Copy link
Contributor

Based on the discussion in #680, I added the new method confirming, which accepts the block of code and prompts the user with a question that should be answered either "y" or "n."

I replaced existing ask calls and added confirmation to kamal traefik reboot command.

execute *KAMAL.traefik.stop, raise_on_non_zero_exit: false
execute *KAMAL.traefik.remove_container
execute *KAMAL.traefik.run
confirming "Reboot Traefik on hosts? (stop container, remove container, start new container). This will cause a brief outage." do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was missing a question here (same as in other two places)

Suggested change
confirming "Reboot Traefik on hosts? (stop container, remove container, start new container). This will cause a brief outage." do
confirming "Reboot Traefik on hosts? (stop container, remove container, start new container). This will cause a brief outage. Are you sure?" do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sija I am not a native speaker, but there is already a question at the beginning of the phrase.

Copy link
Collaborator

@djmb djmb Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want something short and finish with a question.

@brunoprietog's point about rolling deploys is valid, though it doesn't guarantee that there won't be outages. Depending on how the load balancing is set up across hosts you could still get an errors for requests in flight or while the load balancer spots the outage. The Traefik reboot hooks are there so you can remove and drain the nodes before rebooting.

Maybe:

This will cause a brief outage on each host. Are you sure?

We can leave it to the user to infer whether those outages are concurrent or sequential based on the rolling argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djmb, you found the perfect words. I updated the text.

execute *KAMAL.traefik.stop, raise_on_non_zero_exit: false
execute *KAMAL.traefik.remove_container
execute *KAMAL.traefik.run
confirming "Reboot Traefik on hosts? (stop container, remove container, start new container). This will cause a brief outage." do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not necessarily true. If the rolling option is used and there are multiple hosts the app will not crash, only one host will become unavailable for a short time.

@djmb
Copy link
Collaborator

djmb commented Mar 22, 2024

Thanks @igor-alexandrov!

@djmb djmb merged commit 5f58575 into basecamp:main Mar 22, 2024
8 checks passed
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.

None yet

5 participants