Skip to content

Commit d747a08

Browse files
acmoreclaude
andcommitted
docs: refactor quickstart and manifest for readability
Reorganize quickstart from flat bullet dump into logical sections (install, start, connect, sync, teardown). Replace manifest field reference bullet lists with tables for scannability and inline validation rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 12a0b53 commit d747a08

2 files changed

Lines changed: 182 additions & 195 deletions

File tree

docs/config-manifest.md

Lines changed: 93 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Config Manifest
22

3-
`okdev` is configured by a single manifest (default: `.okdev.yaml`).
3+
okdev is configured by a single YAML manifest (default: `.okdev.yaml`).
44

5-
## Top-Level
5+
## Skeleton
66

77
```yaml
88
apiVersion: okdev.io/v1alpha1
@@ -12,38 +12,37 @@ metadata:
1212
spec: {}
1313
```
1414
15-
## Field Reference
16-
17-
### `apiVersion` and `kind`
18-
1915
- `apiVersion`: must be `okdev.io/v1alpha1`
2016
- `kind`: must be `DevEnvironment`
17+
- `metadata.name` (`string`, required): logical project/environment name.
2118

22-
### `metadata`
19+
## `spec` Fields
2320

24-
- `metadata.name` (`string`, required): logical project/env name.
21+
| Field | Type | Default | Description |
22+
|-------|------|---------|-------------|
23+
| `namespace` | `string` | `default` | Kubernetes namespace |
24+
| `kubeContext` | `string` | — | Kubeconfig context for okdev commands |
25+
| `session` | `object` | — | Session naming and lifecycle policy |
26+
| `volumes` | `array` | — | Kubernetes volume definitions |
27+
| `sync` | `object` | — | File sync configuration |
28+
| `ports` | `array` | — | Port forwarding rules |
29+
| `ssh` | `object` | — | SSH and tmux settings |
30+
| `lifecycle` | `object` | — | Post-create and pre-stop hooks |
31+
| `sidecar` | `object` | — | Sidecar container image |
32+
| `podTemplate` | `object` | — | Full Kubernetes PodSpec overlay |
2533

26-
### `spec`
27-
28-
- `spec.namespace` (`string`, default: `default`)
29-
- `spec.kubeContext` (`string`, optional): kubeconfig context used by okdev commands.
30-
- `spec.session` (`object`)
31-
- `spec.volumes` (`array`, optional)
32-
- `spec.sync` (`object`)
33-
- `spec.ports` (`array`)
34-
- `spec.ssh` (`object`)
35-
- `spec.lifecycle` (`object`)
36-
- `spec.sidecar` (`object`)
37-
- `spec.podTemplate` (`object`)
34+
---
3835

3936
## `spec.session`
4037

41-
- `defaultNameTemplate` (`string`): template for inferred session name.
42-
- `ttlHours` (`int`, default from template): reserved for lifecycle policy.
43-
- `idleTimeoutMinutes` (`int`, default from template): reserved for lifecycle policy.
44-
- `shareable` (`bool`): marks intent for team sharing workflows.
38+
| Field | Type | Default | Description |
39+
|-------|------|---------|-------------|
40+
| `defaultNameTemplate` | `string` | — | Go template for inferred session name |
41+
| `ttlHours` | `int` | from template | Reserved for lifecycle policy |
42+
| `idleTimeoutMinutes` | `int` | from template | Reserved for lifecycle policy |
43+
| `shareable` | `bool` | — | Marks intent for team sharing workflows |
4544

46-
### Example
45+
**Validation:** `ttlHours >= 0`, `idleTimeoutMinutes >= 0`.
4746

4847
```yaml
4948
spec:
@@ -54,25 +53,19 @@ spec:
5453
shareable: true
5554
```
5655

57-
### Validation
58-
59-
- `ttlHours >= 0`
60-
- `idleTimeoutMinutes >= 0`
61-
62-
### Context Precedence
63-
64-
- `--context` CLI flag (highest)
65-
- `spec.kubeContext` from manifest
66-
- active kubeconfig current-context (default client behavior)
56+
---
6757

