9router

by ducthangqd1998

Helm chartv0.1.2App 0.5.119Apache-2.0Verified publisher

Deploy 9Router, a unified AI routing and OpenAI-compatible LLM proxy gateway for Kubernetes.

About this chart

9router

Deploy 9Router, a unified AI routing and OpenAI-compatible LLM proxy gateway, on Kubernetes with Pod Security Standards (Restricted) hardening out of the box.

Architecture

Client / Gateway API / Ingress
            |
            v
    Service (ClusterIP :20128)
            |
            v
    Deployment (9router :20128)
      ├── DATA_DIR (/app/data) -> PersistentVolumeClaim or emptyDir
      ├── /tmp                 -> emptyDir
      └── /home/node/.npm      -> emptyDir

Prerequisites

  • Kubernetes 1.25+
  • Helm 3.12+
  • Gateway API CRDs (gateway.networking.k8s.io/v1) if httpRoute.enabled=true
  • A default StorageClass (or explicit persistence.storageClass) if persistence.enabled=true

Security & Runtime Notes

  • Pod Security Standards (Restricted): Runs as UID/GID 1000 (runAsNonRoot: true), allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities.drop: ["ALL"], seccompProfile.type: RuntimeDefault, and automountServiceAccountToken: false.
  • Entrypoint Override: The upstream decolua/9router container entrypoint uses su-exec, which requires root privileges. This chart defaults command to ["node", "custom-server.js"] so the server starts cleanly as a non-root user.
  • Writable Scratch Mounts: /app/data, /tmp, and /home/node/.npm are mounted as writable volumes (emptyDir for scratch paths and emptyDir or PersistentVolumeClaim for /app/data) so readOnlyRootFilesystem: true works without runtime errors.
  • Secrets Management: Never place API keys directly in values.yaml. Create a Kubernetes Secret (or sync one with External Secrets Operator / Sealed Secrets) and pass it via extraEnvFrom or extraEnv.

Installation

Add the Helm Repository

helm repo add thangmai-charts https://ducthangqd1998.github.io/charts
helm repo update

Install the Chart

helm install my-9router thangmai-charts/9router \
  --namespace ai-tools \
  --create-namespace

Install with Persistence & Custom Secret

kubectl create secret generic 9router-secrets \
  --namespace ai-tools \
  --from-literal=JWT_SECRET=change-me

helm install my-9router thangmai-charts/9router \
  --namespace ai-tools \
  --set persistence.enabled=true \
  --set 'extraEnvFrom[0].secretRef.name=9router-secrets'

Configuration

KeyDescriptionDefault
replicaCountNumber of Deployment replicas (ignored when autoscaling.enabled=true)1
image.repositoryContainer image repositorydecolua/9router
image.pullPolicyImage pull policyIfNotPresent
image.tagImage tag override (defaults to Chart.appVersion, rejects latest)""
commandContainer command (bypasses root-only su-exec entrypoint)["node", "custom-server.js"]
argsContainer arguments[]
strategyDeployment update strategy (auto-uses Recreate with ReadWriteOnce PVC){}
serviceAccount.createCreate a dedicated ServiceAccounttrue
serviceAccount.automountAutomount ServiceAccount token in Podsfalse
service.typeKubernetes Service typeClusterIP
service.portService listening port20128
service.targetPortContainer listening port20128
ingress.enabledEnable standard networking.k8s.io/v1 Ingressfalse
httpRoute.enabledEnable Gateway API gateway.networking.k8s.io/v1 HTTPRoutefalse
httpRoute.parentRefsGateway parentRefs for HTTPRoute[]
httpRoute.hostnamesHostnames matched by HTTPRoute[]
httpRoute.rulesCustom HTTPRoute rules (defaults backendRefs to the chart Service)[]
resources.requestsCPU and memory requests100m / 256Mi
resources.limitsMemory limit (CPU limit omitted to prevent CFS throttling)512Mi
persistence.enabledEnable PVC for DATA_DIR (uses emptyDir when false)false
persistence.storageClassStorageClass name ("" = cluster default, "-" = disable dynamic provisioning)""
persistence.sizeRequested PVC size5Gi
persistence.mountPathMount path for persistent data/app/data
envPlain key/value environment variablesDATA_DIR, HOSTNAME, NODE_ENV, PORT
extraEnvAdditional env entries (valueFrom, secretKeyRef, etc.)[]
extraEnvFromAdditional envFrom sources (secretRef, configMapRef)[]
autoscaling.enabledEnable HPA autoscaling/v2 (incompatible with ReadWriteOnce PVC)false
podDisruptionBudget.enabledEnable policy/v1 PodDisruptionBudgetfalse
networkPolicy.enabledEnable default-deny ingress/egress NetworkPolicyfalse
terminationGracePeriodSecondsGrace period before SIGKILL60

See values.yaml for the complete set of configurable options.

Examples

  • examples/development-values.yaml: Minimal ephemeral configuration for local development.
  • examples/production-values.yaml: Stateless HA configuration with Ingress, HPA, PDB, NetworkPolicy, and topology spread.
  • examples/gateway-api-values.yaml: Single-instance persistent setup exposed via Gateway API HTTPRoute.

Uninstalling

helm uninstall my-9router --namespace ai-tools

Deploy 9router with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has 9router on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chart9router is pinned at v0.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply