tailscale

by harish2k01

Helm chartv0.1.9App v1.104.7BSD-3-ClauseVerified publisher

Deploys Tailscale as a Kubernetes subnet router and exit node

About this chart

Tailscale Helm Chart

Browse the Helm chart catalog to explore available charts and installation commands.

This chart deploys the official Tailscale container as Kubernetes subnet router and exit node pods. It is intended for homelab clusters where you want the same behavior as a normal host/LXC install without using the Tailscale Kubernetes operator.

The chart follows the standard Tailscale container environment variables documented by Tailscale, including TS_AUTHKEY, TS_STATE_DIR, TS_USERSPACE, TS_ROUTES, TS_EXTRA_ARGS, and the health/metrics endpoint.

[!NOTE] This is an unofficial community Helm chart maintained by harish2k01. It is not affiliated with or endorsed by the upstream project. For chart issues, questions, or improvements, please open an issue in the harish2k01/helm-charts repository.

Install

helm repo add harish2k01 https://charts.harish2k01.in
helm repo update
helm install tailscale harish2k01/tailscale

Install From OCI

This chart is also published as an OCI chart in GHCR. Use the same values and namespace flags with the OCI reference:

helm install tailscale oci://ghcr.io/harish2k01/helm-charts/tailscale --version 0.1.9

Create an auth key Secret before installing, or set authKey.create=true only for private values files:

kubectl create namespace networking
kubectl create secret generic tailscale-auth \
  --namespace networking \
  --from-literal=TS_AUTHKEY='tskey-auth-...'

helm install tailscale harish2k01/tailscale \
  --namespace networking \
  --set authKey.existingSecret=tailscale-auth

After the pod starts, approve the advertised routes and exit node in the Tailscale admin console.

Subnet Router And Exit Node

The default values advertise 192.168.0.0/24 and enable --advertise-exit-node, mirroring a normal installation that runs:

tailscale up --advertise-routes=192.168.0.0/24 --advertise-exit-node

Change the route to match your LAN:

tailscale:
  hostname: homelab-router
  advertiseExitNode: true
  routes:
    - 192.168.1.0/24

Kubernetes Netfilter Troubleshooting

Subnet router and exit-node traffic requires Linux forwarding plus firewall/NAT rules. If the pod is running and can reach your LAN itself, but tailnet clients cannot reach the advertised subnet, check the Tailscale health output and logs:

kubectl -n <namespace> exec tailscale-0 -- tailscale status
kubectl -n <namespace> exec tailscale-0 -- tailscale debug prefs
kubectl -n <namespace> logs statefulset/tailscale --tail=100

If you see errors like can't initialize iptables table 'filter', can't initialize iptables table 'nat', or modprobe: can't change directory to '/lib/modules', the container cannot use the legacy iptables path to create the rules needed for subnet routing. In clusters where nftables is available, you can let Tailscale auto-detect the firewall backend:

tailscale:
  extraEnv:
    TS_DEBUG_FIREWALL_MODE: auto

After applying the value, restart the StatefulSet and confirm the logs report the selected firewall mode. If netfilter still cannot be configured from the pod, load the required kernel modules on the Kubernetes nodes or run the subnet router on a normal host, VM, or LXC where Tailscale can manage firewall rules.

When using persisted state with tailscale.authOnce=true, previously saved preferences can survive value changes. If you remove exit-node advertisement or change route settings and the pod still shows old preferences, temporarily set:

tailscale:
  authOnce: false
  extraArgs:
    - --reset

Then restart the pod so the official container resets old non-default preferences and re-applies TS_ROUTES and TS_EXTRA_ARGS from the current Helm values. After the pod starts cleanly and tailscale debug prefs shows only the expected routes, you can remove --reset and set authOnce back to your preferred value.

Host Network

By default the pod joins the tailnet as its own machine, so its tailnet IP and MagicDNS name reach the pod, not the Kubernetes node. To make the node itself the tailnet machine, for example to reach SSH or the Kubernetes API on the node through its MagicDNS name, enable host networking:

hostNetwork: true
tailscale:
  hostname: my-node
  hostnameFromPodName: false
  advertiseExitNode: false
  routes: []

Tailscale then manages the node's interfaces, routes, and firewall rules directly, and the sysctl init container changes the node's forwarding settings. The chart enforces at most one host-network Tailscale pod per node using required hostname anti-affinity, including across releases and namespaces of this chart. This rule is added to your existing affinity settings even when the health/metrics ports are disabled. With fewer eligible nodes than replicas, extra replicas remain Pending. Use nodeSelector, tolerations, and affinity to choose eligible nodes, and avoid nodes already running a separate host Tailscale daemon. The label tailscale.harish2k01.in/host-network is reserved by the chart.

