Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

serverinstall/k8s: update log msg and add terminal warn for RollingUpdate #1886

Merged
merged 4 commits into from
Jul 20, 2021

Conversation

krantzinator
Copy link
Contributor

Fixes #1795

If a user does not specify a -k8s-server-image or -k8s-pull-policy on the initial install, then we default to K8S defaults, which is to use an imagePullPolicy of Always for images tagged latest. Rather than force a restart of the pod during a waypoint upgrade, we are adding a note in the CLI output to alert users to these settings so they can take appropriate action per their cluster settings and needs.

$ waypoint server upgrade -platform=kubernetes -auto-approve
✓ Context "install-1626724718" validated and connected successfully.
✓ Snapshot of server written to: 'waypoint-server-snapshot-1626728262'

» Upgrading...
  Waypoint server will now upgrade from version "v0.4.0-663-g4bc86276"
✓ Gathering information about the Kubernetes cluster...
⚠️ Update Strategy is 'RollingUpdate'; once the upgrade completes, you may need to restart the pod to update the server image
✓ Image set to update!
✓ Upgrade complete!
...

@github-actions github-actions bot added the core label Jul 19, 2021
@krantzinator krantzinator requested a review from a team July 19, 2021 21:11
@krantzinator krantzinator added this to the 0.4.x milestone Jul 19, 2021
Copy link
Member

@briancain briancain left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just a quick note on moving where the output happens

s.Update("Update Strategy is 'RollingUpdate'; once the upgrade completes, you may need to restart the pod to update the server image")
s.Status(terminal.StatusWarn)
s.Done()
s = sg.Add("")
Copy link
Member

Choose a reason for hiding this comment

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

I think we can move the s.Update checks to further below on 567:

if waypointStatefulSet.Spec.UpdateStrategy.Type == "RollingUpdate" {
ui.Output("\nKubernetes is now set to upgrade waypoint server image with its\n" +
"'RollingUpdate' strategy. This means the pod might not be updated immediately.")
}

But good call on the Warning, we should update ☝🏻 to be Warn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new output

✓ Image set to update!
⚠️ Update Strategy is 'RollingUpdate'; once the upgrade completes, you may need to restart the pod to update the server image
✓ Upgrade complete!

Kubernetes is now set to upgrade waypoint server image with its
'RollingUpdate' strategy. This means the pod might not be updated immediately.

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

waypoint server upgrade on kubernetes does not upgrade if latest tag image is cached.
2 participants