<p>This is the template I prepared but it gives an error. This is the error I got when I prepared and printed this helm, and I could not manage to read the characters here from the values.yaml file</p>
<p><strong>virtual-service.yaml</strong></p>
<pre class="lang-yaml prettyprint-override"><code>{{ $prefix := .Values.virtualservice.prefix }}
{{ $uri := .Values.virtualservice.uri }}
apiVersion: v1
items:
- apiVersion: networking.istio.io/v1alpha3
  kind: VirtualService
  metadata:
    name: {{ .Values.deploy.svc.name }}-virtual-service
    namespace: {{ .Values.deploy.namespace }}
  spec:
    gateways:
    - istio-system/istio-gateway
    hosts:
    - {{ .Values.ingress.hosts }}
    http:
    - match:
      - uri:
          prefix: {{ $prefix }}
      rewrite:
        uri: {{ $uri }}
      route:
      - destination:
          host: {{ .Values.deploy.svc.name }}-service
          port:
            number: 80
</code></pre>
<p>and <strong>values.yaml</strong></p>
<pre class="lang-yaml prettyprint-override"><code>virtualservice:
  enabled: true
  prefix: v1
  uri: /
</code></pre>
<p><strong>Helm Version:</strong></p>
<pre><code>Client: &amp;version.Version{SemVer:&quot;v2.15.2&quot;, GitCommit:&quot;8dce272473e5f2a7bf58ce79bb5c3691db54c96b&quot;, GitTreeState:&quot;clean&quot;}
Server: &amp;version.Version{SemVer:&quot;v2.15.2&quot;, GitCommit:&quot;8dce272473e5f2a7bf58ce79bb5c3691db54c96b&quot;, GitTreeState:&quot;clean&quot;}
</code></pre>
<p>and <strong>error</strong></p>
<pre><code>Error: render error in &quot;helm/templates/virtual-service.yaml&quot;: template: helm/templates/virtual-service.yaml:1:21: executing &quot;helm/templates/virtual-service.yaml&quot; at &lt;.Values.virtualservice.prefix&gt;: nil pointer evaluating interface {}.prefix```
</code></pre>

Kaan Murzoğlu
<p>Helm is complaining about unresolved variable <code>virtualservice.uri</code> (in the first line). You need to add it to the <code>values.yaml</code> or pass it to the helm invocation, e.g.:</p>
<pre><code>helm template [NAME] [CHART] --set virtualservice.uri=&quot;whatever&quot;
</code></pre>
