Astrona destroy
astrona destroy¶
Remove a lab and everything in it (and any leftover astrona test copy)
Synopsis¶
Tear down a lab environment (both the normal run and any leftover 'astrona test' run).
With no lab-name, resolves the lab config the same way run/submit do (-c/--file/--git/--git-ref) and falls back to auto-discovering running labs if that fails.
With a lab-name (as shown by astrona list, with or without the 'astro-' prefix — e.g. 'astro-my-lab' or just 'my-lab'), destroys that lab directly — no config needed, so -c/--file/--git/--git-ref are ignored and any teardown scripts are skipped.
With a catalog name (astrona.io/ATS016/section-020/module-01/lab-01, or without astrona.io/ as astrona labs lists it), destroys that lab through its config, teardown scripts included.
With a glob pattern (contains *, ?, or [), matches against all currently-running lab names (same list astrona list shows, with or without the 'astro-' prefix) and destroys every match — e.g. astrona destroy 'qemu-jumphost-*' (quote it so your shell doesn't expand the glob itself). No config needed, same trade-offs as a single name.
A lab's linked clusters (runtime.kind.clusters) are destroyed with it.
If astrona run pointed kubectl at the lab, the kubectl context you had before comes back — only when the lab's context is still current (if you've switched elsewhere, that's left as it is). What astrona remembered about the lab (its config, its lab session) is forgotten.
A remote lab (--git, URL, catalog) that has teardown scripts asks for approval first, like run — --trust approves it up front. If it isn't approved (declined, or no terminal and no --trust), its teardown scripts are skipped and the lab is still destroyed.
The lab's copy of its resources (~/.astrona/resources/
Options¶
-h, --help help for destroy
--keep-resources Keep the lab's resources in ~/.astrona/resources/<lab> (for reference)
Options inherited from parent commands¶
--accept-terms Accept this CLI's usage terms and data-loss risk notice; required on each operational CI command (read: astrona terms)
-c, --config string Path or URL to the lab config directory (with --git: a subdirectory within the cloned repo) (default ".")
-f, --file string Configuration file name override (default "config.yaml")
--git string Git repository URL to clone/pull (https://, git@host:, or ssh://) — --config then selects a subdirectory within it
--git-ref string Git branch, tag, or commit to check out (used with --git; default: the repo's default branch)
--headless Disable the terminal UI and CLI prompts; run/reset skip login reminders and new account sessions
--install-version If the lab needs another astrona release (astronaVersion) that isn't installed, install it without asking — for CI
--trust Approve running a remote (--git / URL) lab without asking — for CI; review the lab first
--update-check Check for new CLI releases (disabled in CI, without a terminal, or by ASTRONA_NO_UPDATE_CHECK) (default true)
--verbose Stream the full output of every underlying command instead of the compact step view
SEE ALSO¶
- astrona - Astrona is the Astrona lab community CLI