Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2c623f9
default workload clusters to Kubernetes 1.37 and add the EKS Pod
maciaszczykm Nov 20, 2026
fa8c205
default management clusters to Kubernetes 1.37
maciaszczykm Nov 23, 2026
2c42de5
add the devbox node pool, snapshot storage and identities to management
maciaszczykm Nov 23, 2026
5e74c21
install Agent Substrate and a DevboxRunner on the management cluster
maciaszczykm Nov 23, 2026
982098a
resolve leftover conflict markers in disk-prep
maciaszczykm Nov 23, 2026
898b459
Merge main (Traefik #198) into prod-5488 devbox defaults
maciaszczykm Nov 24, 2026
51f4fac
keep one warm devbox worker
maciaszczykm Nov 24, 2026
2ba5bdc
pin cluster-autoscaler chart 9.60.0 on the management cluster
maciaszczykm Nov 24, 2026
f9fda13
allow node-to-node HTTPS on the management cluster
maciaszczykm Nov 24, 2026
1433456
let the snapshot buckets be destroyed with the cluster
maciaszczykm Nov 25, 2026
4df0c57
leave diskModel out off AWS
maciaszczykm Nov 25, 2026
d47ee3c
let disk prep run on GKE
maciaszczykm Nov 25, 2026
c2a31b2
use the published Azure Blob plugin image
maciaszczykm Nov 26, 2026
0649476
don't set the disk startup taint on AKS
maciaszczykm Nov 26, 2026
a6afcab
use ZeroFS for devbox homes
maciaszczykm Nov 27, 2026
c0d5735
devbox: Karpenter with nested virtualization on AWS, per-zone AKS poo…
michaeljguarino Nov 28, 2026
2663161
devbox: node auto-provisioning on Azure, NodeOverlay for KVM on AWS
michaeljguarino Nov 28, 2026
74d8891
aws: authenticate through EKS access entries, not aws-auth
michaeljguarino Nov 28, 2026
c2d953e
devbox: install agent-substrate chart 0.1.1 (images at deployment-ope…
michaeljguarino Nov 30, 2026
4a427cf
use the 0.6.77 devbox-block and disk prep images
maciaszczykm Nov 30, 2026
88f46d8
keep one devbox node so the operator finds the pool's zone
maciaszczykm Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ There are three main resources created by these templates:
* K8s Control Plane + minimal worker node set
* Postgres DB (will be used for your Plural Console instance)

On AWS, GCP and Azure it also sets up devboxes, Plural's sandboxed coding-agent environments, on the management cluster:

* `terraform/mgmt/cluster/devbox.tf`: a node pool for the sandboxes, which keeps one node running and grows with demand, a bucket for their snapshots, and workload identities to reach it. On AWS the pool is a [Karpenter](https://karpenter.sh) `NodePool` with nested virtualization on (`services/devbox/karpenter.yaml.liquid`), and this file holds Karpenter's IAM, the node role's access entry and the interruption queue. A `NodeOverlay` beside the `NodePool` tells Karpenter its nodes will have `ate.dev/kvm`, which microvm workers request but atelet only advertises once a node runs; it needs the `nodeOverlay` feature gate the Karpenter values turn on. On Azure it's a `NodePool` for AKS's [node auto-provisioning](https://learn.microsoft.com/en-us/azure/aks/node-auto-provisioning) (managed Karpenter), which this file turns on. It runs beside the autoscaled `blue` and `green` pools through the subscription's `AllowClusterAutoscalerAndNAP` feature, which this file registers, so the first apply needs an identity allowed to register features (e.g. subscription Owner or Contributor). Both clouds launch each node in the zone its sandbox's home disk is in, which the cluster autoscaler can't do for a pool spanning zones
* `bootstrap/devbox`: [Agent Substrate](https://github.com/agent-substrate/substrate), the sandbox runtime, Karpenter on AWS, the devbox `NodePool` on AWS and Azure, and a `devbox` DevboxRunner (`services/devbox`)

Each devbox's `/home/dev` is its own cloud disk (EBS, Persistent Disk or Azure managed disk) from Agent Substrate's block driver, DevboxRunners' default home storage. It needs the cloud's disk CSI driver and the VolumeSnapshot API, which the cluster stacks turn on: the `aws-ebs-csi-driver` and `snapshot-controller` EKS add-ons, GKE's Persistent Disk CSI driver, and AKS's disk driver and snapshot controller.

To leave them out, set `devbox_enabled = false` on the `mgmt` module and delete `bootstrap/devbox`.

Our defaults are meant to be tweaked, feel free to reference the documentation of the underlying modules if you want to make a cluster private, or modify our CIDR range defaults if you want to VPC peer.


Expand Down
72 changes: 72 additions & 0 deletions helm/agent-substrate.yaml.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Agent Substrate on the management cluster. Values reference:
# https://github.com/pluralsh/console/blob/master/charts/agent-substrate/values.yaml

# Wires Substrate to the deployment operator's devbox-gateway in plrl-deploy-operator and makes the operator's
# ServiceAccount a bootstrap owner, so it can create atespaces.
devboxes:
enabled: true

otel:
endpoint: ""

# Substrate keeps its state in a CloudNativePG cluster in ate-system, with the operator bundled.
cloudnative-pg:
enabled: true

# Substrate workers only run on the devbox pool, so atelet only needs to run there too. It doesn't tolerate the
# plural.sh/devbox-disk startup taint, so it waits for devbox-disk-prep.
atelet:
nodeSelector:
plural.sh/devbox-pool: devbox

# Devbox homes (spec.home.storage: Block) are one cloud disk each from the cluster's own disk CSI
# driver, seeded and moved between zones through VolumeSnapshots, which the mgmt stack makes sure the cluster serves.
# The operator runs a WorkerPool per zone of the devbox nodes and keeps each devbox in its disk's zone.
block:
enabled: true
{% if configuration.cloud == 'aws' %}
provider: ebs.csi.aws.com
parameters:
type: gp3
{% elsif configuration.cloud == 'gcp' %}
provider: pd.csi.storage.gke.io
parameters:
type: pd-balanced
{% elsif configuration.cloud == 'azure' %}
provider: disk.csi.azure.com
parameters:
skuName: Premium_LRS
{% endif %}

{% if configuration.cloud == 'aws' %}
# ate-api-server and atelet reach S3 through EKS Pod Identity associations made by the mgmt stack.
objectStore:
backend: s3
snapshotLocation: {{ imports["mgmt"].devbox_snapshot_location }}
s3:
region: {{ configuration.region }}
{% elsif configuration.cloud == 'gcp' %}
apiServer:
snapshotTransferServiceAccount: {{ imports["mgmt"].devbox_transfer_service_account }}
serviceAccount:
annotations:
iam.gke.io/gcp-service-account: {{ imports["mgmt"].devbox_api_server_service_account }}

objectStore:
backend: gcs
snapshotLocation: {{ imports["mgmt"].devbox_snapshot_location }}
{% elsif configuration.cloud == 'azure' %}
objectStore:
backend: azureBlob
snapshotLocation: {{ imports["mgmt"].devbox_snapshot_location }}
azureBlob:
image:
# built from agent-substrate-plugins/objectstore-azure-blob d960af4 by console's objectstore-azure-blob workflow
tag: sha-d960af4
accountUrl: {{ imports["mgmt"].devbox_account_url }}
containers:
- snapshots
tenantId: {{ imports["mgmt"].devbox_tenant_id }}
nodeClientId: {{ imports["mgmt"].devbox_node_client_id }}
controlClientId: {{ imports["mgmt"].devbox_control_client_id }}
{% endif %}
23 changes: 23 additions & 0 deletions helm/karpenter.yaml.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Karpenter on the management cluster, which runs the devbox node pool. Values reference:
# https://github.com/aws/karpenter-provider-aws/blob/main/charts/karpenter/values.yaml
replicas: 2

settings:
clusterName: {{ imports["mgmt"].cluster_name }}
clusterEndpoint: {{ imports["mgmt"].cluster_endpoint }}
interruptionQueue: {{ imports["mgmt"].devbox_karpenter_queue }}
featureGates:
# The devbox pool's NodeOverlay tells Karpenter its nodes will have ate.dev/kvm.
nodeOverlay: true

# the mgmt stack's Pod Identity association grants this ServiceAccount the controller's role
serviceAccount:
name: karpenter

controller:
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
memory: 1Gi
51 changes: 51 additions & 0 deletions services/devbox/devbox-runner.yaml.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# The default devbox. One worker always runs, since building the devbox template needs one, and the pool grows
# with demand. Add SCM connections, repositories, egress rules or cloud identities here.
# Reference: https://github.com/pluralsh/console/blob/master/go/deployment-operator/docs/api.md#devboxrunner
apiVersion: deployments.plural.sh/v1alpha1
kind: DevboxRunner
metadata:
name: devbox
spec:
agents:
- type: claude
default: true
- type: codex
- type: opencode
- type: gemini
- type: pi
scmConnections:
- plural
autonomy:
default: manual
max: full
browser:
enabled: true
# each devbox's /home/dev is its own cloud disk from agent-substrate's block driver, in one zone
home:
storage: Block
resources:
cpu: "2"
memory: 4Gi
disk: 20Gi
workerPool:
autoscaling:
minReplicas: 1
maxReplicas: {{ configuration.maxWorkers }}
spareInstances: 1
diskSize: {{ configuration.diskSize }}
sandboxClass: gvisor
nodeSelector:
plural.sh/devbox-pool: {{ configuration.pool }}
tolerations:
# lets the cluster autoscaler size the pool from its template; atelet still waits for the disk
- key: plural.sh/devbox-disk
operator: Exists
effect: NoSchedule
{% if configuration.cloud == 'aws' or configuration.cloud == 'azure' %}
# keeps Karpenter from draining a node out from under running sandboxes
podAnnotations:
karpenter.sh/do-not-disrupt: "true"
{% endif %}
resources:
requests: {cpu: "{{ configuration.workerCpu }}", memory: {{ configuration.workerMemory }}}
limits: {cpu: "{{ configuration.workerCpu }}", memory: {{ configuration.workerMemory }}}
119 changes: 119 additions & 0 deletions services/devbox/disk-prep.yaml.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
apiVersion: v1
kind: Namespace
metadata:
name: devbox-nodes
---
# GKE only admits node- and cluster-critical pods outside kube-system in a namespace with a quota for them
apiVersion: v1
kind: ResourceQuota
metadata:
name: disk-prep-critical-pods
namespace: devbox-nodes
spec:
hard:
pods: 1G
scopeSelector:
matchExpressions:
- operator: In
scopeName: PriorityClass
values:
- system-node-critical
- system-cluster-critical
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: devbox-disk-prep
namespace: devbox-nodes
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: devbox-disk-prep
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "update"]
# restarts pods on the node that started before /var/lib/ate was mounted
- apiGroups: [""]
resources: ["pods"]
verbs: ["list", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: devbox-disk-prep
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: devbox-disk-prep
subjects:
- kind: ServiceAccount
name: devbox-disk-prep
namespace: devbox-nodes
---
# devbox-disk-prep ships in the agent-harness base image. On a node's first boot it formats the disks whose model
# matches DISK_MODEL (RAID0 when there are several) as XFS, mounts them at /var/lib/ate and lifts the
# plural.sh/devbox-disk startup taint. Afterwards it only reassembles and remounts.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: devbox-disk-prep
namespace: devbox-nodes
spec:
selector:
matchLabels:
app.kubernetes.io/name: devbox-disk-prep
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
template:
metadata:
labels:
app.kubernetes.io/name: devbox-disk-prep
spec:
serviceAccountName: devbox-disk-prep
priorityClassName: system-node-critical
nodeSelector:
plural.sh/devbox-pool: {{ configuration.pool }}
tolerations:
- operator: Exists
containers:
- name: disk-prep
image: {{ configuration.diskPrepImage }}
command: ["/devbox-disk-prep"]
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: DISK_MODEL
value: "{{ configuration.diskModel }}"
securityContext:
privileged: true
runAsUser: 0
runAsGroup: 0
readinessProbe:
exec:
command: ["test", "-f", "/tmp/ready"]
periodSeconds: 10
resources:
requests:
cpu: 10m
memory: 32Mi
limits:
memory: 128Mi
volumeMounts:
- name: host
mountPath: /host
mountPropagation: Bidirectional
- name: dev
mountPath: /dev
volumes:
- name: host
hostPath:
path: /
- name: dev
hostPath:
path: /dev
Loading