KiteGitHub
Quickstart

CLI reference

Every `kite` and `kite-agent` command, with its options.

kite runs on your workstation. kite-agent runs as root on a Linux node. kite-control is the self-hosted control plane, which runs under systemd on your own servers.

CommandsSection
--server, --token, --deployment, --kubeconfigChoose a cluster
kite login, kite logout, kite whoamiSign in
kite kubeconfig, kite get-tokenWrite a kubeconfig
kite statusSee what needs attention
kite accessAsk for access
kite localRun a local cluster
kite signing-keyManage cluster signing keys
kite node addJoin a host
kite node updateUpdate nodes
kite node listUpdate nodes
kite deployDeploy a cluster
kite deploy --hostDeploy to your own hosts
kite nodepool connect, kite nodepool verifyConnect a cloud account
kite-agentAdminister a Linux node
-o json, exit codesOutput for programs

Install

curl -fsSL https://get.runkite.io | sh

To install another release, or to another directory, set one of these variables:

VariableEffectDefault
KITE_CHANNELThe channel to install from: stable or edgestable
KITE_VERSIONA specific release, such as 0.2175.0, to install instead of a channelnone
KITE_INSTALL_DIRThe directory to install kite to~/.local/bin

edge is the newest release from main. kite version prints the CLI’s release and its commit.

Choose a cluster

kite login <url> saves the cluster’s address, and later commands use it. These options override the saved cluster for one command:

OptionEffect
--server <url> or KITE_SERVERUse this cluster instead of the saved one.
--token <token> or KITE_TOKENUse this credential instead of the saved one.
--deployment <name> or KITE_DEPLOYMENTUse the address and admin token from ~/.kite/deployments/<name>/deploy.env, and trust the ca.crt in that directory if there is one.
--kubeconfig <file>Use the server, token and certificate authority from the file’s current context. kite-control kubeconfig prints such a file.
--debug or KITE_DEBUGPrint each request and response to stderr.

A command takes the cluster’s address and credential from the first of these that is set:

  1. --server and --token, each for its own value.
  2. --kubeconfig.
  3. --deployment.
  4. KITE_DEPLOYMENT.
  5. KITE_SERVER and KITE_TOKEN.
  6. The sign-in that kite login saved.
ErrorFix
no cluster is set.Run kite login <url>, or pass --server <url>, --deployment <name> or --kubeconfig <file>.
401Sign in again, or pass the admin token with --token.

Sign in

CommandResult
kite login <url>Signs in through the browser, saves the credential, and adds a kubectl context for the cluster and selects it.
kite login <url> --age 30mSets how long the token stays valid: 900, 30m, 8h.
kite login <url> --kubeconfig-file <f>Adds the context to <f> instead of the first file in KUBECONFIG, or ~/.kube/config.
kite login <url> --no-kubeconfigChanges no kubeconfig.
kite login <url> --ca-hash sha256:<hex>Trusts the cluster’s own certificate authority when its SHA-256 matches. kite deploy --host prints the command.
kite logout [<url>]Revokes the credential if the provider allows it, deletes it from this machine, and removes the context that login added.
kite logout [<url>] --keep-kubeconfigLeaves the context in the kubeconfig.
kite whoamiPrints the username and groups that the cluster passes to RBAC, and a binding to send an admin if you have no access yet.

A cluster deployed with kite deploy --host has its own certificate authority, which kite login does not trust without --ca-hash. With the hash, kite login reads the authority from the cluster’s TLS handshake, refuses it unless its hash matches, and saves it with your sign-in. The kubeconfig context trusts it too.

kite login and kite whoami say that you have no access when you may do nothing in the default namespace or across the cluster. A role bound in another namespace alone still counts as no access.

--age applies only to a cluster behind Cloudflare Access. There a token stays valid for an hour unless you set --age, and for 12 hours at most. With an OIDC provider, the provider sets how long its tokens stay valid, so kite login ignores --age. See Sign in to a cluster.

Write a kubeconfig

