middleware

by HelmForge

Helm chartv1.2.14App 0.3.1Apache-2.0Verified publisher

Middleware open-source DORA metrics platform with PostgreSQL and Redis for engineering team performance

About this chart

Middleware Helm Chart

Deploy Middleware, the open-source DORA metrics platform, with the official middlewareeng/middleware image and a separate PostgreSQL database. The chart preserves the application's encryption keys, runs database migrations before startup, and validates the complete frontend, analytics, sync, and embedded Redis process set before a pod becomes ready.

Features

  • Measures deployment frequency, lead time for changes, change failure rate, and time to restore.
  • Uses the HelmForge PostgreSQL subchart or an operator-managed PostgreSQL.
  • Runs the upstream-supported embedded Redis process on loopback.
  • Persists encryption keys at the path used by Middleware 0.3.1.
  • Applies database migrations in an init container before the application.
  • Supports configurable application and Service ports, Ingress, scheduling, additional volumes, and extra manifests.
  • Creates a tokenless ServiceAccount, RuntimeDefault seccomp profile, capability drop, and NetworkPolicy by default.
  • Rejects ambiguous datastore modes and unsupported remote Redis settings.

Installation

Using the HTTPS repository:

helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install middleware helmforge/middleware --namespace middleware --create-namespace

Using OCI:

helm install middleware oci://ghcr.io/helmforgedev/helm/middleware \
  --namespace middleware \
  --create-namespace

The default installation creates one Middleware Deployment, a PVC for the application encryption keys, and a standalone PostgreSQL release. Redis runs inside the official application container because the upstream 0.3.1 remote Redis client does not support password authentication and unconditionally uses TLS for non-loopback hosts.

Architecture

Middleware packages three processes in one container:

ProcessDefault portPurpose
Frontend3333Next.js user interface
Analytics API9696DORA data and API operations
Sync server9697Provider ingestion and synchronization

The Service exposes only the frontend through the named http port. Startup and readiness probes require all three application listeners plus the loopback Redis listener. Changing middleware.frontendPort, middleware.analyticsPort, or middleware.syncPort changes both the Kubernetes ports and the upstream process environment.

Before the application starts, an init container runs the migrations shipped in the same official image. It uses dbmate --wait, then writes the signal the upstream analytics process expects in a shared emptyDir. This is required because disabling the image's embedded PostgreSQL also disables its original initializer.

Configuration

KeyDefaultDescription
middleware.frontendPort3333Frontend listener port.
middleware.analyticsPort9696Analytics listener port.
middleware.syncPort9697Sync listener port.
middleware.environmentprodRuntime and frontend environment.
middleware.timezoneUTCIANA timezone used for metric windows.
postgresql.enabledtrueDeploy the PostgreSQL subchart.
externalDatabase.enabledfalseUse an operator-managed PostgreSQL.
externalDatabase.existingSecret""Secret containing the database password.
externalDatabase.sslModedisablelibpq SSL mode for an external database.
persistence.enabledtruePersist the Middleware encryption keys.
persistence.size1GiKey PVC capacity.
service.port80Service port mapped to the frontend.
ingress.enabledfalseRender an Ingress.
networkPolicy.enabledtrueRestrict application ingress to the frontend port.
serviceAccount.automountServiceAccountTokenfalseMount a Kubernetes API token.

The complete contract is documented in configuration.md and enforced by values.schema.json plus template validation.

Examples

Bundled PostgreSQL

The defaults are sufficient. For a durable production password, create a Secret and let the subchart consume it:

read -r -s -p 'PostgreSQL superuser password: ' MIDDLEWARE_POSTGRES_PASSWORD
printf '\n'
read -r -s -p 'PostgreSQL application password: ' MIDDLEWARE_DB_PASSWORD
printf '\n'
kubectl create namespace middleware --dry-run=client -o yaml | kubectl apply -f -
kubectl create secret generic middleware-postgresql-credentials \
  --namespace middleware \
  --from-literal=postgres-password="$MIDDLEWARE_POSTGRES_PASSWORD" \
  --from-literal=user-password="$MIDDLEWARE_DB_PASSWORD"
