Both istio-policy and istio-telemetry are based on mixer. And the two deployments run mixer almost in the same way /usr/local/bin/mixs server --address unix:///sock/mixer.socket --configStoreURL=k8s:// --configDefaultNamespace=istio-system --trace_zipkin_url=http://zipkin:9411/api/v1/spans. So I have two problems:
How can the mixer process know what role should they run?
The default installation comes as separate deployment with istio-policy and istio-telemetry for the following reasons (AFAIK):
Be sure that each API ( Check for policy and Report for Telemetry) will not have a side-effect on the other as it will the the case when both API will be running on the same container.
Provide the ability to scale up/down each components separately depending on the use case and real production circumstances. For example, define two different autscale strategy.
Provide the ability to change configuration separately. For example, define different service accounts, resources quota…
2.Istio uses service label to distinguished between the two services:
Policy pods are labeled with istio-mixer-type=policy and Telemetry with istio-mixer-type=telemetry.