title: Create and Pass the Value using helm helper function from Deployment Or Service Yaml File
body: <p>I was trying to implement the Helm Kubernetes deployment using helm chart. I would to give the deployment,app and service name using the helm release name dynamically.</p>
  
  <p>I have implemented the below approach which help me to create the dynamic name based upon the helm file.</p>
  
  <p><strong>Written the below method inside the _helper.tpl</strong></p>
  
  <pre><code>{{- define "sample-chart-getServiceName" -}}
  {{- $arg1 := index . "arg1" -}}
  {{- $fullName := include "sample-chart.fullname" . -}}
  {{- printf "%s-%s" $fullName $arg1 -}}
  {{- end -}} 
  </code></pre>
  
  <p>and below ways to calling the function inside the yaml file</p>
  
  <pre><code>name: {{ include "sample-chart-getServiceName" (dict "arg1" "service") }}
  </code></pre>