Skip to main content

Operations

What a running twin survives, what it loses, and how to read the timing data the API returns. This page is the short version. The full treatment lives in the repository's failure model and operation timelines documents.

What survives a failure​

The cluster is the source of truth for everything KubeNDT keeps: each piece of state is a Kubernetes object, in the lab's namespace or, for the platform's own, in kubendt-system. The backend needs no volume, so a restart, a lost disk or a replacement on another machine loses none of it. The State page of the dashboard (GET /state) lists every object, per namespace or cluster-wide.

StateLives in
Topology (nodes, links, CRD-declared addresses)StatefulSets, Meshnet Topology objects, ConfigMaps, Secrets
Configuration applied to nodesthe pods themselves, plus the history below
Operation history (what replay uses)one kubendt-internal-history-<pod> ConfigMap per pod
Link attributes (shaping, mtu, kind, extra addresses)an annotation on the pod's Topology object
Graph layout (node positions, annotations)a ConfigMap in the namespace, kept in kubendt-system when the namespace is deleted keeping it
File manager filesone ConfigMap per file, a Secret when sensitive
Operation locka Lease in the namespace, renewed while the operation runs
Whether a pod carries its configurationthe kubendt/applied annotation on the pod, which a pod Kubernetes makes anew lacks
A pod being restarted or recovereda kubendt-internal-recovery-<pod> Lease in the namespace
Accounts, API tokens, session keySecrets in kubendt-system, one per account and per token
Platform settings saved from the portalthe kubendt-internal-settings ConfigMap in kubendt-system
Namespace owner and guestsannotations on the Namespace

