pangolin-node

by Fossorial

Helm chartv0.1.1App 1.7.0MITVerified publisher

Pangolin remote node (Pangolin Node, Gerbil and Traefik) connected to a managed Pangolin control plane

About this chart

Pangolin Node Helm Chart

Pangolin remote node (Pangolin Node, Gerbil and Traefik) connected to a managed Pangolin control plane

A remote node is a Pangolin exit node that you host while the control plane stays on Pangolin Cloud (or another managed Pangolin). It has no controller and no database. It is the same three containers as the docker-compose install, run in one Pod:

ContainerRole
pangolin-nodeConnects to the control plane with the node ID and secret, writes the Traefik router config to /var/dynamic and TLS certificates to /var/certificates, and answers Badger and Gerbil on 127.0.0.1:3001.
gerbilWireGuard for sites (51820/udp) and clients (21820/udp), plus the SNI proxy on 8443 that receives public 443 and hands local hostnames to Traefik with PROXY protocol.
traefikReads /var/dynamic and /var/certificates read-only and routes requests over Gerbil's WireGuard interface, with the Badger plugin for authentication.

Why one Pod

  • pangolin-node and traefik share /var/dynamic and /var/certificates. In one Pod these are emptyDirs, so the chart needs no ReadWriteMany storage. pangolin-node refills both on startup.
  • Traefik must sit in Gerbil's network namespace to reach tunnel backends (the compose network_mode: service:gerbil).
  • pangolin-node runs as a native sidecar (an init container with restartPolicy: Always). Gerbil and Traefik start only after its startup probe passes, which replaces the compose depends_on: condition: service_healthy.

Differences from the full Pangolin chart

  • No database, controller, dashboard or integration API.
  • config.yml holds only app, server, managed, traefik and gerbil (see server/lib/readConfigFile.ts in pangolin-node). The chart sets server.internal_hostname and gerbil.reachable_at to 127.0.0.1 for the single-Pod layout.
  • Traefik uses the file provider on /var/dynamic instead of Pangolin's HTTP provider, and certificates come from the control plane instead of ACME.

Prerequisites

  • Kubernetes >= 1.30.14 (native sidecars)

  • Helm 3.x

  • A remote node ID and secret from the Pangolin dashboard

  • A namespace that allows NET_ADMIN:

    kubectl label ns pangolin pod-security.kubernetes.io/enforce=privileged --overwrite
    
  • Public reachability for 80/tcp, 443/tcp, 51820/udp and 21820/udp, through a LoadBalancer that supports mixed TCP/UDP Services or through hostPorts

  • Egress to the control plane endpoint and to github.com (Traefik downloads Badger on startup)

Install

helm repo add fossorial https://charts.fossorial.io
helm repo update fossorial

helm install pangolin-node fossorial/pangolin-node \
  --namespace pangolin --create-namespace \
  --set config.managed.id=<node id> \
  --set config.managed.secret=<node secret> \
  --set config.gerbil.base_endpoint=node.example.com

To keep the credentials out of Helm values, create a Secret and point config.managed.existingSecret at it; an init container merges it into config.yml:

kubectl -n pangolin create secret generic pangolin-node-credentials \
  --from-literal=id=<node id> --from-literal=secret=<node secret>

helm install pangolin-node fossorial/pangolin-node -n pangolin \
  --set config.managed.existingSecret=pangolin-node-credentials \
  --set config.gerbil.base_endpoint=node.example.com

Then point base_endpoint and your resource domains at the Service's external address (or the node IP with hostPorts.enabled=true).

Examples

FileUse
values-loadbalancer.yamlCloud LoadBalancer with mixed TCP/UDP
values-aws-nlb.yamlEKS with the AWS Load Balancer Controller (NLB)
values-hostports.yamlSingle machine or bare metal, ports bound on the node
values-existing-secret.yamlNode ID and secret from an existing Secret
values-full-config-secret.yamlBring your own config.yml

