pangolin-cli
by Fossorial
Helm chart to run Pangolin sites with the Pangolin CLI (fosrl/cli)
About this chart
Pangolin CLI Helm Chart
Helm chart to run Pangolin sites with the Pangolin CLI (fosrl/cli)
Each entry in siteInstances becomes a Deployment running pangolin-cli up site,
which connects a Pangolin site from inside the cluster.
How the site is configured
- Image:
docker.io/fosrl/pangolin-cli(also published asghcr.io/fosrl/cli). - Command: the container always runs
pangolin-cli up site. The image entrypoint is not used, because it callsupdate-ca-certificatesand exits as the chart's default non-root user on a read-only root filesystem. - Settings are passed as environment variables by default, or as command-line flags with
useCommandArgs: true. Site-specific variables use theSITE_prefix (SITE_ID,SITE_SECRET,SITE_PROVISIONING_KEY,SITE_NAME,SITE_UDP_PROXY_IDLE_TIMEOUT,SITE_METRICS_PROMETHEUS_ENABLED,SITE_METRICS_OTLP_ENABLED,SITE_METRICS_ASYNC_BYTES,SITE_ADMIN_ADDR,SITE_REGION,SITE_PPROF_ENABLED). The rest (PANGOLIN_ENDPOINT,LOG_LEVEL,MTU, ...) have no prefix. - Credentials come from a Secret with the keys
PANGOLIN_ENDPOINT,SITE_IDandSITE_SECRET. Useauth.keysif your Secret names them differently. - Pods carry
app.kubernetes.io/component: siteandpangolin-cli.instance: <name>, and the container is namedsite.
✨ Features
- Env var or CLI flag configuration
- Provisioning key support (key-based bootstrap)
- First-class writable config persistence for CONFIG_FILE (emptyDir or existing PVC)
- Provisioning blueprint support (single-use)
- Optional mTLS (PKCS12) secret mount
- Optional up/down script injection
- Native WireGuard (privileged) mode (opt-in)
- Health file based probes & helm test Jobs
- RBAC Role/ClusterRole (opt-in)
- NetworkPolicy (opt-in)
- Prometheus metrics, PodMonitor, ServiceMonitor, PrometheusRule (opt-in)
- Optional pprof endpoint enablement (opt-in)
- Multi-instance (array-driven) deployments with per-instance overrides
Prerequisites
- Kubernetes >= 1.30.14
- Helm 3.x
- kubectl >= v1.30.14
- Site credentials (ID and secret) or a provisioning key from Pangolin
Quick Start
helm repo add fossorial https://charts.fossorial.io
helm repo update fossorial
kubectl create secret generic pangolin-site \
--from-literal=PANGOLIN_ENDPOINT=https://pangolin.example.com \
--from-literal=SITE_ID=<site-id> \
--from-literal=SITE_SECRET=<site-secret>
helm install my-site fossorial/pangolin-cli \
--set siteInstances[0].name=main-tunnel \
--set siteInstances[0].enabled=true \
--set siteInstances[0].auth.existingSecretName=pangolin-site
Replace the <site-id> and <site-secret> placeholders with the credentials Pangolin
shows when you create the site. To have the site created for you instead, use a
provisioning key as in the examples below.
Provisioning examples
Provisioning (emptyDir) + writable config persistence
siteInstances:
- name: main-tunnel
enabled: true
pangolinEndpoint: https://pangolin.example.com
provisioningKey: "YOUR_PROVISIONING_KEY"
siteName: "my-site"
# Required for provisioning-based installs so the CLI can write credentials
configPersistence:
enabled: true
type: emptyDir
mountPath: /var/lib/pangolin
fileName: config.json
Provisioning (existing PVC) + writable config persistence
siteInstances:
- name: main-tunnel
enabled: true
pangolinEndpoint: https://pangolin.example.com
provisioningKey: "YOUR_PROVISIONING_KEY"
siteName: "my-site"
configPersistence:
enabled: true
type: persistentVolumeClaim
existingClaim: my-site-config
mountPath: /var/lib/pangolin
fileName: config.json
Provisioning blueprint (single-use)
siteInstances:
- name: main-tunnel
enabled: true
pangolinEndpoint: https://pangolin.example.com
provisioningKey: "YOUR_PROVISIONING_KEY"
siteName: "my-site"
configPersistence:
enabled: true
type: emptyDir
provisioningBlueprintFile: /etc/pangolin/provisioning-blueprint.yaml
provisioningBlueprintData: |
version: 1
routes: []
pprof enablement
global:
metrics:
pprofEnabled: true
Values
| Key | Type | Default | Description |
|---|---|---|---|
| global.additionalAnnotations | object | {} | Additional annotations applied to all rendered resources. |
| global.additionalLabels | object | {} | Additional labels applied to all rendered resources. |
| global.additionalServiceAnnotations | object | {} | Additional annotations applied to external Service resources. |
| global.additionalServiceLabels | object | {} | Additional labels applied to external Service resources. |
| global.affinity | object | {"nodeAffinity":{},"podAffinity":{},"podAntiAffinity":{}} | Pod affinity and anti-affinity |
| global.affinity.nodeAffinity | object | {} | Node affinity rules |
| global.affinity.podAffinity | object | {} | Pod affinity rules |
| global.affinity.podAntiAffinity | object | {} | Pod anti-affinity rules |
| global.deploymentAnnotations | object | {} | Additional annotations applied to Deployment resources. |
| global.deploymentLabels | object | {} | Additional labels applied to Deployment resources. |
| global.extraEnv | object | {} | Extra environment variables injected into all containers (global scope). Map format: KEY: "value" |
| global.fullnameOverride | string | "" | Fully override the computed fullname. |
| global.health | object | {"enabled":false,"path":"/tmp/healthy","readinessFailureThreshold":3} | --------------------------------------------------------------------------- |
| global.health.path | string | "/tmp/healthy" | Health file path checked by probes |
| global.health.readinessFailureThreshold | int | 3 | Readiness probe failure threshold |
| global.image | object | {"digest":"","imagePullPolicy":"IfNotPresent","imagePullSecrets":[],"registry":"docker.io","repository":"fosrl/pangolin-cli","tag":""} | Global container image configuration used by all chart components. |
| global.image.digest | string | "" | Image digest (overrides tag when set). Format: sha256:<64-hex>. |
| global.image.imagePullPolicy | string | "IfNotPresent" | Image pull policy. |
| global.image.imagePullSecrets | list | [] | Image pull secrets (list of Kubernetes Secret references). Each entry should be an object like: { name: "my-secret" } |
| global.image.registry | string | "docker.io" | Container image registry (e.g., docker.io, ghcr.io, registry.example.com). |
| global.image.repository | string | "fosrl/pangolin-cli" | Container image repository (e.g., fosrl/pangolin-cli). |
| global.image.tag | string | "" | Image tag (defaults to Chart.appVersion if empty). |
| global.logLevel | string | "INFO" | Global log level |
| global.metrics | object | {"adminAddr":":2112","annotations":{},"asyncBytes":false,"enabled":false,"otel":{"exporterOtlpEndpoint":"","exporterOtlpHeaders":"","exporterOtlpProtocol":"","serviceName":""},"otlpEnabled":false,"path":"/metrics","podMonitor":{"annotations":{},"apiVersion":"monitoring.coreos.com/v1","enabled":false,"honorLabels":true,"interval":"30s","labels":{},"metricRelabelings":[],"namespace":"","path":"/metrics","portName":"metrics","relabelings":[],"scheme":"http","scrapeTimeout":"10s"},"port":9090,"portName":"metrics","pprofEnabled":false,"prometheusRule":{"apiVersion":"monitoring.coreos.com/v1","enabled":false,"labels":{},"namespace":"","rules":[]},"region":"","service":{"annotations":{},"enabled":false,"port":2112,"portName":"metrics","type":"ClusterIP"},"serviceMonitor":{"apiVersion":"monitoring.coreos.com/v1","enabled":false,"interval":"30s","jobLabel":"","labels":{},"metricRelabelings":[],"namespace":"","relabelings":[],"sampleLimit":0,"scheme":"http","scrapeTimeout":"10s","targetLabels":[]},"targetPortName":""} | --------------------------------------------------------------------------- @section Global Metrics |
| global.metrics.adminAddr | string | ":2112" | Address the site binds for the metrics/admin server (SITE_ADMIN_ADDR). AUTHORITATIVE for the metrics port: the container port, the Service targetPort and the prometheus.io/port annotation are all derived from it, so they cannot drift apart the way they did before (#16). ":2112" listens on all interfaces, which in-cluster Prometheus scraping requires. "127.0.0.1:2112" restricts to loopback and therefore disables scraping. |
| global.metrics.annotations | object | {} | Extra annotations added to metrics-related objects (e.g., Pods/Service depending on chart logic) |
| global.metrics.asyncBytes | bool | false | Enable async bytes metrics (SITE_METRICS_ASYNC_BYTES) |
| global.metrics.enabled | bool | false | Enable Prometheus-compatible metrics exposure |
| global.metrics.otel | object | {"exporterOtlpEndpoint":"","exporterOtlpHeaders":"","exporterOtlpProtocol":"","serviceName":""} | OTEL exporter configuration (used when otlpEnabled=true) These are passed as environment variables to the container |
| global.metrics.otel.exporterOtlpEndpoint | string | "" | OTLP endpoint (OTEL_EXPORTER_OTLP_ENDPOINT) |
| global.metrics.otel.exporterOtlpHeaders | string | "" | OTLP headers (OTEL_EXPORTER_OTLP_HEADERS) - comma-separated key=value pairs |
| global.metrics.otel.exporterOtlpProtocol | string | "" | OTLP exporter protocol (OTEL_EXPORTER_OTLP_PROTOCOL) - grpc, http/protobuf, or http/json |
| global.metrics.otel.serviceName | string | "" | Service name for OTLP (OTEL_SERVICE_NAME) |
| global.metrics.otlpEnabled | bool | false | Enable OTLP exporter (SITE_METRICS_OTLP_ENABLED) |
| global.metrics.path | string | "/metrics" | Metrics HTTP path |
| global.metrics.podMonitor | object | {"annotations":{},"apiVersion":"monitoring.coreos.com/v1","enabled":false,"honorLabels":true,"interval":"30s","labels":{},"metricRelabelings":[],"namespace":"","path":"/metrics","portName":"metrics","relabelings":[],"scheme":"http","scrapeTimeout":"10s"} | --------------------------------------------------------------------------- |
| global.metrics.podMonitor.annotations | object | {} | Extra annotations applied to the PodMonitor |
| global.metrics.podMonitor.apiVersion | string | "monitoring.coreos.com/v1" | PodMonitor API version (Prometheus Operator) |
| global.metrics.podMonitor.enabled | bool | false | Create a PodMonitor resource |
| global.metrics.podMonitor.honorLabels | bool | true | Whether to honor labels from the scraped target |
| global.metrics.podMonitor.interval | string | "30s" | Scrape interval (Prometheus duration, e.g., 30s, 1m) |
| global.metrics.podMonitor.labels | object | {} | Extra labels applied to the PodMonitor |
| global.metrics.podMonitor.metricRelabelings | list | [] | Metric relabeling rules (Prometheus Operator schema; treated as opaque objects) |
| global.metrics.podMonitor.namespace | string | "" | Namespace override for PodMonitor (empty = release namespace) |
| global.metrics.podMonitor.path | string | "/metrics" | Metrics path |
| global.metrics.podMonitor.portName | string | "metrics" | Scrape port name (must match a named port on the Pod/Service endpoints) |
| global.metrics.podMonitor.relabelings | list | [] | Relabeling rules (Prometheus Operator schema; treated as opaque objects) |
| global.metrics.podMonitor.scheme | string | "http" | HTTP scheme for scraping |
| global.metrics.podMonitor.scrapeTimeout | string | "10s" | Scrape timeout (must be <= interval) |
| global.metrics.port | int | 9090 | DEPRECATED: use adminAddr, which is the address the site actually binds. Kept for compatibility: when set to a non-default value while adminAddr is still ":2112", it is used as the listen port so existing values files render the same port numbers as before. It no longer defines the container port on its own. |
| global.metrics.portName | string | "metrics" | Optional Service port name (used when creating a Service) |
| global.metrics.pprofEnabled | bool | false | Enable pprof endpoints (SITE_PPROF_ENABLED). Disabled by default. |
| global.metrics.prometheusRule | object | {"apiVersion":"monitoring.coreos.com/v1","enabled":false,"labels":{},"namespace":"","rules":[]} | --------------------------------------------------------------------------- |
| global.metrics.prometheusRule.apiVersion | string | "monitoring.coreos.com/v1" | PrometheusRule API version (Prometheus Operator) |
| global.metrics.prometheusRule.enabled | bool | false | Create a PrometheusRule resource |
| global.metrics.prometheusRule.labels | object | {} | Extra labels applied to the PrometheusRule |
| global.metrics.prometheusRule.namespace | string | "" | Namespace override for PrometheusRule (empty = release namespace) |
| global.metrics.prometheusRule.rules | list | [] | Rule groups/rules (templated). Structure is PrometheusRule-compatible; treated as opaque objects. |
| global.metrics.region | string | "" | Region for metrics/telemetry (SITE_REGION) |
| global.metrics.service | object | {"annotations":{},"enabled":false,"port":2112,"portName":"metrics","type":"ClusterIP"} | --------------------------------------------------------------------------- |
| global.metrics.service.annotations | object | {} | Additional Service annotations |
| global.metrics.service.enabled | bool | false | Create a dedicated Service for metrics scraping |
| global.metrics.service.port | int | 2112 | Service port exposed for scrapi |
Deploy pangolin-cli with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pangolin-cli 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-cli 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