tfy-tailscale-config

by TrueFoundry

Helm chartv0.2.1App 1.102.2MITVerified publisher

Tailscale custom resources for TrueFoundry clusters - ProxyClasses, ProxyGroups, session recording, and tailnet-backed RBAC

About this chart

tfy-tailscale-config

Tailscale custom resources for a TrueFoundry cluster: ProxyClasses, ProxyGroups, session recording, and the RBAC that tailnet identities are impersonated into.

This chart does not install the Tailscale operator. It ships only custom resources, in the same way tfy-cert-manager-config ships only Issuers and Certificates. The operator — and with it the tailscale.com CRDs — must already be installed and reconciled before this chart is applied. Installing both in a single Helm release is not possible: the operator chart templates its CRDs rather than using Helm's crds/ directory, and Helm resolves REST mappings for every rendered object before applying any of them.

Prerequisites

All of these fail silently — a missing one shows up as a ProxyGroup stuck at 0/N proxy backends ready with nothing logged:

  • The Tailscale Kubernetes operator, running and reconciled.
  • Every tag this chart derives, present in the tailnet policy file's tagOwners.
  • A matching autoApprovers.services entry for each Service tag. Note the asymmetry: the key is a tag the Service carries, the value is the tags of devices allowed to advertise it. The recorder deliberately gets no entry.
  • An OAuth client or federated identity carrying the services scope.
  • The tailnet-wide HTTPS Certificates toggle enabled in the admin console.
  • The RBAC bindings applied before the policy file impersonates their groups.

Device tags vs service tags

The single most costly thing to get wrong here. Devices tagged one way and Services another reports healthy and is unreachable.

Set byWhat it tagsMatched by access rules
tailnet.roleTags.*ProxyGroup.spec.tags (a YAML list)the proxy devicesno
serviceTags.*proxyConfig.defaultTags or the tailscale.com/tags annotation (a comma-separated string)the Tailscale Servicesyes

The authoritative value for Ingress- and LoadBalancer-backed Services is proxyConfig.defaultTags on the operator release, which this chart does not own. An explicit tailscale.com/tags annotation overrides it for that Service, so the two must be kept in step.

Egress inverts this. An egress ProxyGroup advertises no Tailscale Service, so there is nothing for serviceTags or proxyConfig.defaultTags to attach to. The only identity in play is the proxy device's, from ProxyGroup.spec.tags — and it appears in the grant as src, not dst. It also needs no autoApprovers.services entry, which is the one place in the policy file where that absence is correct rather than the usual silent stall.

Write-once values

Changing any of these re-registers the device on a new 100.x address and orphans any DNS record pointing at it:

  • clusterSlug
  • proxyGroups.ingress.hostnamePrefix
  • proxyGroups.apiserver.hostname
  • proxyGroups.apiserver.hostnamePrefix
  • proxyGroups.egress.hostnamePrefix
  • recorder.name

Tags are not in this set — retagging needs no device recreate, though a change must be applied to both spec.tags and the device API or it reverts at next provisioning.

Reducing replicas on a ProxyGroup deletes devices and their state Secrets. The ProxyGroup and Recorder templates carry argocd.argoproj.io/sync-options: Prune=false for the same reason.

Cluster archetypes

ci/ holds four worked examples, which double as lint fixtures:

FileShape
control-plane-values.yamlfull install — ingress proxies, recorder, L3 tailnet Services
gateway-pop-values.yamlkubectl access only — no ingress proxies, no recorder
compute-plane-values.yamlegress only — reaches the tailnet, exposes nothing to it
minimal-values.yamlportable core, no TrueFoundry-specific infrastructure

Parameters

Cluster identity

NameDescriptionValue
clusterNameName of the cluster, as supplied by the inframold.cluster-name
clusterSlugShort identifier used in tailnet hostnames and ACL tags. Defaults to clusterName with a leading "tfy-" removed, if present.""

Tailnet device tags

