<p>Imagine a scenario where I have 3 classes of worker node (A,B,C) and 2 master nodes (X,Y) as part of a Kubernetes cluster. There maybe multiple worker nodes of each class. Is it possible to route the traffic such that traffic arriving at the different master nodes is routed to a different set of worker nodes. For example I want master node X to route traffic to workers of class A and potentially fail over to class B under heavy load and for master node Y to route traffic to nodes of class C but also use B as a failover when needed.</p>

Richard Chester
<p>As correctly pointed out in the comments, the traffic is not handled by the master nodes; its responsibility, at a high level, is to observe and maintain the desired state of the Kubernetes resources deployed in the worker nodes, as well as to push any changes to them.</p>
<p>That being said, yes, it is possible to discriminate and send the traffic to different worker nodes using <a href="https://kubernetes.io/docs/concepts/services-networking/topology-aware-hints/" rel="nofollow noreferrer">Topology Aware Hints</a>:</p>
<blockquote>
<p>Topology Aware Hints enable topology aware routing by including
suggestions for how clients should consume endpoints. This approach
adds metadata to enable consumers of EndpointSlice and / or Endpoints
objects, so that traffic to those network endpoints can be routed
closer to where it originated.</p>
</blockquote>
<p>This feature is specifically designed to handle traffic in a multi-zone environment and has a series of built-in <a href="https://kubernetes.io/docs/concepts/services-networking/topology-aware-hints/#safeguards" rel="nofollow noreferrer">Safeguards</a> to prevent situations like overload of an endpoint, insufficient endpoints in a zone, etc.</p>