kite login adds the cluster’s context to your kubeconfig. To manage your kubeconfig files yourself, sign in with --no-kubeconfig and use kite kubeconfig, which prints a kubeconfig for the saved cluster. Save it to its own file, and add that file to KUBECONFIG. --name sets the name of the cluster and of the context. By default, that name is the cluster’s host and port. The kubeconfig runs kite get-token to get a credential. kite get-token renews the credential and never opens a browser.

See what needs attention

kite status prints the cluster’s nodes, its agent rollout and its pods, then each item that needs attention, with the command that fixes it:

Nodes          2 of 3 ready, 1 agent behind
Agent rollout  paused: the update of node-7 failed, automatic
Pods           5 running, 1 pending, 1 failed

2 items need attention:

OBJECT            REASON          AGE  FIX
Node/node-7       UpdateFailed    2h   kite node update node-7
Ingress/shop/web  NoIngressClass  -    kubectl get ingressclass, then set spec.ingressClassName to one of them

It reads the cluster’s ClusterSummary, so it needs the ClusterRole kite:summary-reader, which cluster-admin includes. Each item lasts as long as its problem does, not the hour that an Event lasts. -o json prints the whole summary, each item’s message included. See Read the cluster summary for every reason and its fix.

Ask for access

CommandResult
kite access request --role <clusterrole> [--namespace <ns>] [--reason <text>]Asks for a ClusterRole in one namespace, or across the cluster with no --namespace. Prints the request’s name.
kite access show <request>Shows a request, and whether it was decided and by whom.
kite access listLists every request, pending ones first. Takes an approver’s access.
kite access approve <request>Creates the binding the request asks for, with your own access, then records the approval.
kite access decline <request>Records that the request is declined.

Anyone signed in may make a request and read it back by name. See Ask for access with a request.

Run a local cluster

kite local runs a cluster in Docker on your workstation. Docker must be running. The quickstart walks through it.

CommandResult
kite local upStarts the control plane and one node, and writes ~/.kite/local/kubeconfig.
kite local up --nodes <n>Runs n nodes. An n smaller than the number of nodes does not remove any.
kite local up --port <port>Publishes the control plane on this port when up creates it. The default is 6443, and 0 picks a free port. A control plane that up replaces keeps its port, and up refuses a --port that names another.
kite local up --release <version>Runs a specific release, such as 0.2162.0, instead of the CLI’s own.
kite local up --update-kubeconfigAdds a kite-local context to your default kubeconfig and selects it.
kite local up --oidc <file>Trusts the OIDC issuer that the file sets. See OIDC issuer.
kite local statusShows the control plane’s address and release, and whether each node is Ready.
kite local logs [control|node-N]Prints the control plane’s log, or the node’s install log, which up keeps off the terminal, and its agent’s journal.
kite local load <image>...Copies images from your local Docker into every node, so pods can use them without a registry.
kite local downStops the control plane and the nodes, and keeps their state.
kite local deleteRemoves the containers, their volumes, and ~/.kite/local.

You can run up again at any time. It starts what is stopped and joins the nodes that are missing.

FileContents
~/.kite/local/kubeconfigThe kubeconfig that up writes. It trusts ca.crt, so clients that check certificates connect.
~/.kite/local/secrets.envThe cluster’s tokens.
~/.kite/local/ca.crtThe certificate authority that signs the cluster’s certificate.

To pull Kite’s images from another registry, set KITE_REGISTRY, and copy each image there with all of its platforms, because up pulls each image by the digest in the release’s signed manifest.

Named clusters

Add --name <name> to any kite local command to work with a separate cluster. Each named cluster has its own:

  • containers, network and volumes, named kite-local.<name>.*
  • kubeconfig context, kite-local.<name>
  • state, in ~/.kite/local.<name>

A name is up to 40 characters long and uses lowercase letters, digits and -. It starts with a letter and ends with a letter or a digit.

For a test suite that starts its own cluster, use a unique name and --port 0, so that runs don’t collide with your cluster or with each other:

