#Deployment Guide (Deep Dive)

Version: 0.33.0 Updated: 2026-03-15 Applies to: ranvier (facade), ranvier-http Category: Deep Dives


Docker multi-stage builds, Kubernetes manifests, and production deployment patterns for Ranvier.

#Docker Multi-Stage Build

Stage Description
Builder rust:1.93-bookworm with cargo-chef for dependency caching
Runtime debian:bookworm-slim with non-root user and HEALTHCHECK

Dependency caching: Only rebuild when Cargo.toml/Cargo.lock change.


#Kubernetes Manifests

Resource Description
Deployment Readiness, liveness, and startup probes with Prometheus annotations
Service ClusterIP with http (80โ†’3000) and inspector (3001) ports
ConfigMap ranvier.toml with server, logging, inspector, and telemetry sections
HPA CPU/memory-based autoscaling with scale-up and scale-down policies

#Configuration in Production

  • Profile activation: RANVIER_PROFILE=prod selects [profile.prod] overrides.
  • Secrets: Mount as environment variables (RANVIER_TELEMETRY__OTLP_ENDPOINT).
  • Volume mount: ConfigMap โ†’ /app/ranvier.toml for file-based configuration.

#Health Probes

Endpoint Behavior
/health Full health status with registered check results
/ready Readiness probe โ€” returns 200 when all checks pass
/live Liveness probe โ€” always returns 200 (process is alive)
Startup probe Initial delay for application warmup

#Workflows

  1. Copy Dockerfile.example and .dockerignore.example to your project root.
  2. Build Docker image: docker build -t my-ranvier-app .
  3. Create Kubernetes namespace and apply ConfigMap with ranvier.toml.
  4. Apply Deployment, Service, and HPA manifests to the cluster.
  5. Configure Prometheus scraping via pod annotations.
  6. Set up OTLP endpoint for distributed tracing (Jaeger, Tempo, Datadog).
  7. Monitor with /health, /ready, /live endpoints and Inspector /metrics.

#Key Artifacts

Artifact Description
Dockerfile.example Multi-stage Docker build with dependency caching and non-root runtime
deployment.yaml Kubernetes Deployment with health probes and Prometheus annotations
service.yaml ClusterIP Service exposing HTTP and Inspector ports
configmap.yaml ConfigMap with ranvier.toml for production
hpa.yaml HorizontalPodAutoscaler with CPU/memory targets