Skip to content

Commit 3608eab

Browse files
authored
🤖 refactor: refocus docs for product deployment flow (#78)
## Summary Refocused repository docs from contributor-centric setup toward product/operator usage, added a dedicated External Provisioner tutorial, and standardized tutorial/sample namespace usage on `coder` (never `default`). ## Background The existing README/tutorial flow mixed end-user docs with contributor workflows and repeated setup steps across tutorials, which increased drift risk. This PR separates contributor guidance, simplifies tutorial progression, and updates examples for clearer terminology and safer defaults. ## Implementation - Reworked `README.md` to be end-user focused and link to hosted docs. - Added `CONTRIBUTING.md` and moved local-dev/contributor workflows there. - Updated docs landing/tutorial framing: - Product-focused `docs/index.md` - `Deploy a Coder Control Plane` - `Deploy an External Provisioner` as a follow-on tutorial - Switched tutorial commands to raw GitHub manifest URLs for copy/paste usability. - Renamed `examples/aggregated` to `examples/coder-templates` and updated references. - Standardized tutorial and sample resource namespace to `coder`: - `config/samples/coder_v1alpha1_codercontrolplane.yaml` - `config/samples/coder_v1alpha1_coderprovisioner.yaml` - `config/samples/coder_v1alpha1_coderworkspaceproxy.yaml` - Updated non-generated docs/sample content to assume operator-managed provisioner flow and removed user-facing `credentialsSecretRef` usage from the sample/tutorials in this branch context. ## Validation - `make verify-vendor` - `make test` - `make build` - `make lint` - `make docs-check` *(fails by design when `mkdocs.yml` changes because `docs-reference-check` asserts no `mkdocs.yml` diff)* - `mkdocs build --strict` - Raw URL download checks for tutorial-referenced manifest links (curl verification) ## Risks Low to medium. Changes are mostly docs/samples, but sample behavior assumptions were updated to match the intended API direction in this workstream. Generated API reference docs are intentionally left for the API-removal PR that updates types/CRDs. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.00`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.00 -->
1 parent 06a0da3 commit 3608eab

11 files changed

Lines changed: 281 additions & 175 deletions

‎CONTRIBUTING.md‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributing to coder-k8s
2+
3+
Thanks for contributing to `coder-k8s`.
4+
5+
> [!NOTE]
6+
> The root [`README.md`](./README.md) is end-user focused. This guide contains local development and contribution workflows.
7+
8+
## Development prerequisites
9+
10+
- Go 1.25+ (`go.mod` currently declares Go 1.25.7)
11+
- A Kubernetes cluster (OrbStack, KIND, or any conformant cluster)
12+
- `kubectl` configured for your target cluster
13+
14+
## Local development quick start (controller mode)
15+
16+
```bash
17+
# Generate and apply CRDs
18+
make manifests
19+
kubectl apply -f config/crd/bases/
20+
21+
# Run controller locally against your kubeconfig context
22+
GOFLAGS=-mod=vendor go run . --app=controller
23+
24+
# In another terminal, create the sample namespace and apply a sample control plane
25+
kubectl create namespace coder
26+
kubectl apply -f config/samples/coder_v1alpha1_codercontrolplane.yaml
27+
28+
# Verify resource creation
29+
kubectl get codercontrolplanes -A
30+
```
31+
32+
## KIND development cluster (k9s demos)
33+
34+
Bootstrap a KIND cluster and install CRDs/RBAC (**this switches current kubectl context**):
35+
36+
```bash
37+
make kind-dev-up
38+
```
39+
40+
Useful helpers:
41+
42+
```bash
43+
make kind-dev-status
44+
make kind-dev-ctx
45+
make kind-dev-load-image
46+
make kind-dev-k9s
47+
make kind-dev-down
48+
```
49+
50+
## Essential development commands
51+
52+
| Command | Description |
53+
| --- | --- |
54+
| `make build` | Build all packages |
55+
| `make test` | Run unit + integration tests |
56+
| `make test-integration` | Run focused controller integration tests |
57+
| `make manifests` | Generate CRD and RBAC manifests |
58+
| `make codegen` | Run deepcopy generation |
59+
| `make docs-reference` | Regenerate API reference docs from Go types |
60+
| `make docs-check` | Build docs in strict mode (CI-equivalent) |
61+
| `make verify-vendor` | Verify vendored dependency consistency |
62+
| `make lint` | Run linter + formatting checks |
63+
| `make vuln` | Run vulnerability scan |
64+
65+
## Before opening a PR
66+
67+
Run at least:
68+
69+
```bash
70+
make verify-vendor
71+
make test
72+
make build
73+
make lint
74+
make docs-check
75+
```

‎README.md‎

Lines changed: 28 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,26 @@
1111
1212
`coder-k8s` is a Kubernetes control-plane project for managing Coder-related resources with native Kubernetes APIs.
1313

14+
## Documentation
15+
16+
Start with the published docs: **https://coder.github.io/coder-k8s/**
17+
18+
Helpful entry points:
19+
20+
- Getting started: <https://coder.github.io/coder-k8s/tutorials/getting-started/>
21+
- Deploy the controller: <https://coder.github.io/coder-k8s/how-to/deploy-controller/>
22+
- Deploy the workspace/template API server: <https://coder.github.io/coder-k8s/how-to/deploy-aggregated-apiserver/>
23+
- API reference: <https://coder.github.io/coder-k8s/reference/api/codercontrolplane/>
24+
25+
Prefer reading docs in-repo? See [`docs/`](docs/) and run `make docs-serve`.
26+
1427
## What this project provides
1528

1629
- A controller-runtime operator for `coder.com/v1alpha1` resources:
1730
- `CoderControlPlane`
1831
- `CoderProvisioner`
1932
- `CoderWorkspaceProxy`
20-
- An aggregated API server for `aggregation.coder.com/v1alpha1` resources:
33+
- A workspace/template API server for `aggregation.coder.com/v1alpha1` resources:
2134
- `CoderWorkspace`
2235
- `CoderTemplate`
2336
- An MCP HTTP server for operational tooling.
@@ -27,113 +40,35 @@
2740

2841
| Mode | Description | Typical usage |
2942
| --- | --- | --- |
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 |
43+
| `all` (default) | Runs controller + workspace/template API + MCP HTTP together | Single deployment for evaluation environments |
44+
| `controller` | Runs only Kubernetes reconcilers | Controller-only deployments |
45+
| `aggregated-apiserver` | Runs only the workspace/template API server | Split deployments with dedicated API serving |
3346
| `mcp-http` | Runs only MCP HTTP server | MCP-focused integrations |
3447

35-
## Prerequisites
48+
## Quick start (brief, in-cluster)
3649

37-
- Go 1.25+ (`go.mod` currently declares Go 1.25.7)
38-
- A Kubernetes cluster (OrbStack, KIND, or any conformant cluster)
39-
- `kubectl` configured for your target cluster
40-
41-
## Quick start (local controller run)
50+
For a full setup guide, use the docs links above. For a quick smoke deploy:
4251

4352
```bash
44-
# Generate and apply CRDs
45-
make manifests
53+
kubectl create namespace coder-system
4654
kubectl apply -f config/crd/bases/
47-
48-
# Run controller locally against your kubeconfig context
49-
GOFLAGS=-mod=vendor go run . --app=controller
50-
51-
# In another terminal, apply a sample control plane
52-
kubectl apply -f config/samples/coder_v1alpha1_codercontrolplane.yaml
53-
54-
# Verify resource creation
55-
kubectl get codercontrolplanes -A
56-
```
57-
58-
## Documentation
59-
60-
The project docs follow Diátaxis and live in `docs/`.
61-
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/)
67-
68-
Serve docs locally:
69-
70-
```bash
71-
make docs-serve
55+
kubectl apply -f config/rbac/
56+
kubectl apply -f deploy/deployment.yaml
57+
kubectl apply -f deploy/apiserver-service.yaml
58+
kubectl apply -f deploy/apiserver-apiservice.yaml
59+
kubectl apply -f deploy/mcp-service.yaml
60+
kubectl rollout status deployment/coder-k8s -n coder-system
7261
```
7362