kite local up --name test-1 --port 0
kite local load --name test-1 app:dev
export KUBECONFIG=~/.kite/local.test-1/kubeconfig
kite local delete --name test-1

OIDC issuer

--oidc <file> makes the cluster accept tokens that an OIDC issuer signs. The file contains KITE_OIDC_ lines, as deploy.env does:

KITE_OIDC_ISSUER=https://issuer.example.com
KITE_OIDC_AUDIENCE=https://127.0.0.1:7443
KITE_OIDC_USERNAME_CLAIM=sub
KITE_OIDC_PREFIX=app:
KITE_OIDC_JWKS={"keys":[{"kty":"EC","crv":"P-256","alg":"ES256","x":"…","y":"…"}]}
kite local up --port 7443 --oidc oidc.env
==> fetching release 0.4208.0
==> replacing the control plane to apply the OIDC settings
==> waiting for the control plane on https://127.0.0.1:7443
==> waiting for the nodes to report Ready

The file must set KITE_OIDC_ISSUER and KITE_OIDC_AUDIENCE, and up refuses any name that is not an OIDC setting. With KITE_OIDC_JWKS, the cluster checks each token against those keys and fetches nothing from the issuer. An empty value is set, so KITE_OIDC_PREFIX= gives usernames with no prefix. Identity and access lists the other settings.

The cluster keeps the settings in ~/.kite/local/oidc.env, so a later up without --oidc keeps them, and so does a move to another release. When the settings change, up replaces the control plane and keeps the cluster’s state. To remove the settings, pass an empty file.

up publishes a control plane that it replaces on --port, or on a new free port with --port 0. If KITE_OIDC_AUDIENCE contains the cluster’s address, choose a port and pass the same --port each time.

Manage cluster signing keys

These commands require the admin token. Pass it with --token or KITE_TOKEN.

CommandResult
kite signing-key listPrints the active and retained public keys.
kite signing-key rotateReplaces the active signing key. Each node connects again for a credential that the new key signs.
kite signing-key retire <kid>Removes the public key with this key ID. Refuses the active key, and a key that still signs a node’s credential.
kite signing-key retire <kid> --forceRemoves the key at once, as for a key that leaked. Each node whose credential it signs must join again.

See Rotate the signing key.

Join a host

kite node add <target> installs the agent on a host, joins the host to the cluster, and waits for the node to be Ready. The host must be able to open outbound HTTPS connections to the cluster. You need permission to create Secrets in kube-system.

TargetHow kite connects
A running Docker containerdocker exec as root
A Lima VMlimactl shell with sudo
user@hostssh. As root@host it runs the script directly. As any other user it runs the script with sudo -n.
--via "<command>"Your command. It must read a script on stdin and run it as root, such as gcloud compute ssh vm -- sudo bash.
NonePrints the lines to run on the host
OptionEffectDefault
--name <node>The node’s name.the host’s name
--address <url>The address the host uses to connect to the cluster.
--ttl <duration>How long the token stays valid: 30m, 1h, 2d.1h
--uses <n>How many hosts can join with the token.1
--wait <duration>How long to wait for Ready. 0s returns once the host joins.5m
--runtime <name>A sandboxed runtime to install, gvisor or kata. The node gets the label runtime.kiteplane.dev/<name>=true. Repeat the option for more than one. Requires a --wait above 0s.
--skip-checksInstalls even if the host fails its checks: the OS, CPU, nftables, memory, and whether it reaches the cluster.

For a cluster on your workstation, kite node add tells a container to connect to host.docker.internal, and a Lima VM to connect to host.lima.internal, on the cluster’s port.

Update nodes

kite node update updates nodes to the agent that the cluster serves. It requires the admin token, except with --host or --via.

