For Istio, You can use VirtualService to control the routing rules to the target subset with defining by DestinationRules.
The DestinationRule will route to the target Pods by the specified label pods.
The request flow will like to:
+--------------------+
| |
| Istio Gateway |
| |
| |
+---------+----------+
|traffic incoming
|
+---------v----------+
| |
| VirtualService |
| |
| |
+---------+----------+
|route to subset by the routing rules
v
+--------------------+
| |
| DestinationRules |
| |
| |
+---------+----------+
|route traffic to target pods
v
+--------------------+
| |
| |
| Pods |
| |
+--------------------+
so as @ericstaples said you should create different Deployments with different pod labels to achieve separating traffic to the target pods, Example:
- create a deployment with pod label: t1
- create a subset in DestinationRule: select t1 label pod as subset s1
- control your traffic in VirtualService that route to
s1
subset
s1
route to the target pods
also for expose Gateway, you can use ClusterIP or NodePort like ** Kubernetes** other service did, see more of Istio Traffic.
There are some references maybe it's helpful:
https://istio.io/docs/concepts/traffic-management/
https://istio.io/docs/tasks/traffic-management/request-routing/