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

AnsibleFilterError: Unrecognized type <<type 'unicode'>> for ipaddr filter <value> #346

Closed bvduijn closed 1 year ago

bvduijn commented 1 year ago

Expected Behavior

Trying to deploy K3s with the Ansible playbook

Current Behavior

Got an error " AnsibleFilterError: Unrecognized type <<type 'unicode'>> for ipaddr filter " on the "Copy vip manifest to first master" step.

Steps to Reproduce

Context (variables)

Operating system:

Hardware: 2 master VMs in proxmox as well as 2 nodes 1 master raspberry pi with DietPi 1 Node Rock64 with DietPi

Variables Used

all.yml

k3s_version: v1.25.9+k3s1

ansible_user: NA
systemd_dir: /etc/systemd/system

system_timezone: "Europe/Amsterdam"
flannel_iface: "eth0"
apiserver_endpoint: "192.168.40.200"

k3s_token: "NA"

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
  --disable local-storage
extra_agent_args: >-
  {{ extra_args }}

kube_vip_tag_version: "v0.5.12"
metal_lb_type: "native"
metal_lb_mode: "bgp"

metal_lb_speaker_tag_version: "v0.13.9"
metal_lb_controller_tag_version: "v0.13.9"

metal_lb_ip_range: "192.168.30.80-192.168.30.90"

Hosts

host.ini

[master]
192.168.40.201
192.168.40.202
192.168.40.203

[node]
192.168.40.204
192.168.40.205
192.168.40.206

[k3s_cluster:children]
master
node

Possible Solution

Tracked it down to the offending line https://github.com/techno-tim/k3s-ansible/blob/master/roles/k3s_server/templates/vip.yaml.j2#L38