You need csph pointed at your learn project and lab environment, from lesson 5.1.1.
What's a health check?
A health check is an address in your app that ComputeSphere calls to ask “are you working?”. A new version only gets traffic once it answers with success. The sample app answers on /healthz.
Deploy hello-web
csph deploy --image quay.io/computesphere/learn-hello-web:1.0.0 --name hello-web --port 8080Flex and 1 spherelet are the defaults.
Follow the Console tab in lesson 5.1.2: Flex, 1 spherelet, Port
8080.Already deployed it in lesson 5.1.2? Skip to step 2.
You should seeRunning, and your URL.
Add the health check
In the console, open
hello-weband go to Settings. Under Health check, choose Add health check, then set Endpoint path/healthz, Port8080, Initial delay5and Check interval10. Choose Save.You should seeThe Health check card shows Path /healthz and Port 8080.
Redeploy so it applies
The console asks Redeploy to apply changes? Choose Redeploy now. A health check only applies to deployments started after it's saved.
You should seeThe status goes Redeploying, then back to Running.
Open your URL
curl -I https://<your-hello-web-url>You should seeHTTP/2 200, and the page in your browser.
Check your work
If this doesn't pass
The name must be exactly hello-web, deployed into lab. Run csph context to check where csph deploys.
If this doesn't pass
Open the Deploy log on the service's Logs tab. A wrong port is the usual cause.
If this doesn't pass
If it's Running but the URL doesn't answer, wait a minute: a brand-new address can take a moment to appear.
If this doesn't pass
The health check is saved but the running deployment is older. Choose Redeploy on hello-web.