-
Notifications
You must be signed in to change notification settings - Fork 38.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add troubleshooting section to kube-dns readme #31817
Conversation
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
1 similar comment
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
cc @timbunce for comments/feedback I will add a label to turn off the e2e tests since these are doc-only changes |
GCE e2e build/test passed for commit 8ad179d. |
@@ -215,6 +215,107 @@ Address 1: 10.0.0.1 | |||
|
|||
If you see that, DNS is working correctly. | |||
|
|||
### 4 Troubleshooting tips. | |||
If above ```nslookup``` command does not work, here are some hints: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single-ticks for inline code, triple-ticks for multi-line blocks.
#### Is dns pod running? | ||
```kubectl get pods``` command could tell. (namespace may be "default" or others if you manually deploy it) | ||
``` | ||
kubectl get pods --namespace=kube-system -a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about kubectl get pods --namespace=kube-system -l k8s-app=kube-dns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better, I applied.
Otherwise, please try next hint. | ||
|
||
#### Is dns pod working properly? | ||
Use ```kubectl logs``` command for detective work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
single ticks
#### Is dns pod working properly? | ||
Use ```kubectl logs``` command for detective work. | ||
``` | ||
kubectl logs --namespace=kube-system kube-dns-v19-ezo1y -c kubedns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl logs --namespace=kube-system $(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name) -c kubedns
or
POD=$(kubectl get pods --namespace=kube-system -l k8s-app=kube-dns -o name)
kubectl logs --namespace=kube-system $POD -c kubedns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the first one.
8ad179d
to
18c2801
Compare
The new commit makes a bit enhancement according to the comments. Also a But isn't this README being moved out to http://kubernetes.io/docs/admin/dns? (#32931) |
18c2801
to
cf8899b
Compare
Jenkins GCI Kubemark GCE e2e failed for commit cf8899b. Full PR test history. The magic incantation to run this job again is |
Sent a new PR on kubernetes/website#1449. Closing this. |
Working on #23981.
This PR added some generic troubleshooting information for kube-dns addon. The addition is pasted below:
@girishkalele @bprashanth
4 Troubleshooting tips.
If above
nslookup
command does not work, here are some hints:Check the local DNS configuration first
Take a look inside the resolv.conf file. (See "Inheriting DNS from the node" and "Known issues" sections for more information)
You should see the search path and nameserver are set up like below: (search path may vary for different cloud providers)
Quick diagnosis
If below appears, usually means something is wrong with kube-dns addon or Services
or
Let's continue to debug it.
Is dns pod running?
kubectl get pods
command could tell. (namespace may be "default" or others if you manually deploy it)You should see something like:
If no pod is running or failed/completed, then maybe because this dns addon would not be deployed by default in your current environment and you have not deployed it manually.
Otherwise, please try next hint.
Is dns pod working properly?
Use
kubectl logs
command for detective work.See if you could find any suspicious log. If not, please continue.
Is dns service up?
Varify through
kubectl get service
command.You should see something like:
If you have created the service or in the case it should be created by default but it does not appear, goto this debugging services page for more information.
Otherwise, let's go ahead.
Are dns endpoints exposed?
Varify through
kubectl get endpoints
command.You should see something like:
If not, again, goto this debugging services page and look for the endpoints section.
At last, if you reach here, the final suggestion is still goto this debugging services page and look for the "Is the kube-proxy working?" section.
Hopefully you would have got some meaningful clues now. For more Kubernetes DNS example go here.
This change is