Diagnostic items for instance configurations

更新时间:
复制 MD 格式

Service Mesh (ASM) analyzes your Istio configuration to identify invalid or suboptimal settings. This topic describes the error and warning messages for instance configurations that this analysis might generate.

IST0101: Referenced resource not found

Message name

Message code

Level

Description

ReferencedResourceNotFound

IST0101

Error

The referenced resource does not exist.

This message appears when an Istio resource references another resource that does not exist. This causes an error because Istio cannot find the referenced resource.

Abnormal example

In the following example, the VirtualService points to a gateway that does not exist:

apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
  name: httpbin-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http2
      protocol: HTTP2
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: httpbin
spec:
  hosts:
  - "*"
  gateways:
  - httpbin-gateway-bogus # Should be "httpbin-gateway"
  http:
  - route:
    - destination:
        host: httpbin-gateway

You will receive this message:

Error [IST0101] (VirtualService httpbin.default) Referenced gateway not found: "httpbin-gateway-bogus"

How to fix

Find the resource type in the detailed error message and correct the reference in the Istio configuration.

IST0109: Conflicting Sidecar virtual service routing rules

Message name

Message code

Level

Description

ConflictingMeshGatewayVirtualServiceHosts

IST0109

Error

A virtual service associated with the mesh gateway has a conflicting host.

This message indicates a conflict caused by duplicate VirtualService resources. For example, this error occurs when multiple virtual services use the same hostname and are attached to the mesh gateway. Note that Istio supports merging virtual services that are attached to an ingress gateway.

Abnormal examples

In the following example, the productpage VirtualService in the team1 namespace conflicts with the custom VirtualService in the team2 namespace:

apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: productpage
  namespace: team-1
spec:
  hosts:
  - productpage.default.svc.cluster.local
  http:
  - route:
    - destination:
        host: productpage
---
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: custom
  namespace: team-2
spec:
  hosts:
  - productpage.default.svc.cluster.local
  http:
  - route:
    - destination:
        host: productpage.team-2.svc.cluster.local
---
  • Because a custom gateway is not specified, each virtual service is attached to the default "mesh" gateway.

  • Both virtual services define the same host: productpage.default.svc.cluster.local.

How to fix

Use one of the following methods:

  • Merge the conflicting virtual services into one.

  • Use a unique hostname for each virtual service that is attached to the gateway.

  • Scope the resource to a specific namespace by setting the exportTo field. For example:

    apiVersion: networking.istio.io/v1
    kind: VirtualService
    metadata:
      name: productpage
      namespace: team-1
    spec:
      exportTo:
      - "."
      hosts:
      - productpage.default.svc.cluster.local
      http:
      - route:
        - destination:
            host: productpage
    ---
    apiVersion: networking.istio.io/v1
    kind: VirtualService
    metadata:
      name: custom
      namespace: team-2
    spec:
      exportTo:
      - "."
      hosts:
      - productpage.default.svc.cluster.local
      http:
      - route:
        - destination:
            host: productpage.team-2.svc.cluster.local
    ---

IST0110: Conflicting Sidecar resource workload selectors

Message name

Message code

Level

Description

ConflictingSidecarWorkloadSelectors

IST0110

Error

A Sidecar resource selects the same workload as another Sidecar resource.

This message appears when multiple Sidecar resources in the same namespace select the same workload instance. This can lead to undefined behavior.

To fix this, ensure that each Sidecar workload selector in the same namespace selects a unique set of workload instances, such as pods.

IST0111: Multiple Sidecar resources without a workload selector

Message name

Message code

Level

Description

MultipleSidecarsWithoutWorkloadSelectors

IST0111

Error

Multiple Sidecar resources in a namespace do not specify a workload selector.

This message appears when multiple Sidecar resources in a namespace do not define a workload selector. This situation can cause undefined behavior.

To fix this, ensure that each namespace has only one Sidecar resource without a workload selector.

IST0127: No matching workload found

Message name

Message code

Level

Description

NoMatchingWorkloadsFound

IST0127

Warning

No matching workload found for the resource labels.

This message appears when the selector of an AuthorizationPolicy resource does not match any pods.

Exception Examples

If a cluster contains the following AuthorizationPolicy:

apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
  name: httpbin-nopods
  namespace: httpbin
spec:
  selector:
    matchLabels:
      app: bogus-label # The label is incorrect. No matching workload is found.
      version: v1
  rules:
    - from:
        - source:
            principals: ["cluster.local/ns/default/sa/curl"]
        - source:
            namespaces: ["httpbin"]
      to:
        - operation:
            methods: ["GET"]
            paths: ["/info*"]
        - operation:
            methods: ["POST"]
            paths: ["/data"]
      when:
        - key: request.auth.claims[iss]
          values: ["https://accounts.google.com"]

You will receive this message:

Warning [IST0127] (AuthorizationPolicy httpbin-nopods.httpbin) No matching workloads for this resource with the following labels: app=bogus-label,version=v1

In this example, the httpbin-nopods AuthorizationPolicy resource selects pods with the app=bogus-label label, but no such pods exist.

How to fix

  • Modify the selector to match an existing pod.

  • Modify the labels of a pod to match the resource's selector.

IST0132: Virtual service domain name not defined in gateway rule

