Key idea
A web service needs three things: an image to run, a name, and the port the app listens on. Give ComputeSphere those and it returns an HTTPS address.
The model in 60 seconds
Each level sits inside the one above
staging and prod each get their own copy. Each square is a spherelet: the deployment runs on one or more of them.- Your account holds billing and members.
- A project groups the parts of one product; yours is
learn. - An environment is an isolated copy of that product; yours is
lab. - A service is one running part, like a web server.
- A spherelet is one running copy of a service, with a fixed amount of CPU and memory.
Module 2 goes through each one properly.
Deploy hello-web
csph deploy --image quay.io/computesphere/learn-hello-web:1.0.0 --name hello-web --port 8080
--image is the container image, --name becomes part of the URL, and --port is where the app listens (8080 if you leave it out).
- Open Projects, then
learn, and choose New service, then Web Service. - Set Service name to
hello-weband pick thelabenvironment. - Under Configuration, choose Container image and set Image name to
quay.io/computesphere/learn-hello-web:1.0.0, Public. - Pick Flex with 1 spherelet, set Port to
8080(the console suggests 80), and choose Deploy.
If the port is wrong, the app starts but nothing can reach it.
Watch it go live
csph waits for you:
Applied 1 resource(s) — status: success
✓ hello-web (web-service) — created
deployment… (Deploying)
✓ deployment 3f9c2a71-… is Running
https://d-hello-web-3f9c2a71.computesphere.app
Deploying means the image is being pulled and started. Running means it's live and serving. The last line is your URL, with a certificate already on it. In the console, the same URL is on the service's page.
curl -I https://d-hello-web-3f9c2a71.computesphere.app
HTTP/2 200 means it's answering. Open it in a browser too.
Slow app, or you don't want to wait?
csph waits up to five minutes by default. Add --wait-timeout 10m for an app that starts slowly, or --no-wait to return as soon as the deployment has started.
Where it landed
csph context shows the account, project and environment csph deployed into: yours, learn and lab. In the console, open Projects, learn, then the lab environment, and hello-web is there.
Check yourself