https://rancher.com/ logo
#k3d
Title
# k3d
a

adamant-kite-43734

08/31/2022, 8:36 PM
This message was deleted.
q

quick-midnight-5000

08/31/2022, 8:37 PM
The
--no-lb
and disabling Traefik are to accommodate a pre-existing Traefik + MetalLB configuration, but perhaps it may be more appropriate to use Klipper at least?
I can drop the IP address to access the cluster under
localhost
no issue, mapping an
/etc/hosts
entry to
localhost
seems to fail because the port forward isn't actually listening for that host.
Ah, for future readers: this is because containers don't inherit
/etc/hosts
entries and need to be specified with
--host-alias
. And because
--host-alias
only understands IPs, it means you must have an
/etc/hosts
entry like
127.0.0.1 foobar.local
and then an additional
--host-alias 127.0.0.1 foobar.local
when running
k3d cluster create
w

wide-garage-9465

08/31/2022, 9:27 PM
The only error k3d states is that you didn't mention for which node you want to forward the ports. Since it's port 80, just go for
@loadbalancer
, appended to your -p value.
*just read it again and you disabled the lb, sorry.
Note though that --no-lb is not about Klipper but about k3d's cluster loadbalancer
q

quick-midnight-5000

08/31/2022, 9:30 PM
Ah, well I ended up dropping MetalLB and doing the above and it seems to work as expected. Perhaps MetalLB and Klipper were interfering with each other on top of the host mapping issue.
No, what I said about host aliasing isn't quite right, or at least unrelated. It's specifically just that
/etc/hosts
entries that map to
localhost
will not function whereas mapping directly to
127.0.0.1
will.
w

wide-garage-9465

09/04/2022, 2:01 PM
Ah sorry, I never got back to this. Well,
/etc/hosts
must have one IP per line, which it "resolves" the names on the same line to.
3 Views