CommandResult
kite node listShows each node: whether it is Ready and since when, the agent it runs, the agent the cluster serves, and the pool that added it, or - for a host someone joined.
kite node drain <node>Marks the node unschedulable and evicts each of its pods but a DaemonSet’s, through the eviction API. --timeout sets how long it waits for them, 5m by default.
kite node remove <node> --host <target>Drains the node, runs kite-agent leave on its host, and deletes the Node. --via "<command>" reaches the host as for node add.
kite node remove <node> --goneFor a host that no longer exists: deletes its pods at once and the Node, without a drain.
kite node updateShows whether automatic updates are on, the agent that the cluster serves, any update in progress, and each node that is behind, with its reason and what to run.
kite node update <node>...Updates each node in turn and waits for it to be Ready.
kite node update --allUpdates every node that runs an older agent, one at a time.
kite node update --automatic on|offTurns automatic updates on or off.
kite node update --host <target>...Runs the update on each host. It connects to a host the same way node add does.
kite node update --via "<command>"The same, through a command that runs a script as root.
OptionEffectDefault
--no-waitReturn once the cluster accepts the request.
--timeout <duration>How long to wait.30m
--keep-goingWith --host, continue to the next host after a failure.

Upgrade a node says when to run the update on the host.

Deploy a cluster

kite deploy deploys a cluster to your Cloudflare account. With --host, it deploys to your own servers instead, as Deploy to your own hosts describes. By default, it deploys the same release as the CLI. Configure a deployment explains each setting.

The deployment’s name is the value of --name, or else KITE_WORKER, or else kite-control. Its settings are in ~/.kite/deployments/<name>/deploy.env, and each deploy writes a kubeconfig to the same directory.

CommandResult
kite deploy initAsks for the address, sign-in, admin and fixed settings, writes deploy.env, creates credentials, and deploys after one confirmation.
kite deployShows the plan and asks you to approve it. Then it creates everything and runs bind.
kite deploy credentialsCreates the deploy token, and the R2 key and bucket for an audit log.
kite deploy controlUploads the control plane, and routes the hostname or the workers.dev address to it.
kite deploy secretsSets the credentials as secrets on the Worker.
kite deploy dnsCreates the proxied DNS record for KITE_HOSTNAME.
kite deploy accessPuts Cloudflare Access in front of the sign-in paths.
kite deploy auditCreates the Logpush job for the audit log.
kite deploy bindBinds each email in KITE_ACCESS_ALLOW to KITE_ACCESS_ROLE, and KITE_ADMIN_GROUP to cluster-admin.
kite deploy waitWaits until the control plane serves the agent of its release.
kite deploy destroyDeletes the NodePools and their machines, then the Worker, its Durable Objects and the audit job. Deletes the tokens if the deploy token can manage API tokens.
kite deploy move --to <name>Moves the cluster to the deployment <name> through the cluster’s copy. The target is on Cloudflare, or on a server with --host. Between Workers, it routes KITE_HOSTNAME to the new Worker.
OptionEffect
--dry-run, -nShow what would change, and change nothing.
--yes, -yMake the changes without asking.
--update-kubeconfigAlso add the cluster’s context to your default kubeconfig, and select it.
--channel <name> or --release <version>Deploy a release other than the CLI’s own: the release on a channel, stable or edge, or a specific version.
--source <dir>Build the Kite checkout at <dir> and deploy it. For a deploy to hosts, Kite copies the build to each host over its connection. Requires docker buildx.
--bucketWith destroy, also delete the audit bucket.
--keep-machinesWith destroy, leave the NodePools and their machines running. Nothing deletes the machines afterwards.

Cloudflare tokens says which tokens a deploy uses and how to create them.

Deploy to your own hosts

kite deploy --host <target> installs kite-control on a Linux host with systemd, and serves the cluster from that host. kite-control runs the whole control plane as one process. It can also run as a Raft group of 3 or 5 servers, which kite deploy does not set up. Deploy to your own servers walks through it. The target is a running Docker container, a Lima VM, or an ssh destination, as for kite node add. --via "<command>" connects to a host through your command, which must read a script on stdin and run it as root.

