Skip to content

Commit 945eb38

Browse files
authored
Make the command work with multiple pods too
if the user has 2 or more pods the original command line give the following error: ```error: only one of -c or an inline [CONTAINER] arg is allowed See 'kubectl logs -h' for help and examples.```
1 parent f9901e7 commit 945eb38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/en/docs/tasks/administer-cluster/dns-debugging-resolution.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ have to deploy it manually.
110110
Use `kubectl logs` command to see logs for the DNS daemons.
111111

112112
```shell
113-
$ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name) -c kubedns
114-
$ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name) -c dnsmasq
115-
$ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name) -c sidecar
113+
$ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c kubedns
114+
$ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c dnsmasq
115+
$ kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name | head -1) -c sidecar
116116
```
117117

118118
See if there is any suspicious log. Letter '`W`', '`E`', '`F`' at the beginning

0 commit comments

Comments
 (0)