<p>What is the purpose of <code>kubectl logs deploy/my-deployment</code> shown at <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#interacting-with-deployments-and-services" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/kubectl/cheatsheet/#interacting-with-deployments-and-services</a>?</p>
<p>I would think it will show me logs from all the pods deployed as part of the <code>my-deployment</code> object. However, even though I have 2 pods in my deployment, that command shows logs from only one of them.</p>

mnj
<p>If your deployment has multiple pod replicas, then <code>kubectl logs deployment/...</code> will just pick one on its own.</p>
<p>Here is an example:</p>
<pre><code>kubectl  get pods -n kube-system | grep coredns
coredns-78fcd69978-dqf95       1/1     Running   0          42h
coredns-78fcd69978-vgvf2       1/1     Running   0          42h
</code></pre>
<pre><code>kubectl logs deployment/coredns -n kube-system 
Found 2 pods, using pod/coredns-78fcd69978-vgvf2
</code></pre>
