Closed Squawkykaka closed 1 year ago
I have the same issue. I’m not sure the IP scheme is correct. Like do those ips need to be on the network you have set up or are they built with metallb
@Jimikephart The IPs need to be changed with the one according to your network.
@Squawkykaka This is not only happening in WSL, I encountered a similar issue too when trying to set 3 master nodes in hosts.ini. Setting 1 master node works though. 1 task fails for each of the 3 master nodes. Though not exactly the same error, it also had something to do with the "Init cluster inside the transient k3s-init service fails" task.
@timothystewart6 Any ideas?
@xymvl4t3d is it just an ip off my /24 then that doesn’t go to anything? My hardware is 10.10.0.3-10 with me running the commands on 10.10.0.7
@Jimikephart yes, unassigned IPs from your network. for e.g.
default: apiserver_endpoint: "192.168.30.222"
yours would be: apiserver_endpoint: "10.10.0.X"
X being an unassigned IP
@xymvl4t3d oh so my apiserver_endpoint shoul be 192.168.86.222 or something like that as all my ips have 86 in them
still broken after that and it also seems to be related to:
server_init_args: >- {% if groups[group_name_master | default('master')] | length > 1 %} {% if ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] %} --cluster-init {% else %} --server https://{{ hostvars[groups[group_name_master | default('master')][0]].k3s_node_ip | split(",") | first | ansible.utils.ipwrap }}:6443 {% endif %} --token {{ k3s_token }} {% endif %} {{ extra_server_args | default('') }}
Expected Behavior
I dont really know it just spit out a huge error
Current Behavior
It gets to the task then gives this error:
TASK [k3s_server : Init cluster inside the transient k3s-init service] ***** fatal: [192.168.86.45]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {% if groups[group_name_master | default('master')] | length > 1 %}\n {% if ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] %}\n --cluster-init\n {% else %}\n --server https://{{ hostvars[groups[group_name_master | default('master')][0]].k3s_node_ip | split(\",\") | first | ansible.utils.ipwrap }}:6443\n {% endif %}\n --token {{ k3s_token }}\n{% endif %} {{ extra_server_args | default('') }}: {{ extra_args }} {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }} --tls-san {{ apiserver_endpoint }} --disable servicelb --disable traefik: --flannel-iface={{ flannel_iface }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[flannel_iface][\"ipv4\"][\"address\"] }}: 'dict object' has no attribute 'eth0'\n\nThe error appears to be in '/home/gleask/ansible/k3s-ansible/roles/k3s_server/tasks/main.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Init cluster inside the transient k3s-init service\n ^ here\n"} fatal: [192.168.86.47]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {% if groups[group_name_master | default('master')] | length > 1 %}\n {% if ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] %}\n --cluster-init\n {% else %}\n --server https://{{ hostvars[groups[group_name_master | default('master')][0]].k3s_node_ip | split(\",\") | first | ansible.utils.ipwrap }}:6443\n {% endif %}\n --token {{ k3s_token }}\n{% endif %} {{ extra_server_args | default('') }}: {{ extra_args }} {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }} --tls-san {{ apiserver_endpoint }} --disable servicelb --disable traefik: --flannel-iface={{ flannel_iface }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[flannel_iface][\"ipv4\"][\"address\"] }}: 'dict object' has no attribute 'eth0'\n\nThe error appears to be in '/home/gleask/ansible/k3s-ansible/roles/k3s_server/tasks/main.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Init cluster inside the transient k3s-init service\n ^ here\n"} fatal: [192.168.86.46]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {% if groups[group_name_master | default('master')] | length > 1 %}\n {% if ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] %}\n --cluster-init\n {% else %}\n --server https://{{ hostvars[groups[group_name_master | default('master')][0]].k3s_node_ip | split(\",\") | first | ansible.utils.ipwrap }}:6443\n {% endif %}\n --token {{ k3s_token }}\n{% endif %} {{ extra_server_args | default('') }}: {{ extra_args }} {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }} --tls-san {{ apiserver_endpoint }} --disable servicelb --disable traefik: --flannel-iface={{ flannel_iface }} --node-ip={{ k3s_node_ip }}: {{ ansible_facts[flannel_iface][\"ipv4\"][\"address\"] }}: 'dict object' has no attribute 'eth0'\n\nThe error appears to be in '/home/gleask/ansible/k3s-ansible/roles/k3s_server/tasks/main.yml': line 21, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Init cluster inside the transient k3s-init service\n ^ here\n"}
PLAY RECAP ***** 192.168.86.43 : ok=12 changed=0 unreachable=0 failed=0 skipped=14 rescued=0 ignored=0 192.168.86.45 : ok=13 changed=0 unreachable=0 failed=1 skipped=22 rescued=0 ignored=0 192.168.86.46 : ok=13 changed=0 unreachable=0 failed=1 skipped=22 rescued=0 ignored=0 192.168.86.47 : ok=19 changed=4 unreachable=0 failed=1 skipped=16 rescued=0 ignored=0
Steps to Reproduce
Run the install script in ubuntu wsl
1. 2. 3. 4.
Context (variables)
Operating system: Windows 11 Home (WSL ubuntu)
Hardware:
Variables Used
all.yml
Hosts
host.ini
Possible Solution