k0sctl icon indicating copy to clipboard operation
k0sctl copied to clipboard

mDns as FQDN

Open mocallins opened this issue 3 months ago • 7 comments

Is mDns suported for the SSH:address ? And if so is there an extended timeout that is applicable for k0sctl appl resolving/connecting ?

mocallins avatar Sep 15 '25 22:09 mocallins

I think mDns does not work with static go binaries out of the box.

It could be possible to import something like https://github.com/hashicorp/mdns and use it to resolve and replace any .local addresses in the config.

It may be possible to extend the timeout via the --timeout flag (something like --timeout=30m) but it also sets a global timeout for the whole operation. Maybe adding some connection timeout option is doable.

kke avatar Sep 16 '25 11:09 kke

As a former network testing professional, i completely understand having the actual ip addresses. But this is the year 2025 and remembering the host names is so much easier, and especially now that we have mDns, since local DynDns never seemed to take a foothold. Even though when i was writing testing sfripts, we still created our own lookup system, using xml based files with attributes defining the name and actual ip address, but that was with rougher and switch testing, and in that environment everything was static anyway, but it was still so much easier to remember host/device names, and be able to address the device in question.

Just thought i'd try since all my devices here are just linux boxes, and mDns worls, i use it all he time in my homelab.

So is there any debug information available, giving me a hint as to what the problem is, sine my apply, does not seem to be working.

And if you want to turn this question into a suggestion, i think that would be worthwhile.

Also i didn't use any prebuilt binary, all the ones i could find to download all had "illegal exception" error, or something like that. So i ultimately compiled it myself locally.

Using it on Raspberry Pi Zero's with Raspbian Bookworm.

mocallins avatar Sep 17 '25 03:09 mocallins

I think mDns does not work with static go binaries out of the box.

It could be possible to import something like https://github.com/hashicorp/mdns and use it to resolve and replace any .local addresses in the config.

It may be possible to extend the timeout via the --timeout flag (something like --timeout=30m) but it also sets a global timeout for the whole operation. Maybe adding some connection timeout option is doable.

Well, as a heads up, lol. I got the k0sctl, basically working on my set of Raspberry Pi Zero's. I got all the way down to spoofing the version number for k0s, lol, via a quick shell script that Gemini responded with, and then i tweaked, lol.

With static ip addresses, in the k0sctsl.yaml, it runs much more smoothly, lol, and snappy. Manually trying to compile k0s , on a Zero is tending to be more troublesome,, especially when i had to rebuild the node i had compiled k0sctl, on. Lost all the compiled kubernetes code i had accomplished. But i suppose i can redo those, just not sure how involved i want hat to get, lol.

mocallins avatar Sep 21 '25 20:09 mocallins

Concerning mDNS, the usual answer is to use a stub resolver. That's what the k0s docs suggest. (Note that k0sctl is not built with musl libc, but still, similar caveats apply.)

twz123 avatar Sep 22 '25 13:09 twz123

I'm not sure what a stub receiver is, but i used the linux avahi-resolve-host-name , to get the ip addresses and then used it all as the list for k0sctl init.Thanks for the info

On Monday, September 22, 2025 at 08:46:39 AM CDT, Tom Wieczorek ***@***.***> wrote:  

twz123 left a comment (k0sproject/k0sctl#937) Concerning mDNS, the usual answer is to use a stub resolver. That's what the k0s docs suggest. (Note that k0sctl is not built with musl libc, but still, similar caveats apply.)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mocallins avatar Sep 22 '25 17:09 mocallins

I made an experimental PR to add support but I'm not convinced it's the right approach. You can try it if you want to.

kke avatar Sep 29 '25 11:09 kke

I'lll try it, to help out. Just not actually sure how to do that.

On Monday, September 29, 2025 at 06:44:57 AM CDT, Kimmo Lehto ***@***.***> wrote:  

kke left a comment (k0sproject/k0sctl#937) I made an experimental PR to add support but I'm not convinced it's the right approach. You can try it if you want to.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mocallins avatar Sep 30 '25 18:09 mocallins