Use ProxyGroup for high availability proxies
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
ProxyGroupcan handle traffic for multiple KubernetesServiceorIngressresources, 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:
| Type | Description |
|---|---|
ingress | Expose Kubernetes workloads to your tailnet. |
egress | Enable pods in your cluster to connect to devices in your tailnet. |
kube-apiserver | Securely access the Kubernetes API server over Tailscale. |
Created resources
When you deploy a ProxyGroup, the Tailscale Kubernetes Operator creates:
- A configuration and state
Secretper replica. - A
ServiceAccount,Role, andRoleBindingfor theProxyGroup. - A
StatefulSetrunning the specified number of proxy pod replicas (defaults to 2). - A
ConfigMapcontaining ingress or egress configuration (foringressandegresstypes). - If static endpoints are configured through a
ProxyClass, aNodePortServiceper 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
ProxyGroupdeployments. - Use ProxyClass to customize the configuration that a
ProxyGroupapplies to its proxy Pods.