Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying against servers on KVM with enp1s0 instead of eth0 fails. Eth0 seems to be hardcoded somewhere #621

Open
1 task done
dwedia opened this issue Dec 18, 2024 · 0 comments

Comments

@dwedia
Copy link

dwedia commented Dec 18, 2024

URL leads to a 404

Expected Behavior

I changed eth0 to enp1s0 in groupvars/all.yml.
Deployment should now run on my 3 target servers.

Current Behavior

The ansible playbook site.yml fails at this step:

TASK [k3s_server : Validating arguments against arg spec 'main' - Setup k3s servers] *************************************
task path: /root/k3s-ansible/site.yml:38
fatal: [192.168.122.11]: FAILED! => 
  msg: '{{ ''--flannel-iface='' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '''' }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ''--flannel-iface='' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '''' }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object''
    has no attribute ''eth0''. ''dict object'' has no attribute ''eth0'''
fatal: [192.168.122.12]: FAILED! => 
  msg: '{{ ''--flannel-iface='' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '''' }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ''--flannel-iface='' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '''' }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object''
    has no attribute ''eth0''. ''dict object'' has no attribute ''eth0'''
fatal: [192.168.122.13]: FAILED! => 
  msg: '{{ ''--flannel-iface='' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '''' }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ''--flannel-iface='' + flannel_iface if calico_iface is not defined and cilium_iface is not defined else '''' }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object'' has no attribute ''eth0''. ''dict object'' has no attribute ''eth0''. {{ ansible_facts[(cilium_iface | default(calico_iface | default(flannel_iface)))][''ipv4''][''address''] }}: ''dict object''
    has no attribute ''eth0''. ''dict object'' has no attribute ''eth0'''

Steps to Reproduce

  1. changed flannel_iface: eth0 > flannel_iface: enp1s0
  2. ran deployment playbook.

Context (variables)

Operating system: Ubuntu 24.04

Hardware: Virtual Machines running on KVM (virtman) installed on Fedora Silverblue (testing environment on my local laptop).

Variables Used

all.yml

k3s_version: "v1.30.2+k3s2"
ansible_user: NA
systemd_dir: "/etc/systemd/system"

flannel_iface: "enp1s0"

#calico_iface: "eth0"
calico_ebpf: "false"
calico_cidr: "cluster_cidr: 10.52.0.0/16"
calico_tag: "v3.28.0"

apiserver_endpoint: "192.168.122.210"

k3s_token: "NA"

extra_server_args: ">-
  {{ extra_args }}
  {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }}
  {% if calico_iface is defined or cilium_iface is defined %}
  --flannel-backend=none
  --disable-network-policy
  --cluster-cidr={{ cluster_cidr | default('10.52.0.0/16') }}
  {% endif %}
  --tls-san {{ apiserver_endpoint }}
  --disable servicelb
  --disable traefik
"
extra_agent_args: ">-
  {{ extra_args }}
  "--kubelet-arg node-status-update-frequency=5s""

kube_vip_tag_version: "v0.8.2"

#kube_vip_cloud_provider_tag_version: "main"
#kube_vip_lb_ip_range: "192.168.30.80-192.168.30.90"

metal_lb_speaker_tag_version: "v0.14.8"
metal_lb_controller_tag_version: "v0.14.8"

metal_lb_ip_range: "192.168.122.215-192.168.122.219"

Hosts

host.ini

[master]
192.168.122.11
192.168.122.12
192.168.122.13

[node]
#192.168.122.11
#192.168.122.12
#192.168.122.13

# only required if proxmox_lxc_configure: true
# must contain all proxmox instances that have a master or worker node
# [proxmox]
# 192.168.30.43

[k3s_cluster:children]
master
node

Possible Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant