Skip to content

Friend Namespaces

Each friend gets their own Kubernetes namespace (friend-<name>) with resource quotas, network policies, and pod security standards.

Namespaces are provisioned via the controller API:

Terminal window
POST /api/friends/alice/namespace/provision
# Creates: namespace, ResourceQuota, LimitRange, NetworkPolicy

This happens automatically when a friend is created via POST /api/friends, or can be triggered manually for existing friends.

ResourceLimit
CPU500m
Memory512Mi
Pods3
PVCs2

Default container limits are enforced:

DefaultMax
CPU100m500m
Memory64Mi256Mi

Friend namespaces have strict network isolation:

  • Blocked: All cross-namespace pod-to-pod traffic
  • Allowed: Internet egress (for external APIs)
  • Allowed: Ingress from manyclaws-system only (controller access)

This means friend workloads cannot communicate with agent pods or other friend namespaces directly.

The restricted Pod Security Standard is enforced:

  • No privilege escalation
  • No hostPath mounts
  • No root containers
  • seccomp profile required
  • Capabilities must be dropped

Friends (or agents on their behalf) can deploy workloads to friend namespaces:

Terminal window
# Agent deploys to friend's namespace
POST /api/friends/alice/namespace/apply
[
{
"kind": "Deployment",
"metadata": {"name": "my-app"},
"spec": { ... }
},
{
"kind": "Service",
"metadata": {"name": "my-app"},
"spec": { ... }
}
]

Allowed resource kinds: Deployment, Service, ConfigMap, Job, CronJob.

Services in friend namespaces can be exposed publicly via IngressRoute + DNS:

Terminal window
POST /api/friends/alice/namespace/expose
{
"name": "my-app",
"service": "my-app",
"port": 80,
"domain": "your-domain.net"
}
# Returns: {"hostname": "my-app-alice.your-domain.net", "url": "https://my-app-alice.your-domain.net"}

The controller creates a Traefik IngressRoute and a Cloudflare DNS CNAME record automatically.