File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ pub(crate) fn build_server_role_service(
6363 type_ : Some ( opa. spec . cluster_config . listener_class . k8s_service_type ( ) ) ,
6464 ports : Some ( data_service_ports ( opa. spec . cluster_config . tls_enabled ( ) ) ) ,
6565 selector : Some ( service_selector_labels. into ( ) ) ,
66+ // This ensures that products (e.g. Trino) on a node always talk to the OPA pod on the
67+ // same node, avoiding cross-node latency. The downside is that if the local OPA pod is
68+ // unavailable, requests fail instead of falling back to another node.
69+ // TODO: Once our minimum supported Kubernetes version is 1.35, use
70+ // `trafficDistribution: PreferSameNode` instead, which prefers the local node but
71+ // gracefully falls back to other nodes if the local pod is unavailable.
6672 internal_traffic_policy : Some ( "Local" . to_string ( ) ) ,
6773 ..ServiceSpec :: default ( )
6874 } ;
You can’t perform that action at this time.
0 commit comments