Istio package installation fails with "ytt: Error: Overlaying... istio-gateways-overlay.yaml: Expected number of matched nodes to be 1, but was 0" on vSphere Kubernetes Service clusters
search cancel

Istio package installation fails with "ytt: Error: Overlaying... istio-gateways-overlay.yaml: Expected number of matched nodes to be 1, but was 0" on vSphere Kubernetes Service clusters

book

Article ID: 423923

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • Installing Istio package on vSphere Kubernetes Service cluster fails with the following error message: 
    HH:MM:SS: Template failed
            | ytt: Error: Overlaying (in following order: overlay/authenticated-registry-overlay.yaml, overlay/istio-ambient-overlay.yaml, overlay/istio-base-overlay.yaml, overlay/istio-gateways-overlay.yaml, overlay/istio-support-overlay.yaml, overlay/istiod-overlay.yaml):
            |   Document on line overlay/istio-gateways-overlay.yaml:90:
            |     Expected number of matched nodes to be 1, but was 0
            |
            | Templating dir: Error (see .status.usefulErrorMessage for details)
    HH:MM:SS: Error tailing or reconciling app: Reconciling app: Template failed
  • The following documentation is referenced to install the package on the Guest Cluster: Install Istio and Install Package Reference  
  • The istio-data-values.yaml file has the egress and ingress gateway set to enabled: false

      gateways:
        egress:
          enabled: false
          namespace: "istio-egress"
          priorityClassName: ""
          replicas: 1
          resources:
            limits:
              cpu: 2000m
              memory: 1024Mi
            requests:
              cpu: 100m
              memory: 128Mi
          autoscaling:
            enabled: true
            minReplicas: 1
            maxReplicas: 5
        ingress:
          enabled: false
          namespace: "istio-ingress"

Environment

VMware vSphere Kubernetes Service

Cause

This issue occurs because the gateways (Ingress and/or Egress) are explicitly disabled in the user-provided values.yaml configuration file.
If enabled: false is set for the gateways in values.yaml, the base Istio configuration is generated without these gateway objects. Consequently, the overlay file cannot find the target nodes it expects to patch, resulting in the "Expected number of matched nodes to be 1, but was 0" error. 

Resolution

To resolve this issue, ensure that the gateways are enabled in the configuration so that the overlay has a valid target to apply patches to.

  1. Locate the configuration file - istio-data-values.yaml file being used for the Istio package installation.

  2. Edit the file in a text editor and locate the gateways section.

  3. Change the enabled flag from false to true for the ingress and egress gateways.

    Incorrect Configuration (Causing Error):

    gateways:
      ingress:
        enabled: false
      egress:
        enabled: false
    

    Correct Configuration:

    gateways:
      ingress:
        enabled: true
      egress:
        enabled: true

     

  4. Proceed to install the Istio package by following the steps as described in the following documentation: Install Istio.

Additional Information

Install Istio

Istio Package Reference