pangolin
by Fossorial
Pangolin Helm Chart
About this chart
Pangolin Helm Chart
Pangolin Helm Chart
Features
- All-in-one (single) or multi-deployment composition
- Standalone Traefik integration (in-pod) or Kube Controller mode
- Embedded PostgreSQL or external/CloudNativePG database support
- Let's Encrypt ACME certificate management via Traefik
- Gerbil WireGuard tunnel management
- Prometheus monitoring (ServiceMonitor, PodMonitor, PrometheusRule)
- Kubernetes RBAC for controller mode (supports targeting a separate Traefik namespace)
- NetworkPolicy support
- Optional Blueprint support (store blueprint YAML as chart-managed ConfigMaps/Secrets)
Prerequisites
- Kubernetes >= 1.30.14
- Helm 3.x
Architecture overview
This chart can deploy a Pangolin control-plane plus optional components:
- Pangolin app: the main API/UI workloads and Services.
- pangolin-kube-controller (controller mode): reconciles Traefik CRDs and reads Pangolin config from the Pangolin API endpoint.
- Traefik:
- Controller mode: you run a Traefik Ingress Controller (optionally installed via the bundled dependency, aliased as
traefikController). - Standalone mode: the chart runs Traefik itself. In
deployment.mode=multiit is a container in the Gerbil Pod (see Tunnel data path); insinglemode it is part of the shared Pod.
- Controller mode: you run a Traefik Ingress Controller (optionally installed via the bundled dependency, aliased as
- Database: one of
cloudnativepg,external,embedded, orsqlite(see below).
Deployment modes
deployment.type=controller(recommended)- Runs Pangolin +
pangolin-kube-controller. - Requires Traefik CRDs and a Traefik controller (either installed separately or via
deployment.installTraefikController=true).
- Runs Pangolin +
deployment.type=standalone- Runs Pangolin plus an internal Traefik workload managed by this chart.
- Best for labs/dev; for production, controller mode is recommended unless you specifically need a self-contained deployment.
deployment.mode controls how workloads are split:
multi: separate workloads for Pangolin / Gerbil (+ Traefik in the Gerbil Pod forstandalone) / controller.single: one shared Pod. Indeployment.type=controller, it runs Pangolin + optional Gerbil + controller. Indeployment.type=standalone, it runs Pangolin + optional Gerbil + optional standalone Traefik.deployment.mode=multiremains the recommended production topology.
Example install profiles
Scenario-based example values files are in charts/pangolin/examples/.
Use the examples guide for profile selection, prerequisites, and install/cleanup commands:
charts/pangolin/examples/README.md.
Database mode selection
The default database.mode is cloudnativepg — the recommended production path. Pangolin automatically uses the PostgreSQL-capable image (fosrl/pangolin:postgresql-<appVersion>) for any non-SQLite mode.
| Mode | Use case | Pangolin image |
|---|---|---|
cloudnativepg | Recommended production – CloudNativePG operator manages PostgreSQL | fosrl/pangolin:postgresql-<appVersion> |
external | Production with externally managed PostgreSQL (RDS, Cloud SQL, etc.) | fosrl/pangolin:postgresql-<appVersion> |
embedded | Labs/test – chart-managed PostgreSQL StatefulSet | fosrl/pangolin:postgresql-<appVersion> |
sqlite | Dev/CI only – NOT for production | fosrl/pangolin:<appVersion> |
CloudNativePG setup (recommended production database)
CloudNativePG (CNPG) is the preferred production database backend. The chart uses the official cloudnative-pg operator chart and the official cluster chart from the same repository.
The operator and cluster are controlled only by top-level subchart values and support four modes:
- External operator + external cluster:
cnpg-operator.enabled=false,cnpg-cluster.enabled=false - Chart installs operator only:
cnpg-operator.enabled=true,cnpg-cluster.enabled=false - Chart installs cluster only:
cnpg-operator.enabled=false,cnpg-cluster.enabled=true - Chart installs both operator and cluster:
cnpg-operator.enabled=true,cnpg-cluster.enabled=true
When database.mode=cloudnativepg and cnpg-cluster.enabled=true, Pangolin resolves the cluster
name in this order:
cnpg-cluster.fullnameOverride(when non-empty)database.cloudnativepg.cluster.name
If both are set to different values, chart rendering fails with:
PANGOLIN-CNPG: cnpg-cluster.fullnameOverride and database.cloudnativepg.cluster.name must match when cnpg-cluster.enabled=true.
Connecting Pangolin to a CNPG cluster
CloudNativePG automatically creates an application Secret when a cluster boots.
For a cluster named pangolin-db (the default cnpg-cluster.fullnameOverride),
the Secret is named pangolin-db-app and contains the key uri with the full PostgreSQL
connection string (format: postgresql://user:password@host:port/dbname?sslmode=...).
Default behavior — auto-derived CNPG app Secret (no extra configuration needed):
The chart automatically references the CNPG-generated app Secret (<cluster-name>-app, key uri)
when no explicit database.connection.existingSecretName is set. With the default cluster name
pangolin-db, the Deployment uses:
secretName: pangolin-db-app
key: uri
This means a basic CNPG setup requires no database.connection overrides at all.
Optional: explicitly reference the CNPG-generated app Secret:
database:
mode: cloudnativepg
# cloudnativepg.cluster.name is optional when cnpg-cluster.fullnameOverride is set
connection:
existingSecretName: pangolin-db-app # created automatically by CNPG
existingSecretKey: uri
cnpg-cluster:
enabled: true
fullnameOverride: pangolin-db
Alternative — let the chart build a connection string from a password Secret:
database:
mode: cloudnativepg
cloudnativepg:
auth:
existingSecretName: my-db-password-secret # Secret with the password
passwordKey: password
connection:
generatedSecret:
create: true
Note: The chart never silently generates a passwordless PostgreSQL connection string. If you enable
database.cloudnativepg.connection.generatedSecret.create=truewithout providing a password source, the chart will fail at render time with a clear error message.
See examples/values-controller-cnpg.yaml for a complete working example.
External PostgreSQL database
For production deployments using an externally managed PostgreSQL server (RDS, Cloud SQL,
self-managed, etc.), set database.mode=external and configure one of these options:
Option A — User-managed Secret (recommended for production)
Create the Secret yourself and reference it. The chart will fail with a clear error (PANGOLIN-061) if no Secret source is configured.
kubectl create secret generic pangolin-ext-db \
--from-literal=connectionString="postgresql://pangolin:[email protected]:5432/pangolin?sslmode=require"
database:
mode: external
connection:
existingSecretName: pangolin-ext-db # pre-existing Secret
existingSecretKey: connectionString
Option B — Chart-managed Secret from a full connection string
database:
mode: external
external:
generatedSecret:
create: true
connectionString: "postgresql://pangolin:[email protected]:5432/pangolin?sslmode=require"
Option C — Chart-managed Secret from individual connection parameters
database:
mode: external
external:
generatedSecret:
create: true
host: db.example.com
port: 5432
database: pangolin
username: pangolin
password: s3cr3t
sslMode: require
Note: Setting
database.mode=externalwithout any Secret source configuration will cause Helm to fail at render time with a clearPANGOLIN-061error. This prevents Pangolin from starting with a missing database Secret.
See examples/values-controller-external-db.yaml for a complete working example.
Ingress and Traefik guidance
- In controller mode you typically expose Pangolin via Traefik CRDs/IngressRoute resources.
pangolin.config.traefikconfigures the Traefik output Pangolin generates inconfig.yml; it does not install Traefik.- The chart renders
pangolin.config.traefikby default so entrypoint and cert resolver names are explicit. Reviewpangolin.config.traefik.http_entrypoint,https_entrypoint, andcert_resolverso they match your real Traefik deployment. - If you enable the bundled Traefik dependency, put Traefik chart overrides under the
traefikController:key (the dependency is aliased). - In standalone mode, Traefik dashboard is disabled by default and the Service does not expose the admin port.
Chart-managed dashboard IngressRoute (controller mode)
By default (pangolin.ingressRoute.dashboard.enabled=true) the chart renders a Traefik IngressRoute
for the Pangolin dashboard/API when deployment.type=controller.
- Host defaults to
pangolin.config.app.dashboard_url(hostname extracted from URL), or setpangolin.ingressRoute.dashboard.host. - API route:
Host(<host>) && PathPrefix(/api/v1)->pangolin.service.ports.external(default3000), priority100. - Dashboard route:
Host(<host>)->pangolin.service.ports.next(default3002), priority10. tls.certResolverandtls.secretNameare mutually exclusive when TLS is enabled.tls.secretNamereferences a Secret in the same namespace as theIngressRoute(Traefik CRD cross-namespace Secret usage is provider-dependent and not configured by this chart).- To target one Traefik instance in multi-controller setups, add
pangolin.ingressRoute.dashboard.traefikSelectorLabels(metadata labels matched by the providerlabelSelector). ingressClassNameis mapped tometadata.annotations["kubernetes.io/ingress.class"]for CRD-provider ingress-class filtering.
Example: certResolver mode
pangolin:
config:
app:
dashboard_url: "https://pangolin-e2e.example.com"
ingressRoute:
dashboard:
enabled: true
tls:
certResolver: letsencrypt
Example: existing TLS Secret mode
pangolin:
ingressRoute:
dashboard:
enabled: true
tls:
certResolver: ""
secretName: pangolin-dashboard-tls
Example: multi-Traefik labelSelector mode
pangolin:
ingressRoute:
dashboard:
enabled: true
traefikSelectorLabels:
traefik-instance: public
Security and permissions
- Gerbil/WireGuard: Gerbil typically needs to run as root and requires Linux capabilities like
NET_ADMIN/SYS_MODULEfor WireGuard tunnel management. Do not “blindly harden” Gerbil without validating WireGuard functionality in your environment. - NetworkPolicy: By default, the chart does not allow broad HTTPS egress to the internet. If your deployment needs outbound TCP/443, explicitly enable it (or, preferably, add a scoped allow-list via
networkPolicy.extraEgress). - ServiceAccount token automount (least-privilege):
- Controller (
serviceAccount.controller.automountServiceAccountToken=true, default): the pangolin-kube-controller must call the Kubernetes API to reconcile Traefik CRDs, manage EndpointSlices, and (optionally) perform leader election. It therefore requires a mounted ServiceAccount token. The matching RBAC Role/ClusterRole is only bound to the controller ServiceAccount. - Pangolin (
serviceAccount.pangolin.automountServiceAccountToken=false, default): the main Pangolin application server does not require Kubernetes API access. Keeping automount disabled follows the least-privilege principle and prevents accidental in-cluster API calls. - Gerbil (
serviceAccount.gerbil.automountServiceAccountToken=false, default): Gerbil manages WireGuard tunnels and does not require Kubernetes API access. Token automount is disabled by default. - All three settings are configurable via
serviceAccount.<component>.automountServiceAccountToken.
- Controller (
- Single mode ServiceAccount trade-off: Kubernetes ServiceAccount selection is Pod-level. In
deployment.mode=single+deployment.type=controller, the shared Pod uses the controller ServiceAccount/token so Pangolin and Gerbil share that Pod-level token behavior. - Container security context:
global.containerSecurityContextis intentionally empty by default so you can choose a baseline that matches your cluster policy. Workloads merge this with their own*.securityContext.
Production checklist
- Use
deployment.type=controllerunless you have a reason not to. - Use
cloudnativepgorexternalfor the database; avoidsqlitein production. - For CloudNativePG (recommended):
- The chart automatically references the CNPG-generated app Secret (
<cluster-name>-app, keyuri). No extradatabase.connectionconfiguration is needed for the default setup. - Or explicitly reference it via
database.connection.existingSecretName: <cluster-name>-app/existingSecretKey: uri - Or provide a password and set
database.cloudnativepg.connection.generatedSecret.create=true
- The chart automatically references the CNPG-generated app Secret (
- Provide externally managed Secrets where appropriate:
pangolin.secret.existingSecretName(Pangolin app server secret)- database connection Secret (
database.connection.existingSecretName)
- Review
pangolin.config.traefik.*so Pangolin emits routes for the same Traefik entrypoints and certificate resolver names your cluster actually uses. - For external PostgreSQL:
- User-managed Se
Deploy pangolin with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pangolin 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpangolin is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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