Skip to content

Commit 502ef00

Browse files
authored
πŸ€– fix: refresh docs accuracy and structure (#71)
## Summary This PR refreshes the user-facing docs and README for accuracy, structure, and learnability. It updates outdated architecture/troubleshooting guidance, improves getting-started and deployment how-tos, and fixes the control-plane sample manifest used in docs and CI smoke flows. ## Background Recent documentation drift left several pages out of date with current runtime behavior (`--app=all` default mode, expanded app modes, codersdk-backed aggregated storage, and current Kubernetes resource names). The README also needed a clearer project narrative and more consistent onboarding flow. ## Implementation - Reworked `README.md` into a structured project entrypoint with badges, capability summary, app-mode matrix, docs links, commands, repo layout, and contributing checks. - Rewrote `docs/explanation/architecture.md`: - documents all app modes (`all`, `controller`, `aggregated-apiserver`, `mcp-http`) - corrects `--app` default behavior - describes controller, aggregated API, and MCP subsystems - replaces outdated in-memory storage claim with codersdk-backed architecture - adds mermaid diagrams for process and request flow - Rewrote `docs/how-to/troubleshooting.md` with correct resource names and current failure modes. - Improved `docs/index.md` with clearer orientation, links, and quick commands. - Expanded `docs/tutorials/getting-started.md` with improved flow, verification, and cleanup. - Updated deployment guides: - `docs/how-to/deploy-controller.md` now explicitly covers controller-only mode - `docs/how-to/deploy-aggregated-apiserver.md` now distinguishes all-in-one vs standalone mode and required standalone settings - Fixed `config/samples/coder_v1alpha1_codercontrolplane.yaml`: - image changed to `ghcr.io/coder/coder:latest` - `licenseSecretRef` made optional/commented ## Validation - `make verify-vendor` - `make test` - `make build` - `make lint` - `make docs-check` ## Risks - **Low to moderate:** This is primarily documentation and sample-manifest scope, but command correctness and deployment semantics changed in text. Main residual risk is user confusion if they rely on stale external copies of old docs; in-repo docs now reflect current code behavior. --- _Generated with `mux` β€’ Model: `openai:gpt-5.3-codex` β€’ Thinking: `xhigh` β€’ Cost: `$2.88`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=2.88 -->
1 parent 7054680 commit 502ef00

9 files changed

Lines changed: 420 additions & 208 deletions

File tree

β€Ž.cspell.jsonβ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
"version": "0.2",
33
"language": "en",
44
"words": [
5+
"allapp",
56
"DiΓ‘taxis",
67
"GOFLAGS",
78
"Millis",
89
"apiregistration",
910
"apiserverapp",
1011
"apiserver",
1112
"apiservice",
13+
"apisvc",
1214
"clusterrole",
1315
"clusterrolebinding",
1416
"coder-k8s",
1517
"codercontrolplane",
1618
"codercontrolplanes",
1719
"coderd",
20+
"codersdk",
1821
"codertemplate",
1922
"codertemplates",
2023
"coderworkspace",
@@ -28,15 +31,19 @@
2831
"workspaceproxy",
2932
"workspaceproxies",
3033
"derp",
34+
"crds",
3135
"devshell",
36+
"healthz",
3237
"gofumpt",
3338
"javascripts",
3439
"kubeconfig",
3540
"kubebuilder",
3641
"corev",
3742
"metav",
43+
"mcpapp",
3844
"mkdocs",
3945
"pymdownx",
46+
"readyz",
4047
"superfences"
4148
],
4249
"ignorePaths": [

β€ŽREADME.mdβ€Ž

Lines changed: 80 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,136 @@
11
# coder-k8s
22

3+
[![CI](https://github.com/coder/coder-k8s/actions/workflows/ci.yaml/badge.svg)](https://github.com/coder/coder-k8s/actions/workflows/ci.yaml)
4+
[![Go](https://img.shields.io/badge/go-1.25%2B-00ADD8?logo=go)](./go.mod)
5+
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](./LICENSE)
6+
37
> [!WARNING]
48
> **Highly Experimental / Alpha Software**
59
> This repository is a **hackathon contribution** and remains a **highly experimental, alpha-stage** project.
610
> **Do not use this in production or expose it to end users.**
7-
>
8-
## Project description
911
10-
`coder-k8s` is a Go-based Kubernetes control-plane project with two app modes:
12+
`coder-k8s` is a Kubernetes control-plane project for managing Coder-related resources with native Kubernetes APIs.
13+
14+
## What this project provides
15+
16+
- A controller-runtime operator for `coder.com/v1alpha1` resources:
17+
- `CoderControlPlane`
18+
- `CoderProvisioner`
19+
- `CoderWorkspaceProxy`
20+
- An aggregated API server for `aggregation.coder.com/v1alpha1` resources:
21+
- `CoderWorkspace`
22+
- `CoderTemplate`
23+
- An MCP HTTP server for operational tooling.
24+
- A single binary that can run in all-in-one mode or split app modes.
1125

12-
- A `controller-runtime` operator for managing `CoderControlPlane` and
13-
`CoderWorkspaceProxy` resources (`coder.com/v1alpha1`).
14-
- An aggregated API server for `CoderWorkspace` and `CoderTemplate` resources
15-
(`aggregation.coder.com/v1alpha1`).
26+
## Application modes
27+
28+
| Mode | Description | Typical usage |
29+
| --- | --- | --- |
30+
| `all` (default) | Runs controller + aggregated API + MCP HTTP together | Local dev, demos, simple cluster deployment |
31+
| `controller` | Runs only Kubernetes reconcilers | Controller-focused debugging and e2e smoke flows |
32+
| `aggregated-apiserver` | Runs only aggregated API server | Split deployments with explicit Coder backend flags |
33+
| `mcp-http` | Runs only MCP HTTP server | MCP-focused integrations |
1634

1735
## Prerequisites
1836

1937
- Go 1.25+ (`go.mod` currently declares Go 1.25.7)
20-
- A Kubernetes cluster (OrbStack is recommended for local development; any cluster works)
21-
- `kubectl` configured to point at your cluster context
38+
- A Kubernetes cluster (OrbStack, KIND, or any conformant cluster)
39+
- `kubectl` configured for your target cluster
2240

23-
## Quick start / Local development (OrbStack)
41+
## Quick start (local controller run)
2442

2543
```bash
26-
# Generate CRD and RBAC manifests
44+
# Generate and apply CRDs
2745
make manifests
28-
29-
# Apply CRDs to your cluster
3046
kubectl apply -f config/crd/bases/
3147

32-
# Run the controller locally (uses your kubeconfig context)
48+
# Run controller locally against your kubeconfig context
3349
GOFLAGS=-mod=vendor go run . --app=controller
3450

35-
# In another terminal: apply the sample CR
51+
# In another terminal, apply a sample control plane
3652
kubectl apply -f config/samples/coder_v1alpha1_codercontrolplane.yaml
3753

38-
# Verify
54+
# Verify resource creation
3955
kubectl get codercontrolplanes -A
4056
```
4157

42-
## Examples
43-
44-
- [`examples/cloudnativepg/`](examples/cloudnativepg/) - Deploy a `CoderControlPlane` with a CloudNativePG-managed PostgreSQL backend.
45-
46-
## KIND development cluster (for k9s demos)
47-
48-
Bootstrap a KIND cluster and install CRDs/RBAC (**this also switches your current kubectl context**):
58+
## Documentation
4959

50-
```bash
51-
make kind-dev-up
52-
```
60+
The project docs follow DiΓ‘taxis and live in `docs/`.
5361

54-
> Tip: override defaults when needed:
55-
>
56-
> - Use `CLUSTER_NAME` to run multiple clusters in parallel.
57-
> - Use `KIND_NODE_IMAGE` to pin the node image (default: `kindest/node:v1.34.0`).
58-
>
59-
> ```bash
60-
> CLUSTER_NAME=my-cluster make kind-dev-up
61-
> KIND_NODE_IMAGE=kindest/node:v1.32.0 make kind-dev-up
62-
> ```
62+
- Home: [`docs/index.md`](docs/index.md)
63+
- Tutorial: [`docs/tutorials/getting-started.md`](docs/tutorials/getting-started.md)
64+
- How-to guides: [`docs/how-to/`](docs/how-to/)
65+
- Architecture: [`docs/explanation/architecture.md`](docs/explanation/architecture.md)
66+
- API reference: [`docs/reference/api/`](docs/reference/api/)
6367

64-
> If the cluster already exists and you change `KIND_NODE_IMAGE`, run `make kind-dev-down` first so the new image can be applied.
65-
>
66-
If you need to switch your kubectl context later:
68+
Serve docs locally:
6769

6870
```bash
69-
make kind-dev-ctx
70-
# or: CLUSTER_NAME=my-cluster make kind-dev-ctx
71+
make docs-serve
7172
```
7273

73-
Start the controller (pick one):
74-
75-
- Out-of-cluster (fast iteration):
76-
77-
```bash
78-
GOFLAGS=-mod=vendor go run . --app=controller
79-
```
74+
## Examples
8075

81-
- In-cluster (closer to CI):
76+
- [`examples/cloudnativepg/`](examples/cloudnativepg/) β€” Deploy a `CoderControlPlane` with a CloudNativePG-managed PostgreSQL backend.
8277

83-
```bash
84-
make kind-dev-load-image
85-
kubectl apply -f config/e2e/deployment.yaml
86-
kubectl -n coder-system wait --for=condition=Available deploy/coder-k8s --timeout=120s
87-
```
78+
## KIND development cluster (k9s demos)
8879

89-
Demo:
80+
Bootstrap a KIND cluster and install CRDs/RBAC (**this switches current kubectl context**):
9081

9182
```bash
92-
make kind-dev-k9s
83+
make kind-dev-up
9384
```
9485

95-
Cleanup:
86+
Useful helpers:
9687

9788
```bash
89+
make kind-dev-status
90+
make kind-dev-ctx
91+
make kind-dev-load-image
92+
make kind-dev-k9s
9893
make kind-dev-down
9994
```
10095

101-
Mux users: there is an optional agent skill (`kind-dev`) under `.mux/skills/` with agent-oriented instructions for running per-workspace KIND clusters.
102-
10396
## Essential commands
10497

10598
| Command | Description |
10699
| --- | --- |
107-
| `make build` | Build the project |
108-
| `make test` | Run tests |
109-
| `make manifests` | Generate CRD/RBAC manifests |
110-
| `make codegen` | Run deepcopy code generation |
111-
| `make verify-vendor` | Verify vendor consistency |
112-
| `make lint` | Run linter (requires `golangci-lint`) |
113-
| `make vuln` | Run vulnerability check (requires `govulncheck`) |
114-
| `make docs-serve` | Serve the documentation site locally (requires `mkdocs`) |
100+
| `make build` | Build all packages |
101+
| `make test` | Run unit + integration tests |
102+
| `make test-integration` | Run focused controller integration tests |
103+
| `make manifests` | Generate CRD and RBAC manifests |
104+
| `make codegen` | Run deepcopy generation |
105+
| `make docs-reference` | Regenerate API reference docs from Go types |
115106
| `make docs-check` | Build docs in strict mode (CI-equivalent) |
107+
| `make verify-vendor` | Verify vendored dependency consistency |
108+
| `make lint` | Run linter + formatting checks |
109+
| `make vuln` | Run vulnerability scan |
116110

117-
## Testing strategy
111+
## Repository layout
118112

119-
- **Unit tests**: `make test` runs all tests, including unit tests in `main_test.go`.
120-
- **Integration tests**: Use `envtest` to exercise reconciliation against a lightweight API server (no real cluster needed). Run them via `make test` (included in the full suite) or `make test-integration` (focused on controller tests only).
121-
- **E2E smoke tests**: Recommended CI smoke coverage uses a Kind-based flow that deploys the controller image and verifies pod health.
113+
- `api/v1alpha1/` β€” CRD API types (`coder.com/v1alpha1`)
114+
- `api/aggregation/v1alpha1/` β€” aggregated API types (`aggregation.coder.com/v1alpha1`)
115+
- `internal/app/` β€” app mode entrypoints (`allapp`, `controllerapp`, `apiserverapp`, `mcpapp`)
116+
- `internal/controller/` β€” controller reconcilers
117+
- `internal/aggregated/` β€” aggregated storage + Coder client/provider logic
118+
- `config/` β€” generated CRDs, RBAC, samples
119+
- `deploy/` β€” deployable manifests for all-in-one, APIService, and MCP service
120+
- `docs/` β€” user-facing documentation site content
121+
- `hack/` β€” code generation and maintenance scripts
122122

123-
## Project structure
123+
## Contributing
124124

125-
- `api/v1alpha1/` β€” CRD types and generated deepcopy code
126-
- `internal/controller/` β€” Reconciliation logic
127-
- `config/crd/bases/` β€” Generated CRD manifests
128-
- `config/rbac/` β€” RBAC manifests (generated role + deployment bindings)
129-
- `config/samples/` β€” Sample custom resources
130-
- `hack/` β€” Code generation and maintenance scripts
125+
Before opening a PR, run at least:
126+
127+
```bash
128+
make verify-vendor
129+
make test
130+
make build
131+
make lint
132+
make docs-check
133+
```
131134

132135
## License
133136

β€Žconfig/samples/coder_v1alpha1_codercontrolplane.yamlβ€Ž

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ metadata:
44
name: codercontrolplane-sample
55
namespace: default
66
spec:
7-
image: "ghcr.io/coder/coder-k8s:main"
8-
licenseSecretRef:
9-
name: coder-license
10-
key: license
7+
image: "ghcr.io/coder/coder:latest"
8+
# Optional Enterprise license upload:
9+
# licenseSecretRef:
10+
# name: coder-license
11+
# key: license

0 commit comments

Comments
Β (0)