TIS1101 - DestinationWeight on Route Does Not Have a Valid Service
The DestinationWeight on a route does not point to a valid service (host not found).
DestinationWeight References a Valid ServiceTo avoid routing failures, always ensure that the host in the destination section of the VirtualService references a valid service in the service registry. Correct the host, deploy the missing service, or remove the invalid configuration as appropriate.
Examples
-
VirtualServicewith Invalid Host inDestinationWeightapiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: my-virtual-service
namespace: example-namespace
spec:
hosts:
- "my-app.example-namespace.svc.cluster.local"
http:
- route:
- destination:
host: "unknown-service.example-namespace.svc.cluster.local"
weight: 100Explanation: The
VirtualServicereferences a hostunknown-service.example-namespace.svc.cluster.localin thedestinationsection, but no corresponding service exists in the service registry. This causes routing failures, as Istio cannot determine where to send the traffic.
Recommendation
Correct the host to point to a valid service in the namespace, use an FQDN if referring to a service in another namespace, deploy the missing service, or remove the configuration linking to the non-existent service.
-
Correct the Host to an Existing Service
Update the host in the
destinationto point to a valid service.apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: my-virtual-service
namespace: example-namespace
spec:
hosts:
- "my-app.example-namespace.svc.cluster.local"
http:
- route:
- destination:
host: "existing-service.example-namespace.svc.cluster.local"
weight: 100Explanation: Correcting the host to an existing service (
existing-service.example-namespace.svc.cluster.local) ensures that the traffic can be correctly routed by Istio. -
Deploy the Missing Service
If the service should exist but is missing, deploy it to the mesh.
apiVersion: v1
kind: Service
metadata:
name: unknown-service
namespace: example-namespace
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
selector:
app: unknown-serviceExplanation: Deploying the missing service allows Istio to find the specified host and route traffic appropriately.
-
Remove the Invalid Configuration
If the configuration is not needed, remove the
destinationreferencing the non-existent service.apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: my-virtual-service
namespace: example-namespace
spec:
hosts:
- "my-app.example-namespace.svc.cluster.local"
http:
- route: []Explanation: Removing the invalid configuration helps to avoid routing issues caused by referencing a non-existent service.