7463
## Examples
7564

7665
- [`examples/cloudnativepg/`](examples/cloudnativepg/) — Deploy a `CoderControlPlane` with a CloudNativePG-managed PostgreSQL backend.
7766
- [`examples/argocd/`](examples/argocd/) — Bootstrap CloudNativePG + `coder-k8s` + PostgreSQL + `CoderControlPlane` from one Argo CD `ApplicationSet`.
78-
79-
- [`examples/aggregated/`](examples/aggregated/) - Reusable `CoderTemplate` manifests for aggregated API testing.
80-
81-
## KIND development cluster (k9s demos)
82-
83-
Bootstrap a KIND cluster and install CRDs/RBAC (**this switches current kubectl context**):
84-
85-
```bash
86-
make kind-dev-up
87-
```
88-
89-
Useful helpers:
90-
91-
```bash
92-
make kind-dev-status
93-
make kind-dev-ctx
94-
make kind-dev-load-image
95-
make kind-dev-k9s
96-
make kind-dev-down
97-
```
98-
99-
## Essential commands
100-
101-
| Command | Description |
102-
| --- | --- |
103-
| `make build` | Build all packages |
104-
| `make test` | Run unit + integration tests |
105-
| `make test-integration` | Run focused controller integration tests |
106-
| `make manifests` | Generate CRD and RBAC manifests |
107-
| `make codegen` | Run deepcopy generation |
108-
| `make docs-reference` | Regenerate API reference docs from Go types |
109-
| `make docs-check` | Build docs in strict mode (CI-equivalent) |
110-
| `make verify-vendor` | Verify vendored dependency consistency |
111-
| `make lint` | Run linter + formatting checks |
112-
| `make vuln` | Run vulnerability scan |
113-
114-
## Repository layout
115-
116-
- `api/v1alpha1/` — CRD API types (`coder.com/v1alpha1`)
117-
- `api/aggregation/v1alpha1/` — aggregated API types (`aggregation.coder.com/v1alpha1`)
118-
- `internal/app/` — app mode entrypoints (`allapp`, `controllerapp`, `apiserverapp`, `mcpapp`)
119-
- `internal/controller/` — controller reconcilers
120-
- `internal/aggregated/` — aggregated storage + Coder client/provider logic
121-
- `config/` — generated CRDs, RBAC, samples
122-
- `deploy/` — deployable manifests for all-in-one, APIService, and MCP service
123-
- `docs/` — user-facing documentation site content
124-
- `hack/` — code generation and maintenance scripts
67+
- [`examples/coder-templates/`](examples/coder-templates/) — Reusable `CoderTemplate` manifests for workspace/template API testing.
12568

