<p>I have set up one Kubernetes master node and 2 workers node. I deployed two web applications as a pod using <code>kubectl</code>. I deployed <code>nginx-ingress-controller</code> ( image: <code>gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.6</code>) and created a service for the same with nodeport option. How do I access the error logs of the <code>nginx-ingress-controller</code>? I'm able to see <code>error.log</code> under <code>/var/log/nginx/</code>, but it is link to <code>/dev/stderr</code>. </p>

<p>TL;DR</p>
<pre><code>kubectl logs -n &lt;&lt;ingress_namespace&gt;&gt; &lt;&lt;ingress_pod_name&gt;&gt;
</code></pre>
<p>Check the namespace under which the Ingress controller is currently running.</p>
<pre><code>$ kubectl get pods
NAME                                    READY   STATUS    RESTARTS   AGE
helloworld-deployment-7dc448d6b-5zvr8   1/1     Running   1          3d20h
helloworld-deployment-7dc448d6b-82dnt   1/1     Running   1          3d20h

$ kubectl get pods -n kube-system
NAME                                        READY   STATUS    RESTARTS   AGE
kube-apiserver-minikube                     1/1     Running   1          3d20h
nginx-ingress-controller-586cdc477c-rhj9z   1/1     Running   1          3d21h
</code></pre>
<p>For me, it happens to be the <code>kube-system</code> namespace on the pod <code>nginx-ingress-controller-586cdc477c-rhj9z</code>.</p>
<p>Now, get the logs just like you would for any pod using</p>
<pre><code> kubectl logs -n kube-system nginx-ingress-controller-586cdc477c-rhj9z
</code></pre>