6858
## `spec.volumes`
6959

70-
`spec.volumes` uses native Kubernetes `corev1.Volume` schema.
60+
Uses native Kubernetes `corev1.Volume` schema. Define volume sources here and mount them via `spec.podTemplate.spec.containers[*].volumeMounts`.
61+
62+
### Workspace Behavior
7163

72-
- Define storage source with standard `VolumeSource` (for example `emptyDir`, `persistentVolumeClaim`, `ephemeral`, `configMap`, `secret`).
73-
- Mount points are defined with standard Kubernetes `volumeMounts` in `spec.podTemplate.spec.containers[*].volumeMounts`.
64+
- If no volume named `workspace` is provided, okdev injects `emptyDir: {}` automatically.
65+
- okdev ensures `workspace` is mounted on both the `dev` container and sidecar.
66+
- Mount path defaults to `/workspace`, or follows the `volumeMounts` entry for `workspace` in `podTemplate`.
7467

75-
### Example
68+
### PVC
7669

7770
```yaml
7871
spec:
@@ -95,11 +88,7 @@ spec:
9588
readOnly: true
9689
```
9790

98-
### More Examples
99-
100-
#### `emptyDir` Scratch Space
101-
102-
Useful for build caches, temporary outputs, or other pod-lifetime data.
91+
### emptyDir (Scratch Space)
10392

10493
```yaml
10594
spec:
@@ -115,9 +104,7 @@ spec:
115104
mountPath: /tmp/build-cache
116105
```
117106

118-
#### `configMap` and `secret` Mounts
119-
120-
Useful when the dev container needs checked-in config plus cluster-managed credentials.
107+
### configMap and secret
121108

122109
```yaml
123110
spec:
@@ -141,9 +128,9 @@ spec:
141128
readOnly: true
142129
```
143130

144-
#### `ephemeral` Per-Session Persistent Storage
131+
### Ephemeral (Per-Session PVC)
145132

146-
Useful when each okdev session should get its own PVC-backed storage that is created with the pod and removed with it.
133+
Created with the pod, removed when it's deleted.
147134

148135
```yaml
149136
spec:
@@ -165,21 +152,23 @@ spec:
165152
mountPath: /models
166153
```
167154

168-
### Workspace Behavior
169-
170-
- If a `workspace` volume is not provided, okdev injects a volume with `name: workspace` and `emptyDir: {}`.
171-
- okdev ensures `workspace` is mounted on the `dev` container and `okdev-sidecar`.
172-
- Workspace mount path defaults to `/workspace` (or follows `dev` container `volumeMounts` entry for `workspace` if provided in `podTemplate`).
155+
---
173156

174157
## `spec.sync`
175158

176-
- `engine` (`string`, required, currently only `syncthing`)
177-
- `paths` (`[]string`): mappings in `local:remote` format.
178-
- `exclude` (`[]string`): local ignore patterns.
179-
- `remoteExclude` (`[]string`): remote-only ignore patterns (written to remote `.stignore`).
180-
- `syncthing` (`object`): includes `version` (`string`, default: `v1.29.7`) for the local auto-installed Syncthing client, `autoInstall` (`bool`, default: `true`), and `image` (`string`, default: `ghcr.io/acmore/okdev:<okdev-version>` with `edge` fallback) for the sidecar runtime image.
159+
| Field | Type | Default | Description |
160+
|-------|------|---------|-------------|
161+
| `engine` | `string` | — | Sync engine (currently only `syncthing`) |
162+
| `paths` | `[]string` | — | Mappings in `local:remote` format (max 1 entry) |
163+
| `exclude` | `[]string` | — | Local ignore patterns |
164+
| `remoteExclude` | `[]string` | — | Remote-only ignore patterns (written to `.stignore`) |
165+
| `syncthing.version` | `string` | `v1.29.7` | Local Syncthing binary version |
166+
| `syncthing.autoInstall` | `bool` | `true` | Auto-install local Syncthing |
167+
| `syncthing.image` | `string` | `ghcr.io/acmore/okdev:<version>` | Sidecar image (fallback: `edge`) |
168+
169+
**Validation:** `engine` must be `syncthing`; each `paths[]` entry must be `local:remote`.
181170

