Kubernetes: Difference between revisions
imported>Iceychris m * set apiserverAddress to make Node work |
imported>Iceychris m + DNS: setup and debugging |
||
| Line 43: | Line 43: | ||
advertiseAddress = kubeMasterIP; | advertiseAddress = kubeMasterIP; | ||
}; | }; | ||
# use coredns | |||
addons.dns.enable = true; | |||
# needed if you use swap | # needed if you use swap | ||
| Line 107: | Line 110: | ||
kubelet.kubeconfig.server = api; | kubelet.kubeconfig.server = api; | ||
apiserverAddress = api; | apiserverAddress = api; | ||
# use coredns | |||
addons.dns.enable = true; | |||
# needed if you use swap | # needed if you use swap | ||
| Line 147: | Line 153: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === DNS issues === | ||
Check if coredns is running via <code>kubectl get pods -n kube-system</code>: | |||
<syntaxhighlight> | |||
NAME READY STATUS RESTARTS AGE | |||
coredns-577478d784-bmt5s 1/1 Running 2 163m | |||
coredns-577478d784-bqj65 1/1 Running 2 163m | |||
</syntaxhighlight> | |||
Run a pod to check with <code>kubectl run curl --restart=Never --image=radial/busyboxplus:curl -i --tty</code>: | |||
<syntaxhighlight> | |||
If you don't see a command prompt, try pressing enter. | |||
[ root@curl:/ ]$ nslookup google.com | |||
Server: 10.0.0.254 | |||
Address 1: 10.0.0.254 kube-dns.kube-system.svc.cluster.local | |||
Name: google.com | |||
Address 1: 2a00:1450:4016:803::200e muc12s04-in-x0e.1e100.net | |||
Address 2: 172.217.23.14 lhr35s01-in-f14.1e100.net | |||
</syntaxhighlight> | |||
=== reset to a clean state === | |||
Sometimes it helps to have a clean state on all instances: | Sometimes it helps to have a clean state on all instances: | ||