<p>I've started to use <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/" rel="nofollow noreferrer">kustomize</a> to update the yaml files. 
I'm trying to add labels to <code>Deployment</code> object. <code>commonLabels</code> seems pretty good but it applies the label to <code>selector</code> as well (which I don't want)</p>

<p>Is there a way to add new label only to <code>metadata.labels</code> or <code>spec.template.metadata.labels</code>?</p>

<p>here's a sample <code>deployment</code> object :</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    service: servieName
    owner: ownerName
  name: myName
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
         app: servieName
         owner: ownerName
         &lt;newLableHere&gt;: &lt;newValueHere&gt;
 ...

</code></pre>

Mahyar
<p>You would need to define a patch for that object specifically.</p>
