Show examples as

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.

SubcommandDescription
vmCreate a VM from CLI flags or -f YAML manifest. Assign a GPU with --gpu radeon0.
containerCreate a container on a node
postgresqlOne PostgreSQL database from the NixOS package. Alias postgres. See PostgreSQL.
networkCreate a network
clusterInitialise 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

SubcommandAliases
vmsvm
containerscontainer
postgresqlpostgres
nodesnode
networksnetwork
storage-classstorage-classes
volumesvolume
compliance-reportcompliance
crypto-configcrypto
sbom
audit-eventsaudit
conflicts
replication-status
disk-layoutsdisk-layout, disklayout
ceph-clustersceph-cluster, cephcluster
certificatescerts, certificate
pki-statuspki
crl
migrate-sessionmigrate-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

SubcommandAliases
vmvms
nodenodes
networknetworks
postgresqlpostgres
storage-classstorage-classes
ssh-keysshkey
compliance-reportcompliance
crypto-configcrypto
disk-layoutdisklayout
ceph-clustercephcluster

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

SubcommandDescription
vmDelete a VM
networkDelete a network
imageDelete a stored image
containerDelete a container
postgresqlRemove 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

SubcommandDescription
vmStart or stop a VM
containerStart or stop a container

set

SubcommandDescription
vmSet desired state (running / stopped). Supports --target-node.

update

SubcommandDescription
vmResize 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

SubcommandDescription
disksList disks on a node
nicsList network interfaces on a node
installInstall kcore on a bare-metal node
approveApprove a pending node join request
rejectReject a pending node join request
apply-nixApply 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-imageUpload a VM image to a node

pull

SubcommandDescription
imagePull 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

SubcommandDescription
createRegister a new SSH public key
deleteRemove an SSH key
listList all SSH keys
getShow 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.

SubcommandDescription
createRegister an operator identity as CN=kctl:<name>. Names are ASCII alphanumeric plus _ and -.
listList operators
getShow one operator and its roles
issue-certIssue a client certificate for the operator from the controller sub-CA and write it to ~/.kcore/operators/<name>/operator.crt and operator.key.
grant-roleGrant a role. --role is required and takes read-only, vm-admin, or cluster-admin.
revoke-roleRemove one role from an operator, named with --role.
deleteDelete 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

SubcommandDescription
listCluster GPU inventory. --local scans this machine. --node filters one node. See GPU passthrough.

drain

SubcommandDescription
nodeCold-reassign all VMs off a node (shared RBD does not copy disks). Use --target-node to pin the destination.

migrate

SubcommandDescription
vmLive-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-sessionClear 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

SubcommandDescription
certsRotate the controller TLS certificate
sub-caGenerate a new sub-CA
node-certsRotate node certificates via CSR, so private keys stay on the nodes. Takes --node or --all. See certificates & encryption.

revoke

SubcommandDescription
certRevoke 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.

SubcommandDescription
apply -f FILEPrint the plan and ask y/n, then create or update.
get NAMEPrint one cluster.
listList clusters.
health NAMEPrint control-plane, worker, etcd, and API status.
delete NAMEDelete the cluster row. --force is accepted. This does not turn Kubernetes off on the nodes.
scale NAMERecord 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

SubcommandDescription
createCreate a workload. Use --kind container or --kind vm.
listList all workloads
getShow workload details
deleteDelete a workload
startStart a workload
stopStop a workload

security-group (alias: sg)

SubcommandDescription
createCreate a security group from -f YAML
applyApply / update a security group from -f YAML
listList all security groups
getShow security group details
deleteDelete a security group
attachAttach a security group to a VM or network
detachDetach a security group from a VM or network