Marco Jantke
Share
Our new DOKS routing agent is a managed component for configuring static routes on Kubernetes worker nodes. It is a direct response to user feedback on its predecessor, the static route operator, and introduces new features to enhance routing flexibility. Despite being a managed component, the DOKS routing agent is included at no additional cost for users.
The DOKS routing agent enables users to configure IP routes on their Kubernetes worker nodes using a dedicated Kubernetes Custom Resource. This is particularly useful for VPN setups or tunneling egress traffic through specific gateway nodes.
apiVersion: networking.doks.digitalocean.com/v1alpha1 kind: Route metadata: name: basic spec: destinations: - "1.2.3.4/5" # Networks to be routed via the specified gateways gateways: - "10.114.0.3" # Gateway IP
The routing agent supports multiple gateways and automatically configures ECMP (Equal-Cost Multi-Path) routing to distribute traffic across them.
apiVersion: networking.doks.digitalocean.com/v1alpha1 kind: Route metadata: name: basic spec: destinations: - "1.2.3.4/5" gateways: - "10.114.0.3" - "10.114.0.4"
How ECMP Works:
The routing agent allows users to override default routes without disrupting cluster connectivity—one of the most requested features.
apiVersion: networking.doks.digitalocean.com/v1alpha1 kind: Route metadata: name: basic spec: destinations: - "0.0.0.0/0" # Default route gateways: - "10.114.0.3" - "10.114.0.4"
To prevent issues with Kubernetes components, the routing agent ensures that essential control plane endpoints, metadata services, and DNS servers maintain direct connectivity through the worker node Droplet’s default gateway.
Routes can be applied to specific nodes using Kubernetes label selectors, allowing for fine-grained control over network configurations.
apiVersion: networking.doks.digitalocean.com/v1alpha1 kind: Route metadata: name: basic spec: destinations: - "1.2.3.4/5" gateways: - "10.114.0.3" nodeSelector: nodeSelectorTerms: - matchExpressions: - key: doks.digitalocean.com/node-pool operator: In values: ["worker-pool"]
The routing agent can be enabled or disabled using doctl or the DigitalOcean API.
- doctl kubernetes cluster create --enable-routing-agent ...
-
- doctl kubernetes cluster update --enable-routing-agent ...
For API users, the field structure is:
- {
-
- "routing_agent": { "enabled": true }
-
- }
With the DOKS routing agent and a self-managed VPC gateway Droplet, users can configure static egress IPs, ensuring outbound traffic from Kubernetes workloads originates from a predictable IP address.
We’re also working on a fully managed NAT gateway, which will offer a simpler solution for achieving static egress IPs. This feature is on our roadmap and will be available later this year.
The DOKS routing agent streamlines static route management in Kubernetes, providing:
These features are especially useful for VPN setups, custom egress routing, and self-managed VPC gateways.
Share