techno-tim / k3s-ansible

The easiest way to bootstrap a self-hosted High Availability Kubernetes cluster. A fully automated HA k3s etcd install with kube-vip, MetalLB, and more. Build. Destroy. Repeat.
https://technotim.live/posts/k3s-etcd-ansible/
Apache License 2.0
2.41k stars 1.05k forks source link

flannel_iface (or any other _iface) should have a variable set for each node #593

Closed alfredodeluca closed 2 weeks ago

alfredodeluca commented 2 weeks ago

Expected Behavior

As I have different NIC card I should be able to set the flannel_iface or cilium or calico iface for each node

Current Behavior

If I set eth0 on one node but on different nodes I don't have eth0 set, the installation fails

Steps to Reproduce

  1. Set flannel_iface to eth0
  2. Run the deploy
  3. if you have a different NIC on nodes the deployment will fail

Context (variables)

flannel_iface: calico_iface: cilium_iface:

Operating system: Debian and Ubuntu

Hardware: DIfferent laptop brand

Variables Used

all.yml

k3s_version: ""
ansible_user: NA
systemd_dir: ""

flannel_iface: "enp12s0"

#calico_iface: ""
calico_ebpf: ""
calico_cidr: ""
calico_tag: ""

apiserver_endpoint: ""

k3s_token: "NA"

extra_server_args: ""
extra_agent_args: ""

kube_vip_tag_version: ""

kube_vip_cloud_provider_tag_version: ""
kube_vip_lb_ip_range: ""

metal_lb_speaker_tag_version: ""
metal_lb_controller_tag_version: ""

metal_lb_ip_range: ""

Hosts

host.ini

[master]
IP.ADDRESS.ONE
IP.ADDRESS.TWO
IP.ADDRESS.THREE

[node]
IP.ADDRESS.FOUR
IP.ADDRESS.FIVE

[k3s_cluster:children]
master
node

Possible Solution

berendt commented 2 weeks ago

You have to use the host vars to set a flannel_iface parameter per host (or to overwrite the value set in all.yml for a single host with a different interface name).

alfredodeluca commented 2 weeks ago

Thanks @berendt. that worked! cheers