Skip to main content

Storage

Volume classes​

Volumes are created in volume classes, offered in the worker settings and, per worker, in its overrides; a volume is created on a worker that offers its class (see Workers). A class names the Kubernetes StorageClass behind it, whether volumes in it may grow, and whether several workspaces may mount one at once:

values.yaml
settings:
worker:
volume_classes:
- name: standard # what users choose; the first class is the default
title: Standard
storage_class: "" # empty: the cluster's default StorageClass
expandable: true
- name: fast
title: Fast SSD
storage_class: ceph-rbd-ssd
expandable: true
- name: bulk
title: Bulk HDD
storage_class: nfs-hdd
expandable: false
- name: shared
title: Shared
storage_class: nfs-client # must support ReadWriteMany
expandable: true
shared: true

Users pick a class when they create a volume or a workspace's home volume; leaving it out takes the first. Naming a class that is not offered fails with the code worker_unoffered. The default offers one class, standard, on the cluster's default StorageClass.

Removing a class later does not touch existing volumes in the cluster, but their claims can no longer be reconciled: they report failed until the class is offered again.

Volumes are PersistentVolumeClaims​

Every volume on a worker becomes a PersistentVolumeClaim named vol-<id> in the workspaces namespace, with the volume's size in MiB as its request and the class's StorageClass. A volume of a shared class is claimed ReadWriteMany and may be mounted by several workspaces of its team and worker at once; any other is ReadWriteOnce and mounted by one workspace at most, which the database holds. A volume keeps the access mode it was made with: marking a class shared later affects new volumes only, as Kubernetes cannot change a claim's.

Mark a class shared only if its StorageClass supports ReadWriteMany across nodes (NFS, CephFS, a cloud file service). A single-node development cluster's hostpath storage accepts the claim but proves nothing about the real thing.

A volume created without a worker has no claim until a workspace mounts it (phase unbound); its worker is then the workspace's, chosen in the same transaction. Placing a workspace takes the classes of such volumes into account.

Behaviour to expect​

  • Pending volumes. With a StorageClass that binds on first use (WaitForFirstConsumer), a volume stays pending until a workspace that mounts it is scheduled. This is normal.
  • Growing. Volumes only grow, and only in an expandable class; otherwise the request fails with volume_fixed_size. Mark a class expandable only if its StorageClass sets allowVolumeExpansion; if the cluster still rejects the change, the volume reports failed with the cluster's message.
  • Mounting. Kubernetes cannot add a volume to a running pod, so changing what a workspace mounts restarts it if it runs. A workspace's mounts are set as a whole (PUT /v1/workspaces/{id}/mounts), so that one change restarts it once. A mount may be read-only.
  • Upgrading. Mounts moved from volumes.workspace_id to the volume_mounts table, and a volume's worker may be empty. During the rolling upgrade to this release, replicas of the previous one see no mounts and fail on unplaced volumes until they are replaced.
  • Last use. Every volume records when a running workspace last mounted it (last_used_at, to about five minutes), the basis for archiving volumes nobody uses.
  • Deleting. Deleting a volume deletes its claim. What happens to the underlying data follows the reclaim policy of the StorageClass.
  • Permissions. storage:read lists and inspects every team's volumes; storage:maintain (held by operator) additionally allows operational lifecycle actions — archiving, restoring, cancelling archives, and deleting — without permitting cloning, sharing, resizing, creating, or mounting another team's volume. Full cross-team volume management requires storage:manage (held by admin).
  • Quota. Volume sizes count against the owner's storage_mb quota. See Quotas.

Object storage​

Some plugins keep files outside the database: the Canvas plugin keeps the course files of activities. They go to an S3-compatible object store such as AWS S3, MinIO, SeaweedFS or Ceph, set in the object_storage settings section:

settings:
object_storage:
endpoint: https://s3.eu-west-1.amazonaws.com
region: eu-west-1
bucket: idekube # it must exist
prefix: production/ # every key starts with it
access_key: ...
secret_key: ...
path_style: false # true for most MinIO, SeaweedFS and Ceph installs

Check the object store on the settings page, or POST /v1/object-storage/check, reaches the bucket with the settings it has now. Add a lifecycle rule to the bucket that aborts incomplete multipart uploads after a day: an upload cut short leaves its parts behind otherwise.

The credentials stay with the control plane. A workspace that needs an object gets a link to it, signed for a quarter of an hour, through its worker's agent; workspaces therefore reach the object store directly. When they reach it at another address than the control plane does, set that address as the worker's object_storage_endpoint.

Archives​

Volumes nobody uses for long hold storage on their workers. With an object store set, a volume is archived: what it holds moves to the object store, compressed, and its claim goes from its worker's cluster; it is restored when needed again, and is ready once what it held is back. People archive and restore their own volumes on the Volumes page; archive.after_days (0 by default, which archives none on its own) has the hourly job storage.archive_idle archive the volumes nobody mounted for that long, a few at a time. Their creators are told either way.

A volume is archived only while no workspace that runs, or is starting, mounts it; a workspace that mounts an archived volume does not start until it is restored or no longer mounted. A restore needs the quota the volume's size takes, and may target any online, accepting worker whose volume class of the same name matches the volume's sharing mode (or its current worker). Restoring to a different worker detaches any stopped workspaces on the previous worker and resets observed capacity; archived volumes can also outlive a removed worker and be restored to another compatible worker later.

The worker's leading agent runs a job, transfer-<volume>, with the sidecar's image, which mounts the claim, writes what it holds as a tar stream compressed with zstd in parts of 32 MiB, and writes a manifest last, so that an archive cut short is never read as whole; a restore reads it back into a new claim, never outside it. Like a workspace's fetches, the job asks the agent for where each object goes, with a token only it holds, and the control plane names it with a link signed for an hour: the store's credentials never reach the worker. The job runs as the sidecar's user: a file it cannot read fails the archive, which is then given up on, Stop archiving, and leaves the volume as it was. Archives are kept under archives/<volume>/<transfer>/ and removed once restored, or with their volume.

Archives are charged apart, per GiB they hold compressed (billing.prices.archive_gib), and counted against the team's archive_mb quota, 500 GiB by default, not against its storage. The volume's worker must run a release that does transfers (volume.transfer.v1).

Storage of the platform itself​

The bundled PostgreSQL, Valkey and Prometheus each use one PersistentVolumeClaim, sized and placed with postgresql.storage, valkey.storage and prometheus.storage (size and storageClass). PostgreSQL holds all desired state: back it up.