<p>I am using helm version 2.14.1. I have created helm charts for an application that will be deployed by users to test their code on kubernetes cluster. I want to add labels for username values, so I can retrieve deployments by users (deployments by user labels). Is there a way to include system username in helm charts just like we do in Java with <code>System.getProperty(&quot;user.name&quot;)</code>. My helm template is like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include &quot;common.fullname&quot; . }}--{{ Release.name }}
  labels:
    application: {{ include &quot;common.name&quot; . }}
    branch: &quot;{{ Release.name }}&quot;
    username: &quot;{{ System.user.name }}&quot;   # need to fetch the logged in user from system here
spec:
...
</code></pre>
<p>Is there a standard way to achieve this or is there anyway I can allow users to input there usernames from command line while using <code>helm install</code> or <code>helm template</code> commands?</p>
<p>EDIT:
Although, the <code>--set</code> works for me in setting the values for my chart, I also need to set the same value in the dependencies. Something like this:</p>
<p>values.yaml</p>
<pre><code>username: &quot;&quot; 

dependency1:
 username: {{ .Values.username }} 

dependency2:
 username: {{ .Values.username }}

...

</code></pre>
<p>Of course the above implementation doesn't work. I need to reference the set value in the dependencies as well</p>

<p>I have resolved this. Thanks for help @MichaelAlbers and @WytrzymałyWiktor. So the solution is as below.</p>
<pre><code>helm template path/to/chart --set global.username=username
</code></pre>
<p>And then in all the templates refer to this value as <code>{{ .Values.global.username }}</code>. This works for any dependency chart as well.</p>
