You need hello-web Running with a health check on /healthz, from lab 5.1.4.
Haven't done lab 5.1.4?
Deploy it:
csph deploy --image quay.io/computesphere/learn-hello-web:1.0.0 --name hello-web --port 8080
Then in the console open hello-web, go to Settings, choose Add health check, and set Endpoint path /healthz, Port 8080, Initial delay 5, Check interval 10. Choose Save, then Redeploy now.
The health check is what makes this lab work. Without it, the broken release passes and goes live.
Record a known-good version
csph deploy --image quay.io/computesphere/learn-hello-web:1.0.0 --name hello-web --port 8080A console settings change doesn't record a version; a deploy that changes something does. This is the version you'll come back to.
You should seecsph prints Running and your URL, or unchanged if this is already the current version.
Ship the broken release
csph deploy --image quay.io/computesphere/learn-hello-web-broken:1.0.0 --name hello-web --port 8080Wait a minute after step 1 first: deploy history keeps one version per minute, so a quicker release won't get its own version to roll back from. The new version then gets about ten minutes to pass its health check.
You should seecsph prints Running within seconds, while the new version is still starting.
Watch the old version keep serving
In a second terminal, while you wait:
curl -s -o /dev/null -w "%{http_code}\n" https://<your-hello-web-url>/Check yourself
You should see200 on every call; after about ten minutes the deployment shows Failed.
Roll back
Open
hello-web. Under Recent deployments, choose Roll back next to the step 1 version, then Roll back to v….csph deployments rollback <deployment-id>Rolls back to the version before the failed one.
csph services list, thencsph deployments list --service <service-id>, shows the deployment ID.A rollback restores that version's image, variables and health check. If Settings then shows no health check, your step 1 version predates it: add it again.
You should seeRunning again, with your step 1 version marked Current under Recent deployments.
Check your work
If this doesn't pass
Wait for the broken release to show Failed, about ten minutes, before rolling back. If it never fails, the health check wasn't on /healthz: set it up and start again from step 1.
If this doesn't pass
Rolling back redeploys the old version, which takes about a minute. If it ends Failed, open that deployment's log.