canasta gitops remove-host
canasta > gitops > remove-host
canasta gitops remove-host
Remove a host from the gitops repository
Synopsis
Remove a host from hosts/hosts.yaml, together with its own files under hosts/<host>/: its vars.yaml, its recorded CLI version and, on Kubernetes, its rendered values and encrypted Secrets. Values every host shares stay in hosts/_shared/. Use it for a host that is retired; the host's own instance is not changed.
Run it on another host that can push (role source or both). A host cannot remove itself, and the last host that can push cannot be removed.
The change is made on top of the repository's main branch as it is on the remote, and holds only those paths: nothing staged, changed or committed on this host goes with it, and this host's files are not changed until its next canasta gitops pull. It runs whatever the CLI versions of the other hosts, so a host whose pull and push stop on a retired host's newer CLI can still run it.
canasta gitops remove-host [flags]
Examples
canasta gitops remove-host --host-name old-prod
Flags
| Flag | Shorthand | Description | Default | Required | Orchestrator |
|---|---|---|---|---|---|
--host-name |
Name of the host in hosts/hosts.yaml | ✓ | Both | ||
--id |
-i |
Canasta instance ID | * | Both | |
--key |
Compose only. Path on the controller (the machine running canasta) to the git-crypt symmetric key, used to unlock the checkout if it is locked. Without it, a repo with GPG recipients is unlocked through a forwarded GPG agent. | Both | |||
--ssh-key |
Path on the instance's host to an SSH private key for git network operations. When set, git runs with GIT_SSH_COMMAND="ssh -i <ssh-key> ...". On a remote host, give an absolute path or one starting with a quoted '~' (for example '~/x'). On Compose, the instance remembers the path, and later gitops commands use it when --ssh-key is omitted; passing it again replaces it. Without a remembered key, git uses ssh-agent forwarding on Compose, or the staged deploy key on Kubernetes. | Both |
* Defaults to the Canasta instance matching the current directory, if any.
Global flags
| Flag | Shorthand | Description | Default | Required | Orchestrator |
|---|---|---|---|---|---|
--help |
-h |
Show help message and exit | Both | ||
--verbose |
-v |
Enable verbose output | Both |