12669
## Contributing
12770

128-
Before opening a PR, run at least:
129-
130-
```bash
131-
make verify-vendor
132-
make test
133-
make build
134-
make lint
135-
make docs-check
136-
```
71+
For local development workflows, validation commands, and PR guidance, see [CONTRIBUTING.md](./CONTRIBUTING.md).
13772

13873
## License
13974

‎config/samples/coder_v1alpha1_coderprovisioner.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# 1. A CoderControlPlane resource must exist in the same namespace.
55
# 2. The referenced CoderControlPlane status must report operator access ready:
66
# status.operatorAccessReady=true and status.operatorTokenSecretRef set.
7+
#
78
apiVersion: coder.com/v1alpha1
89
kind: CoderProvisioner
910
metadata:

‎config/samples/coder_v1alpha1_coderworkspaceproxy.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: coder.com/v1alpha1
22
kind: CoderWorkspaceProxy
33
metadata:
44
name: coderworkspaceproxy-sample
5-
namespace: default
5+
namespace: coder
66
spec:
77
image: "ghcr.io/coder/coder:latest"
88
primaryAccessURL: "https://coder.example.com"

‎docs/index.md‎

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,33 @@
44
**Highly experimental / alpha software**
55
This project is an active prototype. Do not use it in production.
66

7-
`coder-k8s` is a Kubernetes control-plane project for running and managing Coder through Kubernetes APIs.
7+
`coder-k8s` is a Kubernetes control-plane stack for running and managing Coder through Kubernetes APIs.
88

9-
## What is in this repository?
9+
## What you can deploy
1010

1111
`coder-k8s` ships one binary with four app modes:
1212

