kctl CLI reference
kctl is the command-line interface for managing kcore clusters. Global flags: -s / --controller (controller address, repeatable for HA), -k / --insecure (skip TLS verification), -c / --config (path to config file), --node (node address for direct node commands).
You are browsing in YAML mode. This page lists CLI commands; for manifest kinds and fields see the YAML manifest reference.
This page is the kctl reference. Terraform examples are on the task pages, such as VM creation.
create
kctl create is idempotent. Re-running the same command (or re-applying the same manifest with -f) performs a server-side upsert: it creates the resource if missing, updates mutable fields if they drifted, rejects changes to immutable fields with InvalidArgument, or prints unchanged when the stored state already matches. See Idempotency and upsert for the mutable/immutable field tables.
| Subcommand | Description |
vm | Create a VM from CLI flags or -f YAML manifest. Assign a GPU with --gpu radeon0. |
container | Create a container on a node |
postgresql | One PostgreSQL database from the NixOS package. Alias postgres. See PostgreSQL. |
network | Create a network |
cluster | Initialise PKI and mTLS context for a new cluster |
kctl create vm accepts --extra-network (repeatable), --label key=value (repeatable), and --anti-affinity <group>. kctl create network accepts --ipv6-prefix, --ipv6-gateway, and --east-west-firewall. See Networks and VM creation.
get
| Subcommand | Aliases |
vms | vm |
containers | container |
postgresql | postgres |
nodes | node |
networks | network |
storage-class | storage-classes |
volumes | volume |
compliance-report | compliance |
crypto-config | crypto |
sbom | |
audit-events | audit |
conflicts | |
replication-status | |
disk-layouts | disk-layout, disklayout |
ceph-clusters | ceph-cluster, cephcluster |
certificates | certs, certificate |
pki-status | pki |
crl | |
migrate-session | migrate-sessions |
Filters worth knowing: audit-events takes --limit (default 100), --action for an exact action name, and --since for an RFC 3339 timestamp. vms, networks and disk-layouts take --target-node. crl takes -o to write the CRL to a file. sbom takes --kind crates|iso-closure and -o to write the CycloneDX document.
describe
| Subcommand | Aliases |
vm | vms |
node | nodes |
network | networks |
postgresql | postgres |
storage-class | storage-classes |
ssh-key | sshkey |
compliance-report | compliance |
crypto-config | crypto |
disk-layout | disklayout |
ceph-cluster | cephcluster |
describe disk-layout <name> shows the current generation, the observed status reported by the node, and the layout body. See Day-2 operations and kcore SAN (Ceph).
delete
| Subcommand | Description |
vm | Delete a VM |
network | Delete a network |
image | Delete a stored image |
container | Delete a container |
postgresql | Remove the NixOS service definition. /var/lib/postgresql stays on disk. Alias postgres. |
disk-layout (alias disklayout) | Delete a DiskLayout on the controller. Does not touch the node and does not repartition anything. Needs cluster-admin. |
ceph-cluster (alias cephcluster) | Delete a CephCluster resource. Does not wipe OSDs, so the stored data survives. Needs cluster-admin. |
vm and network take --target-node when the name exists on more than one node. image and container take --force.
start / stop
| Subcommand | Description |
vm | Start or stop a VM |
container | Start or stop a container |
set
| Subcommand | Description |
vm | Set desired state (running / stopped). Supports --target-node. |
update
| Subcommand | Description |
vm | Resize CPU / memory of a VM. Supports --target-node. |
cluster (alias os) | Host OS rollout: plan, apply, get, list, approve, cancel, rollback — see Cluster & node upgrades. |
node
| Subcommand | Description |
disks | List disks on a node |
nics | List network interfaces on a node |
install | Install kcore on a bare-metal node |
approve | Approve a pending node join request |
reject | Reject a pending node join request |
apply-nix | Apply NixOS configuration to a node |
apply-disk (alias apply-disko) | Validate or apply a day-2 disk layout on a node, built on disko. -f names the layout file. Validates only unless you pass --apply; --timeout-seconds defaults to 300, and --no-rebuild skips the nixos-rebuild that otherwise follows an apply. |
upload-image | Upload a VM image to a node |
pull
| Subcommand | Description |
image | Pull an image onto a node from an HTTPS URI. --sha256 is required — the pull is refused without it, because the checksum is the integrity check. The image is stored under /var/lib/kcore/images/. |
ssh-key
| Subcommand | Description |
create | Register a new SSH public key |
delete | Remove an SSH key |
list | List all SSH keys |
get | Show details for an SSH key |
operator
Operators are named RBAC identities, each with its own client certificate under CN=kctl:<name>. Every subcommand here needs cluster-admin.
| Subcommand | Description |
create | Register an operator identity as CN=kctl:<name>. Names are ASCII alphanumeric plus _ and -. |
list | List operators |
get | Show one operator and its roles |
issue-cert | Issue a client certificate for the operator from the controller sub-CA and write it to ~/.kcore/operators/<name>/operator.crt and operator.key. |
grant-role | Grant a role. --role is required and takes read-only, vm-admin, or cluster-admin. |
revoke-role | Remove one role from an operator, named with --role. |
delete | Delete an operator and all of its role assignments |
Removing a role is not the same as revoking the certificate. revoke-role changes what an identity is allowed to do; the certificate itself stays valid until you revoke it with kctl revoke cert --subject kctl:<name>. Revocation takes effect on the next RPC the operator makes, not during the TLS handshake. See certificates & encryption.
gpu
| Subcommand | Description |
list | Cluster GPU inventory. --local scans this machine. --node filters one node. See GPU passthrough. |
drain
| Subcommand | Description |
node | Cold-reassign all VMs off a node (shared RBD does not copy disks). Use --target-node to pin the destination. |
migrate
| Subcommand | Description |
vm | Live-migrate a Ceph-backed VM to --target-node. Optional --allow-cold-fallback. A VM with a GPU is cold-migrated onto a free GPU of the same family, or onto --gpu. See VM migration and GPU passthrough. |
reset-session | Clear a stranded live-migrate receive session on --node (mandatory). Reports what it would clear and exits non-zero unless --force is given. Needs cluster-admin. |
A receive session outlives its migration if the controller dies mid-flight, and every later migration of that VM to that node then fails with ALREADY_EXISTS. Nothing clears it automatically. Inspect first with kctl get migrate-session <vm> (read-only; queries every CephCluster member unless you pass --node), then clear with kctl migrate reset-session <vm> --node <id> --force. Clearing a session whose receive VMM is still alive kills an in-flight migration. See VM migration.
rotate
| Subcommand | Description |
certs | Rotate the controller TLS certificate |
sub-ca | Generate a new sub-CA |
node-certs | Rotate node certificates via CSR, so private keys stay on the nodes. Takes --node or --all. See certificates & encryption. |
revoke
| Subcommand | Description |
cert | Revoke an issued certificate by --serial, --subject, or --node, with an optional RFC 5280 --reason. The certificate lands on the CRL and OCSP. |
kubernetes
kctl kubernetes plans and applies a KubernetesCluster manifest. Needs cluster-admin. The API VIP, Cilium L2, and volumes are on the Kubernetes page.
| Subcommand | Description |
apply -f FILE | Print the plan and ask y/n, then create or update. |
get NAME | Print one cluster. |
list | List clusters. |
health NAME | Print control-plane, worker, etcd, and API status. |
delete NAME | Delete the cluster row. --force is accepted. This does not turn Kubernetes off on the nodes. |
scale NAME | Record added members as node-id:address. The orchestrator does not join them. --remove does not delete the membership row. |
apply
Apply a NixOS configuration to the controller. Flags: -f (config file), --dry-run (preview without applying).
diff
Show what applying a manifest would change, without changing anything. -f / --filename is required. Only kind: DiskLayout is supported today — any other kind exits with an error rather than guessing. See Day-2 operations.
version
Print the kctl client version. Takes no flags and does not contact a controller.
console
kctl console <vm> attaches to a VM's serial console through the controller. Press Ctrl-] then Enter to detach. Needs vm-admin, and every attach is recorded in the audit log as AttachVmConsole with the actor, the VM and the timestamp.
This is a serial console, so it is the right tool for a CLI login, rescue, or watching an installer. kcore does not provide a hypervisor-level graphical console; if you need a desktop, run a VNC server inside the guest and reach it over the network. The dashboard exposes the same console in a browser.
workload
| Subcommand | Description |
create | Create a workload. Use --kind container or --kind vm. |
list | List all workloads |
get | Show workload details |
delete | Delete a workload |
start | Start a workload |
stop | Stop a workload |
security-group (alias: sg)
| Subcommand | Description |
create | Create a security group from -f YAML |
apply | Apply / update a security group from -f YAML |
list | List all security groups |
get | Show security group details |
delete | Delete a security group |
attach | Attach a security group to a VM or network |
detach | Detach a security group from a VM or network |