Skip to main content
Skip table of contents

Service Topology

Service Topology is a mechanism in Kubernetes to route traffic based upon the Node topology of the cluster. For example, you can configure a Service to route the traffic to endpoints on specific nodes, or even based on the region or availability zone of the node’s location.

To enable this new feature in your Kubernetes cluster, use the feature gates --feature-gates="ServiceTopology=true,EndpointSlice=true" flag. After enabling, you can control Service traffic routing by defining the topologyKeys field in the Service API object.

In the following example, a Service defines topologyKeys to be routed to endpoints only in the same zone:

CODE
apiVersion: v1
kind: Service
metadata:
  name: my-konvoy-service
  namespace: default
spec:
  selector:
    app: MyKonvoyApp
  ports:
  - protocol: TCP
    port: 80
    targetPort: 9191
  topologyKeys:
  - "topology.kubernetes.io/zone"

If the value of the topologyKeys field does not match any pattern, the traffic is rejected.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.