In practice:

  • Backend restart or replacement. Nothing is lost. A lock left by a dead backend is a Lease that expires within a minute, and the next operation takes it over. A replacement on another machine needs only the kubeconfig, and users stay logged in: every backend of the cluster accepts the same signed session cookie.
  • Upgrading from 1.11 or older. Keep the backend-db and kubendt-files volumes for one start: the backend moves what they hold into the cluster and says so in its log, after which they can go.
  • Upgrading from 1.12. Nothing to do. The admin password becomes the admin account's, existing tokens are its, and a login without a username still signs in as it, so scripts keep working. Namespaces from before accounts have no owner and belong to the admins until one hands them over.
  • Upgrading a compose install from 1.13. The compose moved to deploy/compose/compose.yaml, under the project name kubendt. Stop the old file (docker compose -f docker-compose.prod.yml down) before starting the new one, and restart the backend to pick up a context added to the kubeconfig.
  • Lost owner password. Delete the Secret kubendt-user-admin in kubendt-system and restart the backend: it sets the password from KUBENDT_ADMIN_PASSWORD again, or generates one and prints it once in the container's log (kubectl logs or docker logs, never the Logs tab). The owner's API tokens stay, their sessions end. A plain restart never overrides the password the owner chose, since the variable only counts on a cluster with no owner.
  • Interrupted operation. A deploy that dies half way leaves its resources behind, and the next deploy is refused with 409. Clear the topology, which keeps the namespace's files and layout, and repeat it. A modify or restart that dies mid way is repaired by the heal pass of the next modify, or by a Restart of the affected pod.
  • Pod recreated by KubeNDT (the Restart action, a modify that restarts a neighbour, the heal pass). Handled: the link MTU and extra addresses are written back and its history is replayed. On the stock Meshnet the neighbours' operations on the recreated interfaces are re-applied too; KubeNDT Meshnet leaves the neighbours' interfaces alone, and a modify recreates few pods since the daemon wires links on running ones.
  • Pod recreated behind KubeNDT's back (kubectl delete pod, an eviction, a worker going down). Handled: the backend reads the lab pods every five seconds, and a Ready pod without the kubendt/applied stamp gets what a Restart does, its history replayed. Meanwhile a deploy, modify or clear of its namespace and a configure or Restart of that pod answer 409. The pod's events say what was put back. KUBENDT_RECOVERY=off turns it off.
  • Container restarted in place (a crash, an OOM kill). The kernel keeps addresses, routes and Linux bridges, so a plain host or Linux router is only stamped again. A node whose process held its configuration (FRR, Open vSwitch, a P4 switch, a VM) is recreated and recovered.
  • Recovery that keeps failing. After three attempts the pod is left with recovery: failed in the pod listing, a red dot on the graph and a RecoveryFailed event. A Restart tries again.
  • Worker down. Kubernetes does not recreate a StatefulSet's pods while the worker may still run them: they stay Terminating until it returns or is marked out of service, which is the administrator's call. Once recreated, they are recovered as above.
  • Meshnet not running. Deploys and modifies are refused with 412, see the Meshnet dependency.
  • The cluster's API not answering. The backend keeps serving the UI, which says so, and binds by itself once the API answers; /readyz reports checks.kubernetes: unreachable. Nothing is modified meanwhile.
  • Upgrading to 1.15. In-cluster installs apply the manifests again, since the ClusterRole gains rules (creating events, writing a Topology's status, reading the Meshnet CRD). Labs already running are adopted as they are, so a pod recreated before the upgrade still needs one Restart. Don't run an older backend next to a 1.15 one on the same cluster: it doesn't stamp its pods, and the newer one would recover them on top of what they have. Moving the cluster to KubeNDT Meshnet is a separate step, see Cluster setup.
  • Upgrading to 1.16. KubeNDT 1.16 pins KubeNDT Meshnet 1.1.0, which link kinds need: a cluster on 1.0.0 applies deploy/meshnet (or deploy/meshnet-k3s) of the new release again, and until then a topology that names a kind answers LINK_KIND_UNSUPPORTED. The daemons roll one node at a time and running labs keep their links. KubeNDT Meshnet's Prometheus metrics move from port 51112 to 21112, so a scrape has to follow.

The State page marks as orphan what no lab uses any more (a Topology or a history of a pod that is gone, a lock whose holder died, the layout of a deleted namespace), and only the platform's owner account (admin) removes one, with DELETE /state/{namespace}/{kind}/{name}. The backend's own log, from KUBENDT_LOG_LEVEL up (info by default, read-only requests at debug), is in the cluster page's Logs tab for admins.

What stays manual: a Restart of a pod whose recovery gave up, anything applied inside a pod by hand, and the internal state of the workloads themselves (routing tables learnt by protocols, sessions, database contents). There is no backend volume to back up: the state is in the cluster's etcd, so the cluster's own backup covers it.

Operation timelines​

Deploy, modify and restart responses carry a timeline block next to the human-readable took_time. It answers one question: of the time an operation took, how much was KubeNDT and how much was Kubernetes and the node images underneath.

"timeline": {
"request_started_at": "2026-09-20T12:47:47.120Z",
"backend_ms": {"prepare": 1180, "wait_ready": 5300, "replay": 40, "peer_replay": 1800, "mtu": 640, "total": 6760},
"pods": [
{
"pod": "r1-0",
"kubernetes": {
"created": "2026-09-20T12:47:51Z",
"scheduled": "2026-09-20T12:47:51Z",
"sandbox_ready": "2026-09-20T12:47:52Z",
"container_started": "2026-09-20T12:47:52Z",
"ready": "2026-09-20T12:47:53Z"
},
"observed_ms": {"delete_issued": 1180, "old_pod_gone": 4210, "ready_seen": 6480}
}
]
}

Two clocks, two resolutions:

  • kubernetes.* are copied from the Pod object exactly as Kubernetes wrote them, at 1 s resolution. They are the same values kubectl get pod -o yaml shows: the backend does not time these phases, it reports what Kubernetes recorded. sandbox_ready needs Kubernetes 1.29 or newer.
  • observed_ms are milliseconds since request_started_at on the backend clock, marking when its pod watch saw each transition. A step that had already happened when the watch started is omitted rather than stamped with a wrong time.

backend_ms lists the backend's own phases, and which ones appear depends on the operation: validation and resource_creation on a deploy, prepare on a modify or restart, then wait_ready, replay (the recreated pods' own history), peer_replay (the re-application on their neighbours), heal, mtu (the link pass that writes the MTU and the extra addresses after every wiring) and total. On KubeNDT Meshnet, peer_replay is zero on a restart, since the neighbours keep their interfaces, heal is mostly the wait for the daemon to report the links, and mtu writes the declarations to the Topologies for the daemon to apply.

Pods progress in parallel, so total is a critical path, not the sum of the per-pod phases, and the backend phases do not add up to it either. Treat the block as timestamps to reason about, not as a stacked bar to sum. Ready also means something different per node type: the container running for a plain node (or its own readiness command passing, when it declares one), the guest's HTTP API answering for VyOS and the switch reporting operational for EXOS, its daemons answering for FRR, ovsdb-server up for Open vSwitch, the OpenFlow port listening for Faucet and the Thrift port for a P4 switch. Compare readiness figures with that in mind.