borancar / talos-pxe

17 stars 5 forks source link

PXE image doesn't start? #2

Closed edude03 closed 1 year ago

edude03 commented 2 years ago

Followed the instructions, with the fixes in #1, but after booting the image, the network container produces an error and doesn't start: IMG_3272

(sorry for the picture of text, don't have remote access to this machine)

borancar commented 2 years ago

Thanks for the bug report - I didn't implement anything in case no interfaces are brought up or none are provided. Ideally, you'd to provide the --if parameter pointing to your eth device of choice (guessing eth0 in your case?). Alternatively, if you're interested in proxyDHCP, then you'd want to use LinuxKit to configure the network device.

borancar commented 2 years ago

Also, bear with me while the project is in initial phases and documentation is bad.

edude03 commented 2 years ago

Yeah no worries about the docs / project state, I'm not expecting commercial support or anything 😅

Re: interfaces, I've never used linuxkit before this project, I'm googling but I don't see any obvious way of setting up networking, what do you recommend there?

borancar commented 2 years ago

Normally the first interface would be eth0 on LinuxKit. So if you want talos-pxe to set up networking, then just change linux.yml:

    command: ["/go/bin/talos-pxe", "--root", "/srv"]

to

    command: ["/go/bin/talos-pxe", "--root", "/srv", "--if", "eth0"]

If your situation differs and there are multiple network interfaces connected, might be worthwhile checking and trying them.

EDIT: You'll need to rebuild the image obviously.

borancar commented 2 years ago

Alternatively, if you want proxyDHCP (so using external DHCP), then this is the way to go: Either DHCP as similar to this example https://github.com/linuxkit/linuxkit/blob/master/examples/minimal.yml or static IP as https://github.com/linuxkit/linuxkit/blob/master/examples/static-ip.yml

edude03 commented 2 years ago

Ok I’ll give both a try. I want proxyDHCP but I’m also considering turning off DHCP on this network so static makes sense as well

Get Outlook for iOShttps://aka.ms/o0ukef


From: Boran Car @.> Sent: Sunday, November 14, 2021 1:12:09 PM To: borancar/talos-pxe @.> Cc: Michael Francis @.>; Author @.> Subject: Re: [borancar/talos-pxe] PXE image doesn't start? (Issue #2)

Alternatively, if you want proxyDHCP (so using external DHCP), then this is the way to go: Either DHCP as similar to this example https://github.com/linuxkit/linuxkit/blob/master/examples/minimal.yml or static IP as https://github.com/linuxkit/linuxkit/blob/master/examples/static-ip.yml

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/borancar/talos-pxe/issues/2#issuecomment-968339093, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADYXEYRAHSKZQGTY3ZRD63UL73XTANCNFSM5IADJZLA.

borancar commented 2 years ago

Remember, with proxyDHCP you will probably need to override DNS so the talos nodes can resolve controlplane.talos, or perhaps add a manual entry to your DNS once you see the address assigned.

With talos-pxe handling everything (so DHCP turned off), there's no need as talos-pxe injects itself as the DNS, forwarding to 1.1.1.1 or whatever you configure via --dns.

Have a look at the flags for configuration options:

        serverRootFlag := flag.String("root", ".", "Server root, where to serve the files from")
        ifNameFlag := flag.String("if", "eth0", "Interface to use")
        ipAddrFlag := flag.String("addr", "192.168.123.1/24", "Address to listen on")
        gwAddrFlag := flag.String("gw", "", "Override gateway address")
        dnsAddrFlag := flag.String("dns", "", "Override DNS address")
        controlplaneFlag := flag.String("controlplane", "controlplane.talos.", "Controlplane address")
edude03 commented 2 years ago

I was just looking at that - OK, so is the expectation with this image that you'll set a static IP this machine in the linux.yml file to 192.168.123.1 then otherwise, you can just use the image as is?

In my case I changed controlplane.talos to 192.168.2.2 which is the static IP I set in my router for this machine, so looks like I'd need to set the config flag too, and also the ipAddress flag, then enable DHCP. Does that sound about right?

borancar commented 2 years ago

Nah, this machine shouldn't use controlplane.talos - the brought up masters should use that entry. talos-pxe has no role within the talos cluster. You'll know the address you need to set it to once talos-pxe brings up the first/bootstrap master node.

As for the static IP set there, you'll want to set it then to 192.168.2.2.

borancar commented 2 years ago

Easiest and quickest setup for you perhaps:

  1. Leave DHCP enabled
  2. Configure DHCP Client in linux.yml following https://github.com/linuxkit/linuxkit/blob/master/examples/minimal.yml
  3. Try connecting other machines and seeing what you get
borancar commented 2 years ago

Also, let me know if you get issues with startup - my limited machine availability meant that I only tested some configurations. But it's super easy to add support for more.

And sorry about the rocky road.

borancar commented 1 year ago

I'm going to close this since there's been no activity for 2 years.