Skip to content

Commit 39e4c50

Browse files
authored
Create local testing environment w/ Kind (#236)
## Summary This PR establishes a complete local testing environment for Milo that enables developers to quickly spin up and test the full control plane stack locally. The implementation provides a production-like testing environment with proper authentication, TLS certificates, and networking configuration. ## Key Features - **One-command setup**: task dev:setup deploys a complete Milo environment in under 5 minutes - **Complete control plane**: Includes etcd storage, API server, controller manager, and webhooks - **Production-like networking**: Uses Gateway API with Envoy Gateway for realistic traffic routing - **Automated certificate management**: Uses cert-manager for TLS certificate provisioning - **Pre-configured authentication**: Test tokens and kubeconfig for immediate API access - **Task automation**: Enhanced Taskfile with development workflows ## Notes This is built on top of the changes introduced in the test-infra repo to [add support for the envoy gateway, observability stack, and remote taskfile support](datum-cloud/test-infra#6).
2 parents 603f25f + 1c27f74 commit 39e4c50

33 files changed

Lines changed: 1038 additions & 141 deletions

.devcontainer/devcontainer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"ghcr.io/devcontainers-extra/features/go-task": {},
2222
"ghcr.io/audacioustux/devcontainers/kustomize": {},
2323
"ghcr.io/devcontainers/features/node": {
24-
"version": "22.14.0"
24+
"version": "22.14.0"
2525
},
2626
"ghcr.io/devcontainers-extra/features/pulumi": {}
2727
},
@@ -77,6 +77,11 @@
7777
"editor.tabSize": 2
7878
}
7979
},
80+
"containerEnv": {
81+
// Allow remote task files so we can include the test-infra taskfile for
82+
// test cluster management.
83+
"TASK_X_REMOTE_TASKFILES": "1",
84+
}
8085

8186
// Features to add to the dev container. More info: https://containers.dev/features.
8287
// "features": {},

.dockerignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Git and development files
2+
.git
3+
.gitignore
4+
.gitattributes
5+
.github/
6+
7+
# Documentation
8+
*.md
9+
docs/
10+
11+
# Development and test files
12+
.task/
13+
.milo/
14+
.claude/
15+
certs/
16+
bin/
17+
test/
18+
dev-temp/
19+
20+
# Location the test-infra repo will be copied to by the remote taskfile.
21+
.test-infra
22+
23+
# Configuration and manifests (not needed for build)
24+
config/
25+
Taskfile.yaml
26+
docker-compose.yaml
27+
28+
# IDE and editor files
29+
.vscode/
30+
.idea/
31+
*.swp
32+
*.swo
33+
*~
34+
35+
# OS generated files
36+
.DS_Store
37+
.DS_Store?
38+
._*
39+
.Spotlight-V100
40+
.Trashes
41+
ehthumbs.db
42+
Thumbs.db
43+
44+
# Temporary files
45+
*.tmp
46+
*.temp
47+
/tmp/
48+
49+
# Build artifacts and caches
50+
node_modules/
51+
*.log

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
node_modules
2-
test/config/zitadel/secrets/machine-key.json
32
bin/
43
# Generated certificates for local development
54
certs/
65
# Generated kubeconfig for local development
76
.kube/
8-
.tool-versions
7+
8+
.tool-versions
9+
10+
# Location the test-infra repo will be copied to by the remote taskfile.
11+
.test-infra
12+
# Files used by the taskfile.
13+
.task

.milo/kubeconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
clusters:
3+
- cluster:
4+
insecure-skip-tls-verify: true
5+
server: https://localhost:30443
6+
name: milo-test-infra
7+
contexts:
8+
- context:
9+
cluster: milo-test-infra
10+
user: admin
11+
name: milo-test-infra
12+
current-context: milo-test-infra
13+
kind: Config
14+
preferences: {}
15+
users:
16+
- name: admin
17+
user:
18+
token: test-admin-token

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ help a new class of service providers gain hyperscaler advantages. We decided
2727
that instead of simply using the lessons we'd learned over the years to build
2828
our own kick-butt back office, we should make it available to others. Et voila!
2929

30+
## Quick Start
31+
32+
Get Milo running locally in under 5 minutes:
33+
34+
```bash
35+
# Prerequisites: Docker, Kind, kubectl, and Task installed
36+
git clone https://github.com/datum-cloud/milo.git
37+
cd milo
38+
39+
# Enable remote task files to be used
40+
export TASK_X_REMOTE_TASKFILES=1
41+
task dev:setup
42+
```
43+
44+
This deploys a complete Milo environment with API server, storage, and
45+
controllers. Access it with:
46+
47+
```bash
48+
export KUBECONFIG=.milo/kubeconfig
49+
kubectl get organizations
50+
```
51+
52+
📚 **[Full setup guide →](docs/getting-started.md)**
53+
📖 **[API documentation →](docs/api/)**
54+
3055
## What We Prefer Not to Build
3156

3257
Projects with such a wide surface area can engender a "build everything"
@@ -43,6 +68,7 @@ scaled vendors. Here are some examples:
4368
- Tax and financial compliance can be provided by Avalara, NetSuite, etc.
4469

4570
## What We're Starting With
71+
4672
There are a few big "System of Record" buckets to which we think folks should
4773
have programmatic access, namely: contacts, accounts, products, vendors, and
4874
assets.

0 commit comments

Comments
 (0)