<ol>
<li><p>I created a build config from the git repo (Docker based app).</p>

<p><code>oc new-build &lt;git-url&gt; --name=myApp</code></p></li>
<li><p>Created a deployment config using:</p>

<p><code>oc create dc myApp --image=&lt;image-stream-repo&gt;</code></p></li>
</ol>

<p>I am adding labels to this deployment config from the UI.</p>

<ol start="3">
<li>Now when I deploy the application (from the UI) or use <code>oc rollout</code>, the POD is created and the application is running in the POD.</li>
</ol>

<p><strong>But the label (name: myApp) is not being applied to the POD.</strong> As a result the <code>selector</code> in the <code>service</code> is failing to identify the POD. The service is configured with label <code>name: myApp</code> as POD selector.</p>

<p>If I go to the created POD and <code>edit yaml</code> and add <code>name: myApp</code> in the <code>labels</code> section, only then the POD is being identified by the service.</p>

<p>In case if any one has faced similar issue, please provide your inputs in overcoming this problem.</p>

snmaddula
<p>To set a label on a <code>Pod</code> using a <code>DeploymentConfig</code>, the label must be placed in a much more deeply nested key, as shown below, or else it will be set on the <code>DeploymentConfig</code> itself, not the <code>Pod</code>:</p>
<pre><code>objects:
  - kind: DeploymentConfig
    apiVersion: v1
    metadata:
      name: my-name
      # labels: NOT HERE (FOR DC ONLY)!
    spec:
        replicas: 1
        selector:
          app: my-name
        strategy:
          type: Rolling
        template:
          metadata:
            labels:
              app: my-name
              myAppsGroup: myApp
</code></pre>
<p>You can verify the correctness of pod labeling using <code>oc describe pod my-name</code></p>
