<p>I am learning Kubernetes and planning to do continuous deployment of my apps with Kubernetes manifests. </p>

<p>I'd like to have my app defined as a <code>Deployment</code> and a <code>Service</code> in a manifest, and have my CD system run <code>kubectl apply -f</code> on the manifest file. </p>

<p>However, our current setup is to tag our Docker images with the SHA of the git commit for that version of the app. </p>

<p>Is there a Kubernetes-native way to express the image tag as a variable, and have the CD system set that variable to the correct git SHA?</p>

David Ham
<p>You should consider <a href="/questions/tagged/helm" class="post-tag" title="show questions tagged &#39;helm&#39;" rel="tag">helm</a> charts in this case, where you separate between the skeleton of templates (or what you called maniest) and its values which are changed from release to another.</p>

<p>In <strong>templates/deployment.yaml</strong> :</p>

<pre><code>spec:
  containers:
    - name: {{ template "nginx.name" . }}
      image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
</code></pre>

<p>And in <strong>values.yaml</strong> : </p>

<pre><code>image:
  repository: nginx
  tag: 1.11.0
</code></pre>

<p>See the full example <a href="https://github.com/helm/helm/blob/master/docs/examples/nginx" rel="nofollow noreferrer">here</a></p>
