-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[kots]: delete workspace pods before installing Gitpod #13215
Conversation
b20f77c
to
ef3893d
Compare
/hold as requires @gitpod-io/engineering-workspace input too |
@@ -156,6 +156,9 @@ EOF | |||
HELM_TIMEOUT="1h" | |||
fi | |||
|
|||
echo "Gitpod: shut down any running workspaces/image-builders" | |||
kubectl delete pods -n "${NAMESPACE}" -l component=workspace --wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this would mean that during upgrade the workspaces that are currently in use will get interrupted? I thought it was a nice feature that we had, allowing uninterrupted upgrades. And how would this affect potential backup jobs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, this has been requested by @gitpod-io/engineering-workspace to guarantee that the workspaces are properly backed up. If you check out #13147, there's a whole discussion on this in there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
totally missed the context 🙈 reading!
/hold this seems to have been removed incorrectly |
edd2fcd
to
91c570e
Compare
91c570e
to
c988742
Compare
/werft run publish-to-kots 👍 started the job as gitpod-build-sje-installer-kill-workspaces.6 |
5e9a4ad
to
3048413
Compare
# Get list of workspace instances from gpctl | ||
for instance in $(/app/gpctl workspaces list -o json | jq -r 'select(. != null) | .[] | .Instance'); do | ||
echo "Gitpod: shutting down workspace ${instance}" | ||
/app/gpctl workspaces stop "${instance}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command can be a bit flakey if (presumably) the gRPC server communication errors - I've seen logs like:
time="2022-09-26T17:20:18Z" level=fatal msg="cannot connect" error="error upgrading connection: error dialing backend: EOF"
Three options as I see it:
- Do nothing and let it error. A redeploy will almost always be fine
- Add a
|| true
and never let it error. This allows for missing backups - Add a
|| sleep 10 && /app/gpctl workspaces stop "${instance}"
to allow it to retry after 10 seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 3 sounds like the best balance of reliability and safety and should catch most of the spurious gRPC server errors; I'd favor that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll make that change now so you can get the RC out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold for adding a retry on gpctl
.
Looks good to me; I haven't functionally verified this but we can do so during the RC release testing.
3048413
to
42a660d
Compare
42a660d
to
2e331aa
Compare
Retry added as described |
/unhold |
Description
Adds a preflight check to see if there are any workspaces/image-builds running. It fails if there is one (the
textAnalyzer
doesn't allow forwarn
, which is very annoying as this isn't really a failure, but a warning).It also stops any running workspaces/image-builds prior to the
helm upgrade
function being executed.Related Issue(s)
Fixes #13147
How to test
Try installing via KOTS both with and without a workspace running.
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide