KiteGitHub
Quickstart

Nodes

What a Kite node runs, how it connects to the control plane, what Ready means, and what happens when its disk fills or it disconnects.

A Kite node is a Linux host that runs containerd and the node agent, kite-agent, in place of kubelet, kube-proxy, the network add-on and CoreDNS. To join or remove one, see Manage nodes.

What the agent does

The agent runs the node’s pods through containerd and reports their state to the control plane. It sets up pod networking, Services and DNS and volumes. On the host, it manages the cni0 bridge, the kitewg0 WireGuard device and the nftables rules for Services.

Control connection

Each node keeps a WebSocket open to wss://<cluster-address>/connect. Pod assignments, status, logs, exec and port-forwarding all use this connection. The control plane never opens a connection to the host, so the host needs only outbound TCP 443 to the control plane. On the serverless control plane, the socket ends at a relay, which forwards the node’s messages to the writer. See Keep nodes connected through a restart. In a self-hosted Raft group, it ends at a follower, which relays them to the leader.

WhenSelf-hosted control planeServerless control plane
You send to an exec’s stdin, a port-forward or a sandbox’s socket faster than the pod readsYour client waits for the pod.The stream ends with an error once the pod is 16 MiB behind.
You read an exec’s output, a log or a port-forward more slowly than the pod writesThe pod’s writes block, as under a kubelet, and the stream stays open.A log read waits for you. An exec, a port-forward or a sandbox’s socket keeps sending, and the control plane holds the output until you read it.
An exec, an attach or a forwarded connection has no traffic for 4 hoursIt ends, as an exec does through the Kubernetes API server.The same.
You read none of a stream’s output for 4 hoursAny stream ends: an exec, an attach, a port-forward, a log read or a sandbox’s socket.A log read ends, up to a minute later. Your next read returns the output that had reached your connection, a message that says why the log stopped, and the end of the log.

Traffic is what you send, what the pod writes, and the output you read. You cannot change the 4 hours.

  • An idle exec ends with an error, so kubectl exec exits non-zero.
  • An idle forwarded connection closes as if the pod had closed it. The rest of your port-forward stays open.
  • A log follow stays open for as long as you read it, however long its pod writes nothing. So does a sandbox’s socket with no messages.

Pods calling the API

A pod reaches the API at the kubernetes Service, as in any cluster. The agent on the pod’s node answers on that address and forwards each request to the control plane with the pod’s own token. Its certificate comes from the cluster’s certificate authority, which every pod trusts through its ca.crt.

That authority is valid for ten years, and Kite does not renew or replace it. Kite renews each node’s own certificate.

Addresses and Ready

A Node’s InternalIP is the gateway of its cni0 bridge, not the host’s own address.

A node is Ready once it has set up all of these:

  • its pod network and WireGuard,
  • the Service rules and the NetworkPolicy rules,
  • the rules that bind each pod to its own addresses,
  • cluster DNS and the API address, and
  • a peer map that includes the node itself. The peer map is the control plane’s list of the cluster’s nodes and how to reach each one over WireGuard.

If nft refuses one of these rules, the node is not Ready, and its Ready condition shows the error from nft. Ready does not mean that every peer has finished a WireGuard handshake.

Capacity and allocatable

A Node’s status.capacity is the CPU and memory that its machine has. Its status.allocatable is what pods can request: the capacity minus 100m of CPU and 256Mi of memory. The node reserves that CPU and memory for the agent, containerd and the host’s own processes. The scheduler places a pod only on a node with enough allocatable CPU and memory left for the pod’s requests.

The node itself also rejects a pod that requests more CPU or memory than its allocatable, with OutOfcpu or OutOfmemory, as kubelet does. This check also applies to a pod that sets spec.nodeName and so skips the scheduler.

To reserve other amounts, see Reserve CPU and memory for the host.

Disk space

The agent frees space on the disk that containerd keeps images on, and reports when a disk runs low:

ThresholdWhat happens
The image disk is 85% fullThe agent removes images that no container on the node uses, the one a container used longest ago first.
The image disk is 80% fullThe agent stops removing images.
Less than 15% of the image disk is freeThe Node’s DiskPressure condition is True, and the control plane adds the taint node.kubernetes.io/disk-pressure:NoSchedule.
Less than 10% of the disk that holds pod volumes is freeThe same as for the image disk.
Five minutes after the disk has room againThe condition and the taint come off.

The agent checks every five minutes and after each pull. It never removes:

  • an image that a container runs or mounts, including a container that has exited
  • an image of a pod or sandbox assigned to the node
  • an image that containerd pins
  • an image pulled in the last two minutes

While the node has the taint:

  • The scheduler places a new pod on the node only if the pod tolerates the taint, as a DaemonSet’s pods do.
  • Kite evicts no pod for disk pressure, so the pods already on the node keep running.

These thresholds are kubelet’s defaults, and you cannot change them.

When a node disconnects

After the node disconnectsWhat happens
0 secondsThe node keeps running its pods from the last assignment that it received.
30 secondsThe Node reads NotReady, and the control plane adds the taint node.kubernetes.io/unreachable:NoExecute. A node that reconnects before this keeps its pods.
60 secondsThe control plane evicts each pod that sets no toleration for the taint, because such a pod gets a default toleration of 30 seconds. A Deployment then replaces the pod on another node.
30 minutes, by defaultA node pool deletes the machine, after the pool’s spec.disruption.unreachableTimeout. See Consolidation and expiry.

While it is disconnected, the node restarts a container that exits, runs its probes, and stops its pods if its host shuts down. A pod that you delete meanwhile runs until the node reconnects.

When the host shuts down or reboots, the agent holds the shutdown while it stops the node’s pods:

  1. The agent tells the control plane. The Node reads NotReady at once, with the reason NodeShuttingDown, and the scheduler places no new pod on it. Every pod on the node reads not ready, so its Services stop sending it traffic.
  2. Each pod runs its preStop hooks and gets SIGTERM, as a deleted pod does. Pods at system-cluster-critical priority or above stop after the others, in the last 10 seconds of the shutdown grace period of 30 seconds. A pod gets its own grace period or its share of that time, whichever is shorter.
  3. A stopped pod reads Failed, with the reason Terminated and the condition DisruptionTarget, so its controller replaces it on another node, and a Job’s podFailurePolicy can ignore the failure.
  4. Once no pod runs, or the grace period is over, the agent lets the shutdown go on. The control plane then treats the Node as disconnected at once, without the 30-second grace.

systemd-logind tells the agent about the shutdown. On a host without systemd-logind, a shutdown is a disconnect like any other. Machine shutdown says how to change the grace period.

The control plane taints the disconnected Nodes of a zone one at a time, as upstream Kubernetes does:

Disconnected Nodes in the zoneTaints
Fewer than 55%, or fewer than threeOne Node every 10 seconds
55% or more, in a zone of over 50One Node every 100 seconds
55% or more, in a zone of 50 or fewerNone
Every Node in every zoneNone, and the taint comes off each one

A zone is the Node’s topology.kubernetes.io/region and topology.kubernetes.io/zone labels. When no Node in the cluster is connected, the fault is most likely the control plane’s, so the control plane evicts no pod.

An evicted pod shows Terminating until you delete the Node. Deleting the Node deletes every pod left on it. A StatefulSet recreates its pod only after you delete the Node.

Next