I defined the following parameters in values.yaml
resources:
nvidia.com/gpu: 1
and in templates, I'd like to add following logic in templates/deployment.yaml
{{- if .Values.resources.nvidia.com/gpu }}
****
{{- end}}
But it's failed, please help me to know how to use it in templates/deployment.yaml
.
You can always use the function index:
{{- if index .Values.resources "nvidia.com/gpu" }}
x: {{ index .Values.resources "nvidia.com/gpu" }}
{{- end}}