title: Why doesn't helm use the name defined in the deployment template?
body: <p>i.e. from <code>name: {{ .Chart.Name }}-{{ .Values.module5678.name }}-pod</code> below</p>
  
  <pre><code># deployment.yaml
  
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    labels:
      app: {{ template "project1234.name" . }}
      chart: {{ template "project1234.chart" . }}
      release: {{ .Release.Name }}
      heritage: {{ .Release.Service }}
    name: {{ template "project1234.module5678.fullname" . }}
  spec:
    replicas: {{ .Values.replicaCount }}
    selector:
      matchLabels:
        app: {{ template "project1234.name" . }}
    template:
      metadata:
        labels:
          app: {{ template "project1234.name" . }}
      spec:
        containers:
        - image: "{{ .Values.image.name }}:{{ .Values.image.tag }}"
          name: {{ .Chart.Name }}-{{ .Values.module5678.name }}-pod
          ports:
          - containerPort: 1234
        imagePullSecrets:
        - name: {{ .Values.image.pullSecret }}
  </code></pre>
  
  <p>I am expecting the pod name to be:</p>
  
  <blockquote>
    <p>pod/project1234-module5678-pod</p>
  </blockquote>
  
  <p>Instead, the resulting Pod name is:</p>
  
  <blockquote>
    <p>pod/chartname-project1234-module5678-dc7db787-skqvv</p>
  </blockquote>
  
  <p>...where (in my understanding):<br>
  <strong>chartname</strong> is from: <code>helm install --name chartname -f values.yaml .</code><br>
  <strong>project1234</strong> is from: </p>
  
  <pre><code># Chart.yaml
  
  apiVersion: v1
  appVersion: "1.0"
  description: project1234 Helm chart for Kubernetes
  name: project1234
  version: 0.1.0
  </code></pre>
  
  <p><strong>module5678</strong> is from:</p>
  
  <pre><code># values.yaml
  
  rbac:
    create: true
  
  serviceAccounts:
    module5678:
      create: true
      name:
  
  image:
    name: &lt;image location&gt;
    tag: 1.5
    pullSecret: &lt;pull secret&gt;
  
  gitlab:
    secretName: &lt;secret name&gt;
    username: foo
    password: bar
  
  module5678:
    enabled: true
    name: module5678
    ingress:
      enabled: true
    replicaCount: 1
    resources: {}
  </code></pre>
  
  <p>I've tried changing <code>name: {{ .Chart.Name }}-{{ .Values.module5678.name }}-pod</code> into a plain string value like "podname1234" and it isn't followed. I even tried removing the name setting entirely and the resulting pod name remains the same.</p>