NameDescriptionValue
tailnet.baseTagDevice tag carried by every proxy. Never name this in an access rule -- it is the chart default on every cluster, so a rule naming it silently widens to the whole fleet.tag:k8s
tailnet.roleTagsPer-role DEVICE tags. Each defaults to "tag:k8s--". Override to pin an existing tag; tags must match ^tag:[a-zA-Z][a-zA-Z0-9-]*$ (no underscores).{}
tailnet.coarse.envEnvironment token -- dev, stage, prod, demo.""
tailnet.coarse.cloudCloud token -- aws, azu, gcp.""
tailnet.coarse.planePlane token -- ctl, cmp, gtw.""

Tailnet service tags

NameDescriptionValue
serviceTags.ingressComma-separated tags applied to Services fronted by the ingress ProxyGroup. Note this is a STRING, not a list -- unlike ProxyGroup.spec.tags. Defaults to "<tailnet.baseTag>,<tailnet.roleTags.ingress>".""

Placement

NameDescriptionValue
placement.tolerationsTolerations for Tailscale proxy and recorder pods.[]
placement.affinityAffinity for Tailscale proxy and recorder pods.{}
placement.podLabelsLabels applied to proxy and recorder pods.{}
placement.resourcesBaseline resource requests and limits for Tailscale proxy and recorder containers. Each component below can override this; an override REPLACES this block rather than merging into it.{}

Proxy classes

NameDescriptionValue
proxyClasses.default.enabledCreate the default ProxyClass, used by ingress proxies.true
proxyClasses.default.nameName of the default ProxyClass.tfy-default
proxyClasses.default.metricsEnabledExpose proxy metrics.true
proxyClasses.default.serviceMonitor.enabledHave the operator create a Prometheus Operator ServiceMonitor for these proxies. Needs metricsEnabled and the monitoring.coreos.com CRDs.false
proxyClasses.default.serviceMonitor.labelsLabels on the ServiceMonitor. Set whatever the Prometheus serviceMonitorSelector matches (for kube-prometheus-stack, release: ), or it is created and never scraped.{}
proxyClasses.default.resourcesOverrides placement.resources for the ingress/egress ProxyClass. REPLACES that block outright -- it is not merged, so restate requests as well as limits.{}
proxyClasses.apiserver.enabledCreate the ProxyClass used by the kube-apiserver ProxyGroup.true
proxyClasses.apiserver.nameName of the kube-apiserver ProxyClass.tfy-apiserver
proxyClasses.apiserver.imagePinned k8s-proxy image. This image is NOT settable through the operator chart's values -- a ProxyClass is the only way to override it, and leaving it unpinned runs :latest on the highest-privilege pod in the namespace.tailscale/k8s-proxy:v1.102.2
proxyClasses.apiserver.metricsEnabledExpose proxy metrics.true
proxyClasses.apiserver.serviceMonitor.enabledHave the operator create a Prometheus Operator ServiceMonitor for these proxies. Needs metricsEnabled and the monitoring.coreos.com CRDs.false
proxyClasses.apiserver.serviceMonitor.labelsLabels on the ServiceMonitor. Set whatever the Prometheus serviceMonitorSelector matches (for kube-prometheus-stack, release: ), or it is created and never scraped.{}
proxyClasses.apiserver.resourcesOverrides placement.resources for the kube-apiserver ProxyClass. REPLACES that block outright -- it is not merged, so restate requests as well as limits.{}

Proxy groups

NameDescriptionValue
proxyGroups.ingress.enabledDeploy a ProxyGroup of type "ingress".true
proxyGroups.ingress.nameKubernetes object name of the ingress ProxyGroup.ingress-proxies
proxyGroups.ingress.replicasNumber of ingress proxy replicas. Reducing this DELETES devices and their state Secrets -- it is not a safe casual edit.2
proxyGroups.ingress.hostnamePrefixTailnet-global device hostname prefix. Defaults to "-ing". Max 62 chars, lowercase, must match ^[a-z0-9][a-z0-9-]{0,61}$.""
proxyGroups.apiserver.enabled

Deploy tfy-tailscale-config with OpenTenant

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