Closed harrywesterman closed 1 year ago
Installing a fresh cluster, getting and error suddenly. Worked fine last summer with an older version of the scripts
It will not create the apiserver_endpoint
I get the error: TASK [k3s/master : Configure kubectl cluster to https://{{ apiserver_endpoint | ansible.utils.ipwrap }}:6443] **** Saturday 12 November 2022 17:42:20 +0100 (0:00:00.502) 0:00:41.524 ***** fatal: [192.168.1.50]: FAILED! => changed=true cmd:
~harry/.kube/config delta: '0:00:00.107591' end: '2022-11-12 17:42:20.771640' msg: non-zero return code rc: 1 start: '2022-11-12 17:42:20.664049' stderr: 'error: Unexpected args: [default apiserver_endpoint | ansible.utils.ipwrap }}:6443]' stderr_lines: stdout: |- Set a cluster entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values for those fields.
Just running the installer on my six fresh proxmox vm's, installed with jammy-server-cloudimg-amd64.img template. Running on three Intel NUC machines.
Operating system: Windows 10 WSL Ubunt8
Hardware: My simple W10 workstation.
all.yml
k3s_version: v1.24.7+k3s1
ansible_user: harry systemd_dir: /etc/systemd/system
system_timezone: "Europe/Amsterdam"
flannel_iface: "eth0"
apiserver_endpoint: "192.168.1.80"
k3s_token: "some-SUPER-DEDEUPER-secret-password"
k3s_node_ip: '{{ ansible_facts[flannel_iface]["ipv4"]["address"] }}'
k3s_master_taint: "{{ true if groups['node'] | default([]) | length >= 1 else false }}"
extra_args: >- --flannel-iface={{ flannel_iface }} --node-ip={{ k3s_node_ip }}
extra_server_args: >- {{ extra_args }} {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }} --tls-san {{ apiserver_endpoint }} --disable servicelb --disable traefik extra_agent_args: >- {{ extra_args }}
kube_vip_tag_version: "v0.5.5"
metal_lb_speaker_tag_version: "v0.13.7" metal_lb_controller_tag_version: "v0.13.7"
metal_lb_ip_range: "192.168.1.40-192.168.1.49"
host.ini [master] 192.168.1.50 192.168.1.51 192.168.1.52
host.ini
[node] 192.168.1.53 192.168.1.54 192.168.1.55
[k3s_cluster:children] master node
Installing a fresh cluster, getting and error suddenly. Worked fine last summer with an older version of the scripts
Expected Behavior
It will not create the apiserver_endpoint
Current Behavior
I get the error: TASK [k3s/master : Configure kubectl cluster to https://{{ apiserver_endpoint | ansible.utils.ipwrap }}:6443] **** Saturday 12 November 2022 17:42:20 +0100 (0:00:00.502) 0:00:41.524 ***** fatal: [192.168.1.50]: FAILED! => changed=true cmd:
~harry/.kube/config delta: '0:00:00.107591' end: '2022-11-12 17:42:20.771640' msg: non-zero return code rc: 1 start: '2022-11-12 17:42:20.664049' stderr: 'error: Unexpected args: [default apiserver_endpoint | ansible.utils.ipwrap }}:6443]' stderr_lines:
stdout: |-
Set a cluster entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values for those fields.
Steps to Reproduce
Just running the installer on my six fresh proxmox vm's, installed with jammy-server-cloudimg-amd64.img template. Running on three Intel NUC machines.
Context (variables)
Operating system: Windows 10 WSL Ubunt8
Hardware: My simple W10 workstation.
Variables Used
all.yml
k3s_version: v1.24.7+k3s1
this is the user that has ssh access to these machines
ansible_user: harry systemd_dir: /etc/systemd/system
Set your timezone
system_timezone: "Europe/Amsterdam"
interface which will be used for flannel
flannel_iface: "eth0"
apiserver_endpoint is virtual ip-address which will be configured on each master
apiserver_endpoint: "192.168.1.80"
k3s_token is required masters can talk together securely
this token should be alpha numeric only
k3s_token: "some-SUPER-DEDEUPER-secret-password"
The IP on which the node is reachable in the cluster.
Here, a sensible default is provided, you can still override
it for each of your hosts, though.
k3s_node_ip: '{{ ansible_facts[flannel_iface]["ipv4"]["address"] }}'
Disable the taint manually by setting: k3s_master_taint = false
k3s_master_taint: "{{ true if groups['node'] | default([]) | length >= 1 else false }}"
these arguments are recommended for servers as well as agents:
extra_args: >- --flannel-iface={{ flannel_iface }} --node-ip={{ k3s_node_ip }}
change these to your liking, the only required are: --disable servicelb, --tls-san {{ apiserver_endpoint }}
extra_server_args: >- {{ extra_args }} {{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }} --tls-san {{ apiserver_endpoint }} --disable servicelb --disable traefik extra_agent_args: >- {{ extra_args }}
image tag for kube-vip
kube_vip_tag_version: "v0.5.5"
image tag for metal lb
metal_lb_speaker_tag_version: "v0.13.7" metal_lb_controller_tag_version: "v0.13.7"
metallb ip range for load balancer
metal_lb_ip_range: "192.168.1.40-192.168.1.49"
Hosts
host.ini
[master] 192.168.1.50 192.168.1.51 192.168.1.52[node] 192.168.1.53 192.168.1.54 192.168.1.55
[k3s_cluster:children] master node
Possible Solution