<p>When retrieving the logs using <code>kubectl logs -l</code>, it returns the logs for some of the labels, but it does not return anything for some other labels.</p>

<p>For example:</p>

<pre><code>~/ $ kubectl logs -n test -lapp=testapp
~/ $ kubectl logs -n test -lapp.kubernetes.io/instance=test
2019-07-30 15:28:39.913  INFO 1 ---
</code></pre>

<p>The labels of the <code>deployment</code>:</p>

<pre><code>~/ $ kubectl get deployments.apps -n test --show-labels 
NAME                    READY   UP-TO-DATE   AVAILABLE   AGE     LABELS
testapp                 1/1     1            1           55m     app.kubernetes.io/instance=test,app=testapp
</code></pre>

<p>Thanks</p>

<p>Make sure both the deployment and template labels are properly set.</p>

<pre><code>    "template": {
      "metadata": {
        "labels": {
          "app": "testapp",
          "app.kubernetes.io/instance": "test"
        }
      },
</code></pre>

<p>You can use:</p>

<ul>
<li>kubectl logs --selector app.kubernetes.io/instance=test </li>
<li>kubectl logs -l app.kubernetes.io/instance=test</li>
</ul>

<p>Hope this helps</p>