182-
### Example
171+
The `syncthing.version` field controls the local binary on your machine. The Syncthing binary inside the sidecar comes from `spec.sidecar.image`.
183172

184173
```yaml
185174
spec:
@@ -198,26 +187,17 @@ spec:
198187
- ".cache/"
199188
```
200189

201-
### Validation
202-
203-
- `engine` must be `syncthing`
204-
- each `paths[]` entry must be `local:remote`
205-
- currently at most one `paths[]` entry
206-
207-
### Version Behavior
208-
209-
- `spec.sync.syncthing.version` controls the local Syncthing binary that `okdev` installs or reuses on your machine.
210-
- The Syncthing binary inside the pod sidecar comes from `spec.sidecar.image`, not from `spec.sync.syncthing.version`.
190+
---
211191

212192
## `spec.ports`
213193

214-
### Each Item
215-
216-
- `name` (`string`, optional)
217-
- `local` (`int`, required): local listening port
218-
- `remote` (`int`, required): remote target port in dev environment
194+
| Field | Type | Required | Description |
195+
|-------|------|----------|-------------|
196+
| `name` | `string` | no | Label for the port rule |
197+
| `local` | `int` | yes | Local listening port |
198+
| `remote` | `int` | yes | Remote target port |
219199

220-
### Example
200+
**Validation:** ports must be `1..65535`; `local` ports must be unique.
221201

222202
```yaml
223203
spec:
@@ -230,21 +210,20 @@ spec:
230210
remote: 6006
231211
```
232212

233-
### Validation
234-
235-
- `local` and `remote` must be `1..65535`
236-
- `local` ports must be unique
213+
---
237214

238215
## `spec.ssh`
239216

240-
- `user` (`string`, default: `root`)
241-
- `privateKeyPath` (`string`, optional)
242-
- `autoDetectPorts` (`bool`, default: `true`)
243-
- `persistentSession` (`bool`, default: `true`) enables tmux-backed interactive session mode
244-
- `keepAliveIntervalSeconds` (`int`, default: `10`)
245-
- `keepAliveTimeoutSeconds` (`int`, default: `10`)
217+
| Field | Type | Default | Description |
218+
|-------|------|---------|-------------|
219+
| `user` | `string` | `root` | SSH user |
220+
| `privateKeyPath` | `string` | — | Path to SSH private key |
221+
| `autoDetectPorts` | `bool` | `true` | Auto-detect listening ports in the container |
222+
| `persistentSession` | `bool` | `true` | Enable tmux-backed interactive sessions |
223+
| `keepAliveIntervalSeconds` | `int` | `10` | SSH keepalive interval |
224+
| `keepAliveTimeoutSeconds` | `int` | `10` | SSH keepalive timeout |
246225

247-
### Example
226+
**Validation:** both keepalive values must be `> 0`; timeout must be `>= interval`.
248227

249228
```yaml
250229
spec:
@@ -257,18 +236,14 @@ spec:
257236
keepAliveTimeoutSeconds: 90
258237
```
259238

260-
### Validation
261-
262-
- `keepAliveIntervalSeconds > 0`
263-
- `keepAliveTimeoutSeconds > 0`
264-
- `keepAliveTimeoutSeconds >= keepAliveIntervalSeconds`
239+
---
265240

266241
## `spec.lifecycle`
267242

268-
- `postCreate` (`string`, optional): command executed once after environment creation.
269-
- `preStop` (`string`, optional): command executed before pod termination.
270-
271-
### Example
243+
| Field | Type | Description |
244+
|-------|------|-------------|
245+
| `postCreate` | `string` | Command run once after environment creation |
246+
| `preStop` | `string` | Command run before pod termination |
272247

273248
```yaml
274249
spec:
@@ -277,32 +252,28 @@ spec:
277252
preStop: pkill -f my-dev-server || true
278253
```
279254

280-
## `spec.sidecar`
255+
---
281256

