https://rancher.com/ logo
#k3s
Title
q

quick-dentist-45681

01/12/2023, 6:39 PM
I'm trying to install k3s on a raspberry pi running dietpi (https://dietpi.com), using an external mysql database for datastorage. k3s is installed and looks ok, but for some reason it can't resolve the name of the mysql server. The network uses mdns for local names, so the mysql server is identified by
emrys.local
, which (after a few hickups with missing nss libraries and configuration) seems to resolve fine for everything else on the system, but k3s refuses to resolve it. Does k3s do direct DNS lookups? Is there a way to get it to resolve mdns names?
c

creamy-pencil-82913

01/12/2023, 7:13 PM
mdsns does not work in golang
you must use an actual DNS record served by a DNS server, or put it in the hosts file
q

quick-dentist-45681

01/12/2023, 7:18 PM
Ah, that's too bad. Was not planning on running a DNS server, and maintaining hosts file when using DHCP isn't really a great option either. Guess I'll have to take a step back and have a think. Thanks for the reply.
c

creamy-pencil-82913

01/12/2023, 7:19 PM
on home networks there is frequently one built in to your DHCP server, if you’re using dnsmasq or something
when you start exposing services across multiple nodes is usually a good time to start nailing down dns and IP reservations
q

quick-dentist-45681

01/12/2023, 7:21 PM
Yeah, there used to be one in my linksys router, but I recently switched to a mesh thingy which doesn't. This is only for a homelab.
Looking at the docs, it says it will use the C library routines if
cgo
is available under certain conditions. What does "`cgo` is available" mean in this context?
c

creamy-pencil-82913

01/12/2023, 7:40 PM
if the binary is built with cgo enabled.
q

quick-dentist-45681

01/12/2023, 7:41 PM
I'm guessing k3s isn't? 🙂
c

creamy-pencil-82913

01/12/2023, 7:44 PM
it is, because we build in sqlite (which is c) but because we do a static build (so as to be portable across distros) we use the pure go resolver
q

quick-dentist-45681

01/12/2023, 7:45 PM
Ok, thanks. I'll have to consider my options another day, todays homelab sessions can't fit a full makeover of name resolution in the network 😄
2 Views