caddy

by QuenchWorks

Helm chartv0.0.26App 2.11.9Apache-2.0Verified publisher

Web server and reverse proxy with fully automatic HTTPS via Let's Encrypt and a simple Caddyfile config. Hardened by QuenchWorks as a minimal, nonroot, CVE-gated image, cosign-signed and pinned by digest.

About this chart

Quenchworks Caddy

Hardened Caddy web server with automatic HTTPS on a minimal, nonroot, read-only-rootfs, CVE-gated image pinned by digest. Built from source on Wolfi (no upstream distro binaries). Listens on 8080 (http) and 8443 (https); the admin API is on 2019 (in-cluster only). Ports are unprivileged because the container runs as nonroot uid 1001, which cannot bind ports below 1024. Stateless: this chart runs a Deployment and scales horizontally.

Install

helm install web oci://ghcr.io/quenchworks/charts/caddy

Then reach it from inside the cluster:

kubectl run web-test --rm -it --image=curlimages/curl --restart=Never -- \
  curl http://web-caddy:8080/

Verify the image

cosign verify ghcr.io/quenchworks/images/caddy \
  --certificate-identity-regexp 'https://github.com/quenchworks/.+' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Each build also ships an SPDX SBOM and SLSA provenance attestation. Verify them with gh attestation verify oci://ghcr.io/quenchworks/images/caddy --owner quenchworks.

Configuration

The chart serves a Caddyfile written to a ConfigMap and mounted read-only at /etc/caddy/Caddyfile (the image entrypoint runs caddy run --config /etc/caddy/Caddyfile). The default responds 200 on / over the unprivileged HTTP port 8080 and enables the admin API on 2019:

{
	admin :2019
}
:8080 {
	respond "QuenchWorks Caddy OK" 200
}

Override config.caddyfile to serve your own site or a reverse proxy:

config:
  caddyfile: |
    {
      admin :2019
    }
    :8080 {
      reverse_proxy upstream.svc.cluster.local:80
    }

Or point the chart at an externally-managed ConfigMap (its Caddyfile key is mounted):

config:
  existingConfigMap: my-caddyfile

Automatic HTTPS

Caddy's automatic HTTPS issues and renews certificates on the :8443 site when the site address is a routable hostname. It needs the writable /data volume (provided by this chart via an emptyDir) for certificate/state storage and outbound reach to the ACME CA. Because /data is per-replica scratch, use a shared storage module in the Caddyfile if you run multiple replicas behind one hostname. For plain in-cluster HTTP, keep the default :8080 site.

Values

KeyDefaultNotes
image.repositoryghcr.io/quenchworks/images/caddy
image.digest(CI-written)Required. Charts pin by digest, never a tag.
replicaCount1Stateless; scale freely (ignored when autoscaling is on).
config.caddyfile:8080 { respond ... 200 }Inline Caddyfile mounted at /etc/caddy/Caddyfile.
config.existingConfigMap""Existing ConfigMap with a Caddyfile key; takes precedence over config.caddyfile.
service.port8080http (named http).
service.httpsPort8443https (named https).
tls.enabledfalseAppends a :8443 site with the chart cert (at /tls) that proxies to your :8080 site. With your own :8443 site or config.existingConfigMap, use tls /tls/tls.crt /tls/tls.key yourself.
tls.existingSecret""Use this kubernetes.io/tls Secret (1st choice).
tls.certManager.enabledfalseRequest a cert-manager Certificate from tls.certManager.issuerRef (2nd choice).
tls.selfSigned.validityDays365Otherwise Helm generates a CA + certificate, kept across upgrades.
service.adminPort2019admin API (named admin); in-cluster only.
autoscaling.enabledfalseOptional CPU HPA (minReplicas/maxReplicas).
networkPolicy.enabledtrueIngress to 8080/8443 (admin always namespace-only).
networkPolicy.allowExternaltrueA web server usually wants external ingress; set false to restrict to the namespace.
podDisruptionBudget.enabledtrueminAvailable: 1.
ingress.enabledfalseCreate an Ingress for this chart. HTTP only.
ingress.className""IngressClass to claim it. Empty leaves it unset, so the cluster default applies.
ingress.annotations{}Controller annotations (rewrite targets, body size, cert-manager issuer, ...).
ingress.servicePortnullBackend port. Unset resolves service.port, then service.ports.http / .https.
ingress.hosts[]e.g. [{host: app.example.com}]. A host with no paths gets a single / Prefix path.
ingress.tls[]Standard Ingress TLS list, e.g. [{hosts: [app.example.com], secretName: app-tls}].

Plus the shared quench-common knobs (scheduling, probes, sidecars, extra env/volumes, security contexts).

Security

Runs nonroot (uid 1001) on a read-only root filesystem with all capabilities dropped and privilege escalation disabled. Writable emptyDir volumes are mounted at /data (certs/state, $XDG_DATA_HOME), /config (autosaved config, $XDG_CONFIG_HOME) and /tmp — the only writable paths Caddy needs. Logs go to stdout/stderr. The admin API on 2019 is never exposed outside the namespace. The NetworkPolicy is the trust boundary.

Notes

Depends on the quench-common library chart, pulled from oci://ghcr.io/quenchworks/charts/quench-common.

Deploy caddy with OpenTenant

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