282-
- `image` (`string`, required)
257+
## `spec.sidecar`
283258

284-
### Example
259+
| Field | Type | Description |
260+
|-------|------|-------------|
261+
| `image` | `string` | Sidecar container image (use release-aligned tag) |
285262

286263
```yaml
287264
spec:
288265
sidecar:
289266
image: ghcr.io/acmore/okdev:v0.2.16
290267
```
291268

292-
### Recommended
293-
294-
- use release-aligned tag, for example `ghcr.io/acmore/okdev:v0.2.0`
269+
---
295270

296271
## `spec.podTemplate`
297272

298-
### Direct PodSpec Overlay
273+
Full Kubernetes PodSpec overlay. Use this for the dev container image, resources, env vars, scheduling, labels, and extra sidecars.
299274

300275
- `metadata.labels` (`map[string]string`, optional)
301-
- `spec` (`k8s PodSpec`, optional)
302-
303-
Use this to define the dev container image, resources, extra sidecars, env vars, and scheduling settings.
304-
305-
### Example
276+
- `spec` (Kubernetes `PodSpec`)
306277

307278
```yaml
308279
spec:
@@ -326,11 +297,13 @@ spec:
326297
nvidia.com/gpu: "1"
327298
```
328299

329-
## Examples
300+
---
301+
302+
## Full Examples
330303

331-
### Minimal -- Web app with defaults
304+
### Minimal Web App
332305

333-
The simplest useful manifest. Uses an ephemeral workspace (emptyDir), syncs the current directory, and forwards one port.
306+
The simplest useful manifest. Ephemeral workspace, one synced directory, one forwarded port.
334307

335308
```yaml
336309
apiVersion: okdev.io/v1alpha1
@@ -356,9 +329,9 @@ spec:
356329
command: ["sleep", "infinity"]
357330
```
358331

359-
### Persistent workspace with PVC
332+
### Persistent Workspace (PVC)
360333

361-
Workspace data survives pod restarts. Useful when `npm install` or `pip install` takes a long time and you don't want to redo it on every `okdev up`.
334+
Workspace survives pod restarts — no need to re-run `npm install` or `pip install` on every `okdev up`.
362335

363336
```yaml
364337
apiVersion: okdev.io/v1alpha1
@@ -402,7 +375,7 @@ spec:
402375

403376
### Python ML with GPU
404377

405-
Single GPU development with a persistent workspace and a dataset volume mounted read-only.
378+
Single GPU, persistent workspace, read-only dataset volume, auto-install dependencies on create.
406379

407380
```yaml
408381
apiVersion: okdev.io/v1alpha1
@@ -468,9 +441,9 @@ spec:
468441
nvidia.com/gpu: "1"
469442
```
470443

471-
### Multi-GPU LLM fine-tuning
444+
### Multi-GPU LLM Fine-Tuning
472445

473-
Multiple GPUs, large memory, team-shared session naming, and a longer keepalive for stable long-running connections.
446+
4x GPU, shared session naming, model cache volume, long keepalive for stable training connections.
474447

475448
```yaml
476449
apiVersion: okdev.io/v1alpha1
@@ -555,9 +528,9 @@ spec:
555528
effect: NoSchedule
556529
```
557530

558-
### Go microservice with no tmux
531+
### Go Microservice (No Tmux)
559532

560-
Lightweight setup for a Go service. Disables tmux for a plain SSH shell experience.
533+
Lightweight setup with tmux disabled for a plain SSH shell.
561534

562535
```yaml
563536
apiVersion: okdev.io/v1alpha1
@@ -595,9 +568,9 @@ spec:
595568
memory: 8Gi
596569
```
597570

598-
### Custom kube context and namespace
571+
### Custom Kube Context and Namespace
599572

600-
Explicit cluster targeting for multi-cluster setups. Useful when your kubeconfig has multiple contexts.
573+
Explicit cluster targeting for multi-cluster setups with node pool scheduling.
601574

602575
```yaml
603576
apiVersion: okdev.io/v1alpha1

0 commit comments

Comments
 (0)