Message name

Message code

Level

Description

VirtualServiceHostNotFoundInGateway

IST0132

Warning

The host defined in the virtual service is not found in the gateway.

This message appears when a virtual service declares a host that is not defined in the corresponding gateway.

Abnormal examples

If your cluster contains the following VirtualService and Gateway:

apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
  name: testing-service
  namespace: default
spec:
  gateways:
  - istio-system/testing-gateway
  hosts:
  - wrong.com
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: ratings
---
apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
  name: testing-gateway
  namespace: istio-system
spec:
  selector:
    istio: ingressgateway
  servers:
  - hosts:
    - testing.com
    port:
      name: http
      number: 80
      protocol: HTTP

You will receive the following message:

Warning [IST0132] (VirtualService testing-service.default testing.yaml:8) one or more host [wrong.com] defined in VirtualService default/testing-service not found in Gateway istio-system/testing-gateway.

In this example, the testing-service virtual service specifies the host wrong.com, but this host is not declared in the testing-gateway gateway.

How to fix

Ensure that all hosts defined in the virtual service are also defined in the hosts field of the corresponding gateway.

IST0138: Duplicate certificate definition in gateway rule

Configuring the same certificate for multiple gateways can cause a 404 error when a client reuses an HTTP/2 connection.

IST0141: Insufficient permissions

This message indicates that Istio lacks the necessary permissions for the required resources.

IST0145: Conflicting gateway rules

This message indicates that there are conflicting gateway rules.

IST0149: Virtual service JWT claim route does not define request authentication

JWT claim-based routing in a virtual service requires corresponding request authentication to be configured on the gateway. Otherwise, the routing rule will not take effect.

IST0159: Conflicting Telemetry workload selectors

Message name

Message code

Level

Description

ConflictingTelemetryWorkloadSelectors

IST0159

Error

Two Telemetry resource configurations select the same workload.

The ConflictingTelemetryWorkloadSelectors message appears when multiple Telemetry resources in the same namespace have overlapping workload selectors. This overlap creates ambiguity, making it impossible to determine which Telemetry resource applies to a specific pod. This can lead to unexpected telemetry configurations for the affected workloads.

This message is generated when the following conditions are met:

  1. Multiple Telemetry resources exist in the same namespace.

  2. These Telemetry resources have workload selectors that match the same pods.

How to fix

Review the conflicting Telemetry resources and update their workload selectors to ensure that each pod matches only one Telemetry resource. You may need to adjust the label selectors or reorganize the Telemetry resources to eliminate the overlap.

IST0160: Multiple Telemetry resources without a workload selector

Message name

Message code

Level

Description

MultipleTelemetriesWithoutWorkloadSelectors

IST0160

Error

Multiple Telemetry resources in a namespace do not have a workload selector configured.

The MultipleTelemetriesWithoutWorkloadSelectors message appears when multiple Telemetry resources in the same namespace do not have a workload selector. Without a workload selector, a Telemetry resource applies to all workloads in its namespace by default. Having multiple such resources creates ambiguity when determining which one should apply to a specific pod.

This message is generated when the following conditions are met:

  1. Multiple Telemetry resources exist in the same namespace.

  2. These Telemetry resources do not have a workload selector.

How to fix

Review the conflicting Telemetry resources and add a unique workload selector to each one. This ensures that each Telemetry resource applies only to the intended set of pods, which resolves the ambiguity in the telemetry configuration.

IST0162: Gateway rule port is not exposed

Message name

Message code

Level

Description

GatewayPortNotDefinedOnService

IST0162

Warning

The gateway port is not exposed through a service.

The GatewayPortNotDefinedOnService message appears when a port specified in a gateway configuration is not exposed by the corresponding gateway service. The gateway service is typically istio-ingressgateway.

Abnormal Example

For example, consider the following configuration:

# Gateway with an incorrect port definition

apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
  name: istio-ingressgateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
  - port:
      number: 8004
      name: http2
      protocol: HTTP
    hosts:
    - "*"
---

# Default gateway Service

apiVersion: v1
kind: Service
metadata:
  name: istio-ingressgateway
spec:
  selector:
    istio: ingressgateway
  ports:
  - name: status-port
    port: 15021
    protocol: TCP
    targetPort: 15021
  - name: http2
    port: 80
    protocol: TCP
    targetPort: 8080
  - name: https
    port: 443
    protocol: TCP
    targetPort: 8443

In this example, the GatewayPortNotDefinedOnService message appears because the configuration uses port 8004. However, the default IngressGateway, istio-ingressgateway, only listens on destination ports 15021, 8080, and 8443.

How to fix

Update the gateway configuration to use a valid port on the workload, and then retry.

The following is a corrected example:

# Gateway with a correct port definition

apiVersion: networking.istio.io/v1
kind: Gateway
metadata:
  name: istio-ingressgateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 8080
      name: http2
      protocol: HTTP
    hosts:
    - "*"
  - port:
      number: 8443
      name: https
      protocol: HTTP
    hosts:
    - "*"

IST0173: Destination rule subset does not match any pods

This message indicates that a subset defined in a destination rule does not match any pods.

IST0174: Unknown destination rule domain name

This message indicates that the host specified in a destination rule is not defined in the service mesh.