Skip to main content
logoTetrate Istio SubscriptionVersion: Next

TIS0209 - Subset Lacks Labels

The specified subset lacks labels.

Recommendation: Add Labels to Subsets for Proper Routing

To ensure subsets are effective for routing, add appropriate labels to each subset in DestinationRule. Labels allow Istio to correctly match subsets to workloads, enabling intended routing behavior.

Examples

  1. DestinationRule Subset Without Labels

    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
    name: subset-without-labels
    namespace: example-namespace
    spec:
    host: "my-service.example-namespace.svc.cluster.local"
    subsets:
    - name: version-subset
    # Missing labels field

    Explanation: The subset named version-subset does not include any labels. Without labels, Istio cannot match the subset to any workload, rendering the subset ineffective for routing purposes.

Recommendation

Ensure the subset is properly configured by adding appropriate labels.

  1. Add Labels to the Subset

    Add labels to the subset so that it can correctly match workloads with the specified labels.

    apiVersion: networking.istio.io/v1beta1
    kind: DestinationRule
    metadata:
    name: subset-with-labels
    namespace: example-namespace
    spec:
    host: "my-service.example-namespace.svc.cluster.local"
    subsets:
    - name: version-subset
    labels:
    version: v1

    Explanation: Adding labels to the subset allows Istio to correctly match the subset with workloads that have the version: v1 label, enabling the desired routing behavior.