<p>I defined the following parameters in values.yaml</p>

<pre><code>resources:
  nvidia.com/gpu: 1
</code></pre>

<p>and in templates, I'd like to add following logic in <code>templates/deployment.yaml</code></p>

<pre><code>{{- if .Values.resources.nvidia.com/gpu }}
 ****
{{- end}}
</code></pre>

<p>But it's failed, please help me to know how to use it in <code>templates/deployment.yaml</code>.</p>

che yang
<p>You can always use the function index:</p>

<pre><code>  {{- if index .Values.resources "nvidia.com/gpu" }}
    x: {{ index .Values.resources "nvidia.com/gpu" }}
  {{- end}}
</code></pre>
