Get started
Run in GitHub Codespaces
Build the lab in a codespace from your browser, with nothing installed locally.
docs/getting-started/codespaces.mdOn this page
A codespace is a Linux machine GitHub runs for you, with VS Code in the browser. The lab runs inside it exactly as it does on Linux, so you can try SnowOps Labs with nothing installed on your own computer.
What you need
- A GitHub account. Codespaces bills your account, not this repository. GitHub gives personal accounts a free monthly allowance of core hours; the lab asks for a 4-core machine, so every hour it runs uses four of them. The current allowance is on GitHub's Codespaces billing page.
- Nothing else. Docker,
labctl,kubectl,helmandk3dare installed inside the codespace.
Start it
- Click Open in GitHub Codespaces above. It opens the
stablebranch, the latest release, which is whatinstall.shneeds. Withquickstart=1, GitHub reopens your existing codespace instead of creating a second one. - Keep the 4-core machine type and create the codespace.
- Wait. While VS Code loads, the setup runs
./install.shand thenlabctl initin the creation log. The first run takes about five to ten minutes and ends with the lab's URLs.
When it finishes, open a terminal (Terminal → New Terminal) and run a scenario, as in the README:
labctl scenario up observability-sre --deploy-prereqs
labctl scenario verify observability-sreOpen the dashboard
labctl uiCodespaces forwards port 3939 and opens the dashboard in a new browser tab.
If the tab does not open, use the Ports panel and click the globe icon on
the labctl dashboard row. labctl ui also prints that it could not open a
browser; that message is expected here.
Reach Grafana and other web UIs
On your own machine the lab serves its web UIs at names such as
http://grafana.snowops.localhost. In a codespace those names only resolve
inside the codespace, so commands and checks that use them work in the
terminal, and links to them in the dashboard do not open in your browser.
Forward the service to a port instead. For Grafana:
kubectl -n monitoring port-forward svc/grafana 3000:80Codespaces opens port 3000 in a new tab. Sign in with admin / admin.
kubectl get ingress -A lists the lab's other web UIs (Prometheus, Argo CD
and the rest, as scenarios install them) with the service and port behind
each; forward any of them the same way.
From the terminal, the lab's hostnames work as written:
curl -s http://grafana.snowops.localhost/api/healthStopping and coming back
GitHub stops a codespace after it has been idle for a while (30 minutes by default) and keeps its disk. When you reopen it, run:
labctl initIt restarts the cluster and waits until it is healthy, keeping your apps and scenarios. A stopped codespace uses no core hours, but its disk counts against your storage allowance until you delete the codespace.
Upgrade
The codespace is a clone of this repository on stable. Upgrade it as on any
machine (README):
git fetch origin
git merge origin/stable
./install.shWhen something goes wrong
| You see | Do this |
|---|---|
The creation log ends with an error from install.sh about development content |
The codespace is on main. Delete it and use the button above, which opens stable. |
the Docker daemon is not running |
Docker was still starting when setup ran. Run labctl init again. |
A dashboard link to *.snowops.localhost does not open |
Expected in a codespace. Forward the service with kubectl port-forward, as above. |
labctl is not found in a terminal opened before setup finished |
Open a new terminal. |
Everything else: Troubleshooting, which applies to the codespace as it does to Linux.