https://rancher.com/ logo
Title
v

victorious-mouse-54341

02/21/2023, 6:07 PM
I have (what I hope) is a really easy question. I'm launching a k3d cluster using the following command:
k3d cluster create doctorconsul --network doctorconsul_wan --api-port 127.0.0.1:6443 --k3s-arg="--disable=traefik@server:0" -p "8502:443@loadbalancer"
This works pretty much exactly as expected. It drops into my "doctorconsul_wan" network that is already built in docker compose. The problem I'm having is that the external-IP used is dynamically the first available in that network (192.168.1.7 in my case) and I need to statically assign it (to 192.169.1.10). I'm not seeing a parameter to do so. I have a feeling that perhaps I have to pass a kube native config param through via
--kubeconfig-update-default
, but frankly I don't know nearly enough about kube to figure that out. Any help is much appreciated. Thanks!
When I describe the server node, I have this annotation:
<http://k3s.io/internal-ip|k3s.io/internal-ip>: 192.169.7.7
I'm guessing I probably have to do something with this 😄
In k3s it looks like this is accomplished via:
server --node-ip 192.169.7.10
So the question now, is how do I pass this arg to k3d on cluster create? Getting closer 🙂
I tried the following and neither set the server node IP. Still 192.169.7.7. I feel that I'm really close though....
k3d cluster create doctorconsul --network doctorconsul_wan --api-port 127.0.0.1:6443 --k3s-arg="--disable=traefik@server:0" -p "8502:443@loadbalancer --node-ip 192.169.7.10"
k3d cluster create doctorconsul --network doctorconsul_wan --api-port 127.0.0.1:6443 --k3s-arg="--disable=traefik@server:0" -p "8502:443@loadbalancer --node-ip=192.169.7.10"
okay. looks like I was misunderstanding the k3s-args syntax. Changed it, but now am getting a node filter error. a little closer:
$ k3d cluster create doctorconsul --network doctorconsul_wan --api-port 127.0.0.1:6443 -p "8502:443@loadbalancer" \
    --k3s-arg="--disable=traefik@server:0" \
    --k3s-arg="--node-ip=192.169.7.10"
INFO[0000] portmapping '8502:443' targets the loadbalancer: defaulting to [servers:*:proxy agents:*:proxy]
FATA[0000] K3sExtraArg '--node-ip=192.169.7.10' lacks a node filter, but there's more than one node
got it.
k3d cluster create doctorconsul --network doctorconsul_wan --api-port 127.0.0.1:6443 -p "8502:443@loadbalancer"     --k3s-arg="--disable=traefik@server:0" --k3s-arg="--node-ip=192.169.7.10@servers:*"
Works