CommandResult
kite deploy --host <target>Installs kite-control, and writes a kubeconfig that trusts the cluster’s own certificate authority.
kite deployInstalls the release on every host. The host that serves the cluster is last.
kite deploy waitShows which host serves the cluster.
kite deploy destroyRemoves kite-control and the cluster’s data from every host. Keeps the database or the copy, and deploy.env.

--address or KITE_ADDRESS sets the address that clients and nodes use, https://<name>[:<port>], and kite-control listens on its port. The default is the ssh target’s host, on port 443.

When neither KITE_DATABASE nor KITE_COPY is set, kite deploy destroy first deletes the NodePools and their machines, as it does on Cloudflare.

To add a standby, run kite deploy --host again with another host. All hosts use the same settings, and a second host requires KITE_DATABASE or KITE_COPY. Point --address at a name that sends connections to every host, such as a load balancer’s. A serving host that cannot renew its lease for the whole length of a lease stops, so that it never serves at the same time as the standby that takes over. Add a second server says how the hosts share the lease and when a standby takes over.

Shared state

SettingMeaningDefault
KITE_DATABASEThe Postgres database that keeps the cluster, postgres://<user>@<host>/<database>. Its lease lasts 15 seconds.none
KITE_DATABASE_PASSWORDThe database’s password. KITE_DATABASE cannot contain it.none
KITE_COPYThe S3 or R2 bucket that keeps a copy of the cluster, s3://<bucket>/<prefix>.none
KITE_COPY_ACCESS_KEY_ID, KITE_COPY_SECRET_ACCESS_KEYThe access key that writes the copy.none
KITE_COPY_REGION, KITE_COPY_ENDPOINT_URLThe bucket’s region, and its endpoint for R2 or another S3 service.none
KITE_COPY_LEASESeconds a standby waits after the serving host stops renewing the lease. At least 3.30
KITE_COPY_SYNC1 acknowledges a write only once the copy contains it.off
KITE_COPY_SPACING_MSMilliseconds between the starts of two uploads. At least 100. Longer sends fewer billed requests.250

Control plane costs gives what the lease and the uploads cost on S3 and R2.

Snapshots

SettingMeaning
KITE_SNAPSHOTSThe S3 or R2 bucket that nodes upload sandbox snapshots to, s3://<bucket>/<prefix>.
KITE_SNAPSHOTS_ACCESS_KEY_ID, KITE_SNAPSHOTS_SECRET_ACCESS_KEY, KITE_SNAPSHOTS_SESSION_TOKENThe access key that signs snapshot URLs, and lists and deletes snapshots.
KITE_SNAPSHOTS_REGION, KITE_SNAPSHOTS_ENDPOINT_URLThe bucket’s region, and its endpoint for R2 or another S3 service.

Join a node to your own hosts

To join a node, run kite node add --deployment <name> <target>. The command and the node both trust the cluster’s own certificate authority. If you installed the control plane on the server with curl -fsSL https://get.runkite.io/control | sh, save the file that kite-control kubeconfig prints and pass it with --kubeconfig instead. To set that control plane’s address, set KITE_ADDRESS before sh. It works as --address does for kite deploy.

Connect a cloud account for node pools

CommandResult
kite nodepool connect gcp --project <id>Prints the gcloud commands that connect a Google Cloud project.
kite nodepool connect awsPrints the aws commands that connect an AWS account.
kite nodepool connect digitaloceanPrints the token scopes and Kubernetes steps for DigitalOcean.
kite nodepool verify <nodeclass>Tests the cloud credential and reports the first failed check. Needs get on the NodeClass and create on nodeclasses/verify.

connect prints commands and runs none of them. Every connect form takes --cluster <name>, the cluster name. The cloud resources carry it as a label, so deployments that share an account keep their resources apart.

GCP

kite nodepool connect gcp optionDefault
--project <id>none, required
--zone <zone>us-central1-a
--pool <id>kite
--provider-id <id>kite
--service-account <name>kite-node

AWS

kite nodepool connect aws optionDefault
--region <region>us-east-1
--role <name>kite-nodepool
--instance-profile <name>kite-node
--class <name>ec2

