Use ProxyGroup for high availability proxies

Last validated:

A ProxyGroup manages a StatefulSet of Tailscale proxy replicas. It offers several advantages over the standalone proxy model:

  • High availability: Multiple replicas ensure your services remain accessible even if a proxy pod fails or is rescheduled.
  • Resource consolidation: A single ProxyGroup can handle traffic for multiple Kubernetes Service or Ingress resources, rather than a dedicated proxy per resource.
  • Scalability: Scale the number of proxy replicas up or down to meet traffic demands.

Types

There are three types of ProxyGroup, each designed for a specific use case:

TypeDescription
ingressExpose Kubernetes workloads to your tailnet.
egressEnable pods in your cluster to connect to devices in your tailnet.
kube-apiserverSecurely access the Kubernetes API server over Tailscale.

Created resources

When you deploy a ProxyGroup, the Tailscale Kubernetes Operator creates:

  • A configuration and state Secret per replica.
  • A ServiceAccount, Role, and RoleBinding for the ProxyGroup.
  • A StatefulSet running the specified number of proxy pod replicas (defaults to 2).
  • A ConfigMap containing ingress or egress configuration (for ingress and egress types).
  • If static endpoints are configured through a ProxyClass, a NodePort Service per replica for direct connectivity.

In the Tailscale Kubernetes Operator version 1.106 or later, the StatefulSet uses the Parallel pod management policy. Kubernetes starts each replica without waiting for the others to become ready. A replica that isn't ready, such as one whose device waits for approval, doesn't stop the other replicas from starting. The policy applies to creating and scaling replicas, not to rolling updates. Rolling updates still replace one replica at a time.

Kubernetes can't change the pod management policy of an existing StatefulSet. After you upgrade the operator to version 1.106 or later, the operator replaces each existing ProxyGroup StatefulSet and leaves its pods running, so the proxies continue to serve traffic. If you downgrade the operator to a version earlier than 1.106, refer to ProxyGroup creation fails after an operator downgrade.

How to use

Deploy a ProxyGroup by creating the custom resource with the desired spec.type:

apiVersion: tailscale.com/v1alpha1
kind: ProxyGroup
metadata:
  name: my-proxies
spec:
  type: ingress
  replicas: 2

Then reference it from your Kubernetes Ingress or Service using the tailscale.com/proxy-group annotation:

metadata:
  annotations:
    tailscale.com/proxy-group: my-proxies

For production configuration such as topology spreading, resource limits, and metrics, refer to high availability.

To have Kubernetes restart proxies that stop responding and check that each replica is ready, turn on liveness and readiness probes.

Further exploration

  • Use high availability to configure topology spreading, resource limits, and metrics for production ProxyGroup deployments.
  • Use ProxyClass to customize the configuration that a ProxyGroup applies to its proxy Pods.