Notes

  • The Deployment always runs one replica with the Recreate strategy. Run another release for another node.
  • The Gerbil WireGuard key lives on a small PVC (gerbil.persistence) that is kept on uninstall. Without it Gerbil generates a new key on every restart.
  • config.gerbil.start_port, gerbil.ports.wg1 and the public WireGuard port (service.ports.wg1 or hostPorts.wg1) must match. The chart refuses to render otherwise.
  • Changing config.managed.existingSecret contents does not restart the Pod; run kubectl rollout restart afterwards.
  • Load balancers that health check UDP target groups over TCP on the traffic port (AWS NLB does by default) mark the WireGuard targets unhealthy, since nothing listens on TCP 51820 or 21820. Point the health check at a TCP port in the Pod, such as Gerbil's API on 3003. See values-aws-nlb.yaml.

Maintainers

NameEmailUrl
Fossorial Inc[email protected]

Source Code

Requirements

Kubernetes: >=1.30.14-0

Values

KeyTypeDefaultDescription
commonAnnotationsobject{}Annotations added to every resource.
commonLabelsobject{}Labels added to every resource.
config.app.audit_logging_enabledbooltrueSend request audit logs to the control plane.
config.app.log_failed_attemptsboolfalseLog failed authentication attempts.
config.app.log_levelstring"info"Log level: debug, info, warn or error.
config.existingSecretstring""Use an existing Secret holding a complete config.yml instead of rendering one from the values below. The Secret must contain the key set in existingSecretKey. When set, everything under config.app, config.managed, config.gerbil and config.extra is ignored.
config.existingSecretKeystring"config.yml"Key inside existingSecret holding config.yml.
config.extraobject{}Extra keys deep-merged into the rendered config.yml, for settings this chart does not model. server.internal_hostname, server.internal_port and gerbil.reachable_at are set by the chart for the single-Pod layout.
config.gerbil.base_endpointstring""Public hostname or IP that sites and clients use to reach this node's WireGuard listener (the address of the Service / node). Required.
config.gerbil.start_portint51820WireGuard listen port announced to the control plane. Keep it equal to gerbil.ports.wg1 and the Service port.
config.managed.endpointstring"https://app.pangolin.net"Control plane URL.
config.managed.existingSecretstring""Read id and secret from an existing Secret instead. An init container merges them into config.yml at startup, so they never appear in Helm values.
config.managed.existingSecretIdKeystring"id"Key in managed.existingSecret holding the node ID.
config.managed.existingSecretSecretKeystring"secret"Key in managed.existingSecret holding the node secret.
config.managed.idstring""Remote node ID from the Pangolin dashboard. Required unless managed.existingSecret or config.existingSecret is set.
config.managed.namestring""Optional display name for the node.
config.managed.redirect_endpointstring""Optional redirect endpoint.
config.managed.secretstring""Remote node secret from the Pangolin dashboard. Required unless managed.existingSecret or config.existingSecret is set.
extraVolumeslist[]Extra Pod volumes, referenced from the extraVolumeMounts lists above.
fullnameOverridestring""Override the full resource name.
gerbil.argslist[]Replace the default args entirely.
gerbil.extraEnvobject{}Extra environment variables (see gerbil's main.go for the full list).
gerbil.extraVolumeMountslist[]
gerbil.logLevelstring"INFO"Gerbil log level.
gerbil.persistence.accessModes[0]string"ReadWriteOnce"
gerbil.persistence.annotationsobject{}
gerbil.persistence.enabledbooltruePersist the WireGuard private key (/var/config/key). Without it Gerbil generates a new key on every restart and re-registers with the control plane.
gerbil.persistence.existingClaimstring""
gerbil.persistence.sizestring"64Mi"
gerbil.persistence.storageClassstring""
gerbil.ports.internalApiint3003Gerbil HTTP API (gerbil.reachable_at). Only reached from inside the Pod.
gerbil.ports.sniint8443SNI proxy port. Public 443 lands here; Gerbil forwards local SNI matches to Traefik's websecure entrypoint with PROXY protocol.
gerbil.ports.wg1int51820WireGuard port for sites.
gerbil.ports.wg2int21820WireGuard port for clients.
gerbil.resources.limits.memorystring"512Mi"
gerbil.resources.requests.cpustring"50m"
gerbil.resources.requests.memorystring"64Mi"
gerbil.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"add":["NET_ADMIN"],"drop":["ALL"]}}Gerbil needs NET_ADMIN for the WireGuard interface and iptables. Add SYS_MODULE if the node must load the wireguard kernel module itself.
hostPortsobject{"enabled":false,"http":80,"https":443,"wg1":51820,"wg2":21820}Expose the public ports on the node with hostPort, the equivalent of the compose ports: block (80, 443, 51820/udp, 21820/udp). Use this on bare-metal or single-node clusters without a LoadBalancer.
imagePullSecretslist[]Image pull secrets for the Pod.
images.configInitobject{"digest":"","pullPolicy":"IfNotPresent","registry":"docker.io","repository":"mikefarah/yq","tag":"4.45.4"}Image for the init container that merges managed.existingSecret into config.yml. Only used when config.managed.existingSecret is set.
images.gerbil.digeststring""
images.gerbil.pullPolicystring"IfNotPresent"
images.gerbil.registrystring"docker.io"
images.gerbil.repositorystring"fosrl/gerbil"
images.gerbil.tagstring"1.6.0"
images.pangolinNode.digeststring""Overrides tag when set.
images.pangolinNode.pullPolicystring"IfNotPresent"
images.pangolinNode.registrystring"docker.io"
images.pangolinNode.repositorystring"fosrl/pangolin-node"
images.pangolinNode.tagstring""Defaults to .Chart.AppVersion.
images.traefik.digeststring""
images.traefik.pullPolicystring"IfNotPresent"
images.traefik.registrystring"docker.io"
images.traefik.repositorystring"traefik"
images.traefik.tagstring"v3.7.19"
nameOverridestring""Override the chart name.
pangolinNode.extraEnvobject{}Extra environment variables.
pangolinNode.extraVolumeMountslist[]
pangolinNode.internalPortint3001Internal API port (server.internal_port). Badger and Gerbil call it on 127.0.0.1.
pangolinNode.livenessProbe.failureThresholdint6
pangolinNode.livenessProbe.httpGet.pathstring"/api/v1/"
pangolinNode.livenessProbe.httpGet.portstring"internal-api"
pangolinNode.livenessProbe.periodSecondsint10
pangolinNode.livenessProbe.timeoutSecondsint10
pangolinNode.readinessProbe.failureThresholdint3
pangolinNode.readinessProbe.httpGet.pathstring"/api/v1/"
pangolinNode.readinessProbe.httpGet.portstring"internal-api"
pangolinNode.readinessProbe.periodSecondsint10
pangolinNode.readinessProbe.timeoutSecondsint10
pangolinNode.resources.limits.memorystring"512Mi"
pangolinNode.resources.requests.cpustring"50m"
pangolinNode.resources.requests.memorystring"128Mi"
pangolinNode.securityContext.allowPrivilegeEscalationboolfalse
pangolinNode.securityContext.capabilities.drop[0]string"ALL"
pangolinNode.startupProbeobject{"failureThreshold":60,"httpGet":{"path":"/api/v1/","port":"internal-api"},"periodSeconds":5,"timeoutSeconds":5}Startup probe. Gerbil and Traefik start only after it passes (the compose depends_on: condition: service_healthy).
pangolinNode.timezonestring""Timezone for log timestamps.
pod.affinityobject{}
pod.annotationsobject{}Extra Pod annotations.
pod.dnsPolicystring""DNS policy. Defaults to ClusterFirstWithHostNet when hostNetwork is true.
pod.hostNetworkboolfalseRun the Pod in the host network namespace. Gerbil's SNI proxy then binds 8443 and Traefik binds 8000/9443/8080 directly on the node, so prefer hostPorts or a LoadBalancer Service unless you need the node's own IP stack.
pod.labelsobject{}Extra Pod labels.
pod.nodeSelectorobject{}
pod.priorityClassNamestring""
pod.securityContextobject`{"seccompPr

Deploy pangolin-node with OpenTenant

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