TIS0209 - Subset Lacks Labels
The specified subset lacks labels.
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
-
DestinationRule
Subset Without LabelsapiVersion: 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 fieldExplanation: 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.
-
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: v1Explanation: 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.