rune delete

Remove resources and inspect deletion operations.

Shorthand — delete a service

rune delete my-service
rune delete my-service --force --output json

Subcommands

rune delete service <name>      # full form
rune delete list                # list deletion operations
rune delete status <id>         # inspect a specific deletion op

Examples

# Delete a service
rune delete api
 
# Force-delete (ignore "in use" errors)
rune delete api --force
 
# Delete a secret / configmap
rune delete secret db-credentials
rune delete config app-settings
 
# Delete a namespace (refuses if not empty unless --force)
rune delete namespace staging --force
 
# Watch a long-running deletion
rune delete list
rune delete status <id>

Flags

FlagDefaultNotes
-n, --namespacecontextTarget namespace.
--forcefalseSkip "in use" / "non-empty" checks.
--abandon-finalizersfalserune delete service only. For a service already being deleted: skip its remaining cleanup and remove the record. See Stuck deletions.
--waittrueWait for deletion to complete.
--no-waitfalseReturn immediately with a deletion op ID.
--timeout5mWait timeout.
-o, --outputtabletable, json, yaml.

Behavior

Deletion is staged through finalizers and worker tasks (see pkg/orchestrator/finalizers). For services, that means:

  1. Mark spec for deletion.
  2. Scale to 0.
  3. Run finalizers (deregister from discovery, cleanup networks, etc.).
  4. Remove the resource from the store.

You can interrogate any of those steps with rune delete status <id>.

Stuck deletions

If a finalizer keeps failing, the service stays in teardown: deleting it again changes nothing, and rune cast refuses it until it is gone. As a last resort:

rune delete service api --abandon-finalizers

This skips whatever cleanup is left and removes the record on the next reconcile. It asks Abandon the remaining cleanup? (y/N) first, unless you pass --force. --dry-run shows what would be abandoned.

It refuses two cases:

  • A service that isn't being deleted. The message ends with the command to run first:

    service default/api is not being deleted; run `rune delete service api -n default` first
  • A service that is still removing its instances (service default/api is still removing its instances; wait for that to finish, then retry). Instance cleanup never gets stuck, and abandoning it would leave containers nothing reaps.

What the skipped cleanup would have removed is left for you, and the command warns about it. In particular, volumes the service owned stay in place, with their data. A later cast of a service with the same name binds them again; if you don't want that, delete them first with rune delete volume <name>.

Since v0.0.1-dev.148

Since v0.0.1-dev.148.