13-
- **`all` (default)**: controller + aggregated API server + MCP server in one process.
14-
- **`controller`**: reconciles `CoderControlPlane`, `CoderProvisioner`, `CoderWorkspaceProxy` (`coder.com/v1alpha1`).
13+
- **`all` (default)**: operator + workspace/template API server + MCP server in one process.
14+
- **`controller`**: reconciles `CoderControlPlane`, `CoderProvisioner`, and `CoderWorkspaceProxy` (`coder.com/v1alpha1`).
1515
- **`aggregated-apiserver`**: serves `CoderWorkspace` + `CoderTemplate` (`aggregation.coder.com/v1alpha1`).
16-
- **`mcp-http`**: serves MCP tooling over HTTP.
17-
18-
## Documentation map (Diátaxis)
19-
20-
- **Tutorials**: guided learning path
21-
- [Getting started](tutorials/getting-started.md)
22-
- **How-to guides**: task-focused operations
23-
- [Deploy controller](how-to/deploy-controller.md)
24-
- [Deploy aggregated API server](how-to/deploy-aggregated-apiserver.md)
25-
- [Run MCP server](how-to/mcp-server.md)
26-
- [Troubleshooting](how-to/troubleshooting.md)
27-
- **Reference**: generated API reference
28-
- [API reference](reference/api/codercontrolplane.md)
29-
- **Explanation**: conceptual internals
30-
- [Architecture](explanation/architecture.md)
31-
32-
## Quick commands
33-
34-
```bash
35-
make manifests
36-
make test
37-
make build
38-
make docs-serve
39-
```
40-
41-
New here? Start with the [Getting started tutorial](tutorials/getting-started.md).
16+
- **`mcp-http`**: serves operational MCP tooling over HTTP.
17+
18+
## Quick start path
19+
20+
If you want to deploy quickly and validate the end-to-end flow:
21+
22+
1. Follow [Deploy a Coder Control Plane](tutorials/getting-started.md).
23+
2. Verify the managed Coder Deployment and Service.
24+
3. If you need external provisioners, continue with [Deploy an External Provisioner](tutorials/deploy-coderprovisioner.md).
25+
26+
## Learn more
27+
28+
- [Deploy an External Provisioner](tutorials/deploy-coderprovisioner.md)
29+
- [Deploy controller](how-to/deploy-controller.md)
30+
- [Deploy aggregated API server](how-to/deploy-aggregated-apiserver.md)
31+
- [Run MCP server](how-to/mcp-server.md)
32+
- [Troubleshooting](how-to/troubleshooting.md)
33+
- [API reference](reference/api/codercontrolplane.md)
34+
- [Architecture](explanation/architecture.md)
35+
36+
Start with [Deploy a Coder Control Plane](tutorials/getting-started.md).
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Deploy an External Provisioner
2+
3+
This tutorial deploys a `CoderProvisioner` for an existing `CoderControlPlane` managed by `coder-k8s`.
4+
5+
Estimated time: **5 minutes**.
6+
7+
## Prerequisite
8+
9+
Complete [Deploy a Coder Control Plane](getting-started.md) first.
10+
11+
This tutorial assumes the setup from that guide:
12+
13+
- `CoderControlPlane` **`codercontrolplane-sample`** exists in namespace **`coder`** and is `Ready`.
14+
- Operator access is enabled and ready (default behavior):
15+
`.status.operatorAccessReady=true`.
16+
17+
Quick check:
18+
19+
```bash
20+
kubectl get codercontrolplane codercontrolplane-sample -n coder \
21+
-o jsonpath='{.status.phase}{"\n"}{.status.operatorAccessReady}{"\n"}'
22+
```
23+
24+
Expected output:
25+
26+
```text
27+
Ready
28+
true
29+
```
30+
31+
## 1) Confirm external provisioner entitlement
32+
33+
`CoderProvisioner` requires external provisioner entitlement in the referenced Coder deployment.
34+
35+
```bash
36+
kubectl get codercontrolplane codercontrolplane-sample -n coder \
37+
-o jsonpath='{.status.externalProvisionerDaemonsEntitlement}{"\n"}'
38+
```
39+
40+
Expected values to proceed: `entitled` or `grace_period`.
41+
42+
If the value is `not_entitled`, update the control-plane license before continuing.
43+
44+
## 2) Deploy the `CoderProvisioner`
45+
46+
Apply the sample manifest:
47+
48+
```bash
49+
kubectl apply -f "https://raw.githubusercontent.com/coder/coder-k8s/main/config/samples/coder_v1alpha1_coderprovisioner.yaml"
50+
```
51+
52+
## 3) Verify reconciliation
53+
54+
```bash
55+
kubectl get coderprovisioner coderprovisioner-sample -n coder
56+
kubectl get coderprovisioner coderprovisioner-sample -n coder -o jsonpath='{.status.phase}{"\n"}'
57+
kubectl get coderprovisioner coderprovisioner-sample -n coder -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.reason}{"\n"}{end}'
58+
```
59+
60+
Verify generated resources:
61+
62+
```bash
63+
kubectl get deployment provisioner-coderprovisioner-sample -n coder
64+
kubectl get sa coderprovisioner-sample-provisioner -n coder
65+
kubectl get role provisioner-coderprovisioner-sample -n coder
66+
kubectl get rb provisioner-coderprovisioner-sample -n coder
67+
kubectl get secret coderprovisioner-sample-provisioner-key -n coder
68+
```
69+
70+
Expected: `status.phase=Ready`, `DeploymentReady=True`, and a ready provisioner pod.
71+
72+
## 4) Clean up (optional)
73+
74+
```bash
75+
kubectl delete coderprovisioner coderprovisioner-sample -n coder
76+
```
77+
78+
To tear down the full stack, follow cleanup in
79+
[Deploy a Coder Control Plane](getting-started.md#5-clean-up-optional).

0 commit comments

Comments
 (0)