DigitalOcean

kite nodepool connect digitalocean optionDefault
--region <slug>nyc3
--secret <name>digitalocean
--namespace <namespace>kube-system
--class <name>droplet

See the node pools guide.

Administer a Linux node

Run these on the host, with sudo. See Manage nodes.

CommandResult
kite-agent join --cluster <wss-url>/connect --token <bootstrap-token>Joins the host to a cluster and starts the agent.
kite-agent updateDownloads the agent that the cluster serves, and restarts the service if it changed.
kite-agent statusShows the node, the cluster, whether the host can reach it, the agent’s state, and its version.
kite-agent logs [n] [--no-follow]Prints the journal’s last n lines, 50 by default, then follows it unless you pass --no-follow.
kite-agent stop / kite-agent startStops or starts the agent. The host stays joined to its cluster.
kite-agent leaveStops and disables the agent, and removes the host’s enrollment.
kite-agent join optionEffectDefault
--cluster <wss-url>/connectThe cluster to join: a wss:// URL whose path ends in /connect. ws:// works only for a cluster on the same machine.none, required
--token <token>The bootstrap token.KITE_BOOTSTRAP_TOKEN
--name <node>The Kubernetes Node name.the host’s name
--machine, --driver, --host <name>Labels that record where the host came from, for the system that creates hosts.none
--register-with-taints <key=value:effect,...>Taints the node has when it first registers.none
--max-pods <n>How many pods the node accepts.the cluster’s default
--kube-reserved <cpu=100m,memory=256Mi>The CPU, memory or ephemeral storage that the node keeps out of its allocatable.the cluster’s default
--shutdown-grace-period, --shutdown-grace-period-critical-podsSee Machine shutdown.see that table
--network-endpoint, --network-public-endpoint, --network-port, --network-mtu, --network-key-fileSee WireGuard settings.see that table

To point a joined host at a new cluster address, run kite-agent join --cluster <wss-url>/connect --token <bootstrap-token> with a new token. The saved token is for the address the host joined, so the agent never sends it to another one. The agent keeps its other settings:

SettingKept when
--network-key-fileThe cluster address and the node name stay the same
NODE_EXTRA_CA_CERTS, NODE_TLS_REJECT_UNAUTHORIZEDThe cluster address stays the same
Every other settingAlways

For a new address that needs NODE_EXTRA_CA_CERTS or NODE_TLS_REJECT_UNAUTHORIZED, set them again in the join’s environment.

If a join fails, run kite-agent status to check whether the host can reach the cluster’s address, then read kite-agent logs.

Output for programs

-o json, or --output json, prints a command’s result as one JSON document on stdout. Progress and warnings stay on stderr. These commands print JSON: kite version, kite whoami, kite status, kite access, kite signing-key and kite local status. Another command refuses -o json with a usage error.

kite local status -o json
{
  "apiVersion": "cli.kiteplane.dev/v1alpha1",
  "control": {
    "address": null,
    "container": "exited",
    "image": "registry.bayview.dev/apps/kite/local-control:f66dc87a63a860e8431d009b66188d96e2fa1f5f",
    "release": "0.4248.0"
  },
  "exists": true,
  "kind": "LocalCluster",
  "kubeconfig": "/Users/you/.kite/local/kubeconfig",
  "name": "kite-local",
  "nodes": [{ "container": "exited", "name": "node-1", "ready": "Unknown" }]
}

With -o json, a failure prints an error document on stderr:

{
  "apiVersion": "cli.kiteplane.dev/v1alpha1",
  "error": {
    "code": "UsageError",
    "message": "kite node add does not print JSON yet. Run it without -o json."
  },
  "kind": "Error"
}

A change that removes or renames a field changes apiVersion.

Exit codeMeaningerror.code
0The command succeeded.
1The command failed.Failed
2The command line is wrong.UsageError
3A check failed before anything changed.CheckFailed
4You are not signed in, or not allowed.Unauthorized
5A wait ran out of time.TimedOut

Next