Skip to content

Kubernetes Deploy Guide

Scale OMA with Kubernetes sandbox pods using the k8s-bridge.

The k8s-bridge is an HTTP bridge that lets Cloudflare Workers manage sandbox pods on a Kubernetes cluster. It runs as a Deployment inside your cluster and exposes a REST API that maps to Kubernetes operations.

Cloudflare Worker → k8s-bridge (HTTPS + Bearer) → Kubernetes API → Pod
  • Kubernetes cluster v1.25+
  • Helm 3
  • kubectl with cluster-admin access
  • cert-manager installed
  • DNS domain pointing to your ingress controller
Terminal window
helm repo add oma https://charts.oma.duyet.net
helm repo update
export K8S_BRIDGE_TOKEN=$(openssl rand -base64 32)
echo "$K8S_BRIDGE_TOKEN"
helm install oma-k8s-bridge oma/oma-k8s-bridge \
--namespace oma-sandbox \
--create-namespace \
--set secret.token=$K8S_BRIDGE_TOKEN \
--set ingress.enabled=true \
--set ingress.host=k8s-bridge.example.com
Terminal window
kubectl -n oma-sandbox rollout status deployment/oma-k8s-bridge
curl -H "Authorization: Bearer $K8S_BRIDGE_TOKEN" \
https://k8s-bridge.example.com/api/v1/health

Expected response:

{"status":"ok","k8sVersion":"v1.30.2","nodeCount":3,"activeBoxes":0,"latencyMs":12}

In the Console, add a new sandbox provider:

  1. Go to Runtimes → Add Provider
  2. Select Kubernetes (k8s-bridge)
  3. Enter URL: https://k8s-bridge.example.com
  4. Enter token: the value printed by echo "$K8S_BRIDGE_TOKEN" above (paste the actual token, not the literal $K8S_BRIDGE_TOKEN text)
ParameterDefaultDescription
replicaCount2Number of replicas
secret.token""Bearer token (REQUIRED)
image.taglatestContainer image tag
ingress.host""Ingress hostname
resources.limits.cpu500mCPU limit
resources.limits.memory512MiMemory limit
  • Use a dedicated namespace (oma-sandbox)
  • Set resource limits on the bridge pod
  • Enable Pod Security Admission (pod-security.kubernetes.io/enforce=restricted namespace label — PodSecurityPolicy was removed in Kubernetes v1.25)
  • Configure network policies
  • Set up monitoring (Prometheus + Grafana)
  • Regular backup of etcd
  • Use a managed Kubernetes service (EKS, GKE, AKS)