Name | Type | Description |
spec.host | string | Name of a service associated with DestinationRule configurations. The service can be a service automatically discovered (for example, a Kubernetes service) or a host declared by ServiceEntry. Rules defined in the DestinationRule for the service that does not exist in the preceding source will be ignored. |
spec.subsets | Subset[] | Versions (subnets) of a service. Versions can be matched against endpoints of the service by label key-value pairs. Traffic policies can be overridden at subset level. |
spec.trafficPolicy | trafficPolicy | Traffic policies (load balancing, connection pools, health check, and TLS policy). |
spec.trafficPolicy.loadBalancer | - | Load balancer algorithms. The following algorithms are available: simple load balancer algorithms (such as round robin, least conn, and random), consistent hashing (session persistence, and hashing based on header name, cookie, IP, and query parameters), and locality load balancing |
spec.trafficPolicy.connectionPool | - | Volume of connections to an upstream service. A TCP or HTTP connection pool can be set. |
spec.trafficPolicy.outlierDetection | - | Eviction of unhealthy hosts from the load balancing pool. |
spec.trafficPolicy.tls | - | TLS-related configurations for the client connected to the upstream service. These configurations are used together with PeerAuthentication policies (TLS mode configurations for the server). |
spec.trafficPolicy.portLevelSettings | - | Port-level traffic policies. Note that port-level policies will override the service-level or subset-level traffic policies. |
apiVersion: networking.istio.io/v1alpha3kind: DestinationRulemetadata:name: productnamespace: basespec:host: productsubsets:- name: v1labels:version: v1 # Subset v1 is matched against an endpoint of the service by using label version:v1.- name: v2labels:version: v2 # Subset v2 is matched against an endpoint of the service by using label version:v2.
kind: DestinationRulemetadata:name: cartnamespace: basespec:host: carttrafficPolicy:loadBalancer:consistentHash:httpHeaderName: UserID # Configure hash-based load balancing to be performed on the cart service access traffic based on UserID in the header.
Was this page helpful?