pangolin-cli

by Fossorial

Helm chartv0.1.0App 0.20.0MITVerified publisher

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 as ghcr.io/fosrl/cli).
  • Command: the container always runs pangolin-cli up site. The image entrypoint is not used, because it calls update-ca-certificates and 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 the SITE_ 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_ID and SITE_SECRET. Use auth.keys if your Secret names them differently.
  • Pods carry app.kubernetes.io/component: site and pangolin-cli.instance: <name>, and the container is named site.

✨ 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

KeyTypeDefaultDescription
global.additionalAnnotationsobject{}Additional annotations applied to all rendered resources.
global.additionalLabelsobject{}Additional labels applied to all rendered resources.
global.additionalServiceAnnotationsobject{}Additional annotations applied to external Service resources.
global.additionalServiceLabelsobject{}Additional labels applied to external Service resources.
global.affinityobject{"nodeAffinity":{},"podAffinity":{},"podAntiAffinity":{}}Pod affinity and anti-affinity
global.affinity.nodeAffinityobject{}Node affinity rules
global.affinity.podAffinityobject{}Pod affinity rules
global.affinity.podAntiAffinityobject{}Pod anti-affinity rules
global.deploymentAnnotationsobject{}Additional annotations applied to Deployment resources.
global.deploymentLabelsobject{}Additional labels applied to Deployment resources.
global.extraEnvobject{}Extra environment variables injected into all containers (global scope). Map format: KEY: "value"
global.fullnameOverridestring""Fully override the computed fullname.
global.healthobject{"enabled":false,"path":"/tmp/healthy","readinessFailureThreshold":3}---------------------------------------------------------------------------
global.health.pathstring"/tmp/healthy"Health file path checked by probes
global.health.readinessFailureThresholdint3Readiness probe failure threshold
global.imageobject{"digest":"","imagePullPolicy":"IfNotPresent","imagePullSecrets":[],"registry":"docker.io","repository":"fosrl/pangolin-cli","tag":""}Global container image configuration used by all chart components.
global.image.digeststring""Image digest (overrides tag when set). Format: sha256:<64-hex>.
global.image.imagePullPolicystring"IfNotPresent"Image pull policy.
global.image.imagePullSecretslist[]Image pull secrets (list of Kubernetes Secret references). Each entry should be an object like: { name: "my-secret" }
global.image.registrystring"docker.io"Container image registry (e.g., docker.io, ghcr.io, registry.example.com).
global.image.repositorystring"fosrl/pangolin-cli"Container image repository (e.g., fosrl/pangolin-cli).
global.image.tagstring""Image tag (defaults to Chart.appVersion if empty).
global.logLevelstring"INFO"Global log level
global.metricsobject{"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.adminAddrstring":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.annotationsobject{}Extra annotations added to metrics-related objects (e.g., Pods/Service depending on chart logic)
global.metrics.asyncBytesboolfalseEnable async bytes metrics (SITE_METRICS_ASYNC_BYTES)
global.metrics.enabledboolfalseEnable Prometheus-compatible metrics exposure
global.metrics.otelobject{"exporterOtlpEndpoint":"","exporterOtlpHeaders":"","exporterOtlpProtocol":"","serviceName":""}OTEL exporter configuration (used when otlpEnabled=true) These are passed as environment variables to the container
global.metrics.otel.exporterOtlpEndpointstring""OTLP endpoint (OTEL_EXPORTER_OTLP_ENDPOINT)
global.metrics.otel.exporterOtlpHeadersstring""OTLP headers (OTEL_EXPORTER_OTLP_HEADERS) - comma-separated key=value pairs
global.metrics.otel.exporterOtlpProtocolstring""OTLP exporter protocol (OTEL_EXPORTER_OTLP_PROTOCOL) - grpc, http/protobuf, or http/json
global.metrics.otel.serviceNamestring""Service name for OTLP (OTEL_SERVICE_NAME)
global.metrics.otlpEnabledboolfalseEnable OTLP exporter (SITE_METRICS_OTLP_ENABLED)
global.metrics.pathstring"/metrics"Metrics HTTP path
global.metrics.podMonitorobject{"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.annotationsobject{}Extra annotations applied to the PodMonitor
global.metrics.podMonitor.apiVersionstring"monitoring.coreos.com/v1"PodMonitor API version (Prometheus Operator)
global.metrics.podMonitor.enabledboolfalseCreate a PodMonitor resource
global.metrics.podMonitor.honorLabelsbooltrueWhether to honor labels from the scraped target
global.metrics.podMonitor.intervalstring"30s"Scrape interval (Prometheus duration, e.g., 30s, 1m)
global.metrics.podMonitor.labelsobject{}Extra labels applied to the PodMonitor
global.metrics.podMonitor.metricRelabelingslist[]Metric relabeling rules (Prometheus Operator schema; treated as opaque objects)
global.metrics.podMonitor.namespacestring""Namespace override for PodMonitor (empty = release namespace)
global.metrics.podMonitor.pathstring"/metrics"Metrics path
global.metrics.podMonitor.portNamestring"metrics"Scrape port name (must match a named port on the Pod/Service endpoints)
global.metrics.podMonitor.relabelingslist[]Relabeling rules (Prometheus Operator schema; treated as opaque objects)
global.metrics.podMonitor.schemestring"http"HTTP scheme for scraping
global.metrics.podMonitor.scrapeTimeoutstring"10s"Scrape timeout (must be <= interval)
global.metrics.portint9090DEPRECATED: 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.portNamestring"metrics"Optional Service port name (used when creating a Service)
global.metrics.pprofEnabledboolfalseEnable pprof endpoints (SITE_PPROF_ENABLED). Disabled by default.
global.metrics.prometheusRuleobject{"apiVersion":"monitoring.coreos.com/v1","enabled":false,"labels":{},"namespace":"","rules":[]}---------------------------------------------------------------------------
global.metrics.prometheusRule.apiVersionstring"monitoring.coreos.com/v1"PrometheusRule API version (Prometheus Operator)
global.metrics.prometheusRule.enabledboolfalseCreate a PrometheusRule resource
global.metrics.prometheusRule.labelsobject{}Extra labels applied to the PrometheusRule
global.metrics.prometheusRule.namespacestring""Namespace override for PrometheusRule (empty = release namespace)
global.metrics.prometheusRule.ruleslist[]Rule groups/rules (templated). Structure is PrometheusRule-compatible; treated as opaque objects.
global.metrics.regionstring""Region for metrics/telemetry (SITE_REGION)
global.metrics.serviceobject{"annotations":{},"enabled":false,"port":2112,"portName":"metrics","type":"ClusterIP"}---------------------------------------------------------------------------
global.metrics.service.annotationsobject{}Additional Service annotations
global.metrics.service.enabledboolfalseCreate a dedicated Service for metrics scraping
global.metrics.service.portint2112Service 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpangolin-cli is pinned at v0.1.0 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