An empty dnsPolicy uses ClusterFirstWithHostNet in this mode and the Kubernetes default ClusterFirst otherwise. Explicit overrides support ClusterFirst, ClusterFirstWithHostNet, and Default. None is rejected because this chart does not expose the required dnsConfig.

Security Notes

Kernel networking requires /dev/net/tun, NET_ADMIN, and NET_RAW. The chart also enables an init container that sets IPv4 and IPv6 forwarding inside the pod network namespace, matching the sysctl step commonly used for bare-metal and LXC installs.

Persistent state is enabled by default at /var/lib/tailscale so each pod keeps the same tailnet identity across restarts. The chart uses a StatefulSet, so replicaCount: 2 creates two independent routers, for example tailscale-0 and tailscale-1, each with its own state PVC. Approve the advertised routes and exit-node setting for each router in the Tailscale admin console.

Values

KeyTypeDefaultDescription
replicaCountint1Number of independent Tailscale router pods
image.repositorystringtailscale/tailscaleContainer image repository
image.tagstringv1.104.7Versioned container image tag, suitable for Renovate updates
image.pullPolicystringIfNotPresentContainer pull policy
hostNetworkboolfalseRun the pod in the node's network namespace so the node itself joins the tailnet
dnsPolicystring""Pod DNS policy; empty uses ClusterFirst, or ClusterFirstWithHostNet with hostNetwork
securityContext.privilegedbooltrueEnables privileges required for tun/kernel networking
sysctl.enabledbooltrueRuns an init container to enable IP forwarding
authKey.enabledbooltrueInject auth-key Secret; disable for OAuth/workload identity through extraEnv/envFrom
authKey.existingSecretstring""Existing Secret containing the Tailscale auth key
authKey.existingSecretKeystringTS_AUTHKEYSecret key name for the auth key
authKey.createboolfalseCreate an auth Secret from authKey.value
authKey.valuestring""Auth key value when authKey.create=true
tailscale.hostnamestringtailscale-routerTailnet hostname
tailscale.hostnameFromPodNamebooltrueUse the StatefulSet pod name as the tailnet hostname
tailscale.hostnamePrefixstring""Optional prefix for pod-derived hostnames
tailscale.stateDirstring/var/lib/tailscaleTailscale state directory
tailscale.kubeSecretstring""Disables Kubernetes Secret state when using PVC-backed state
tailscale.userspaceboolfalseUse userspace networking instead of kernel networking
tailscale.acceptDnsboolfalseAccept DNS settings from the tailnet
tailscale.authOncebooltrueAuthenticate only when state is not already present
tailscale.advertiseExitNodebooltrueAdd --advertise-exit-node to TS_EXTRA_ARGS
tailscale.bootTimeoutstring""Optional initial control-plane connection timeout, such as 90s or 3m; empty keeps the upstream 60s default
tailscale.routeslist[192.168.0.0/24]Subnet routes advertised to the tailnet through TS_ROUTES
tailscale.extraArgslist[]Additional flags appended to TS_EXTRA_ARGS
tailscale.tailscaledExtraArgslist[]Additional flags passed through TS_TAILSCALED_EXTRA_ARGS
tailscale.extraEnvobject{}Additional official Tailscale container environment variables, such as TS_DEBUG_FIREWALL_MODE
persistence.enabledbooltruePersist Tailscale state
persistence.sizestring1GiState PVC size
persistence.storageClassNamestring""Optional storage class
service.enabledbooltrueExpose health and metrics endpoint
service.portint9002Health and metrics service port
tunDevice.enabledbooltrueMount /dev/net/tun from the host
resourcesobject{}Container resource requests and limits
nodeSelectorobject{}Pod node selector
tolerationslist[]Pod tolerations
affinityobject{}Pod affinity
topologySpreadConstraintslist[]Pod topology spread constraints for separating replicas across zones or nodes

Upgrade history

See CHANGELOG.md for application changes and compatibility notes.

StatefulSet claim labels

Claim templates use stable identity labels so chart/app version changes do not modify immutable storage metadata. Normal workload labels still report the current versions. The following values merge explicitly pinned labels into each claim template:

  • persistence.claimTemplateLabels

For an existing StatefulSet created by an older chart, copy the labels from its current spec.volumeClaimTemplates[].metadata.labels into the corresponding map before the first upgrade. Keep any historical helm.sh/chart and app.kubernetes.io/version labels fixed there; they describe the original claim template, not the running app. This preserves the immutable template without deleting or replacing the StatefulSet/PVC. Empty defaults suit new installations. Helm lookup is not required, so GitOps/offline rendering remains deterministic. Do not remove pinned labels later without a separately planned migration. Storage size, claim names, access modes and other immutable fields have their own migration constraints.

Deploy tailscale with OpenTenant

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