unset MIDDLEWARE_POSTGRES_PASSWORD MIDDLEWARE_DB_PASSWORD
postgresql:
  enabled: true
  auth:
    database: mhq-oss
    username: middleware
    existingSecret: middleware-postgresql-credentials
    existingSecretUserPasswordKey: user-password

persistence:
  enabled: true
  size: 1Gi

Replication mode additionally requires the configured replication password key.

External PostgreSQL

postgresql:
  enabled: false

externalDatabase:
  enabled: true
  host: postgres.database.svc.cluster.local
  port: 5432
  name: mhq-oss
  user: middleware
  existingSecret: middleware-database
  existingSecretPasswordKey: password
  sslMode: require

Create middleware-database before installation, or source it through an external secret controller. The chart also accepts an inline externalDatabase.password for development and places it in a chart-managed Secret; do not commit that value to source control.

Custom application and Service ports

middleware:
  frontendPort: 4333
  analyticsPort: 10696
  syncPort: 10697

service:
  port: 8080

The Service continues to target the named frontend port, so service.port does not need to match middleware.frontendPort.

Security

The default pod does not receive a Kubernetes API token. The pod uses the RuntimeDefault seccomp profile, while both the migration and application containers disallow privilege escalation and drop all Linux capabilities. The upstream image starts as root and expands packaged runtime artifacts on first startup, so this chart cannot safely set runAsNonRoot or a read-only root filesystem without a rebuilt upstream image.

The default NetworkPolicy permits inbound traffic only to the named frontend port. Egress remains unrestricted because Middleware connects to operator- selected Git, issue tracker, and CI providers. Restrict egress at the platform layer only after enumerating all required destinations.

Database passwords are referenced from Kubernetes Secrets. Inline external passwords are moved into a Secret and are never placed directly in the Deployment environment. Prefer externalDatabase.existingSecret in GitOps environments.

See security.md for the threat boundaries and residual upstream constraints.

Operations

Back up both PostgreSQL and the key PVC. PostgreSQL contains DORA records and integration metadata; the persisted config.ini contains the RSA key pair used to encrypt stored integration credentials. Restoring only one of these data sets can make provider credentials unusable.

The application Deployment uses Recreate and a single replica. The key PVC defaults to ReadWriteOnce, and upstream does not define a multi-replica coordination model. Scale and protect PostgreSQL independently, but keep the application tier at one replica.

Detailed backup, restore, rollout, and diagnostic commands are in operations.md.

Troubleshooting

Inspect migration and application logs separately:

kubectl logs -n middleware deployment/middleware-middleware -c migrate-database
kubectl logs -n middleware deployment/middleware-middleware -c middleware --tail=200
kubectl describe pod -n middleware -l app.kubernetes.io/instance=middleware

If the init container waits for PostgreSQL, verify the resolved Service name, Secret key, network path, and externalDatabase.sslMode. If the frontend is open but the pod is not Ready, inspect the analytics and sync listener logs; the readiness probe intentionally checks all three processes.

If integrations cannot be decrypted after a restore, confirm that the PVC was restored from the same recovery point as PostgreSQL and contains mhq/config/config.ini at the mounted application path.

Upgrade notes

  • Preserve the existing key PVC across upgrades.
  • Restore or reuse PostgreSQL credential Secrets when PostgreSQL PVCs already contain data; generating a new password will not change the database user.
  • Remote or subchart Redis values are rejected because Middleware 0.3.1 cannot consume them safely. Remove legacy redis.enabled: true and externalRedis.enabled: true overrides.
  • Verify all three listeners after an image change because they are supervised independently inside the container.

Documentation

  • Chart design
  • Configuration reference
  • External database guide
  • Operations and recovery
  • Security model
  • Production example
  • External database example
  • Upstream source

Security Scan: middleware

FrameworkScore
MITRE + NSA + SOC279.29292%

The score is refreshed by CI from rendered manifests. It does not replace application-image vulnerability scanning or a review of external provider credentials.

Deploy middleware with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has middleware 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 chartmiddleware is pinned at v1.2.14 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