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

Changes vor using on Raspian OS-64 Bullseye #13

Closed Thro42 closed 2 years ago

Thro42 commented 2 years ago

I try to use this repro. to create a cluster with Raspberry Pi installt with the newest Raspian OS 64BIT (Bullseye).

Expected Behavior

First Problemist that in roles/raspberrypi/tasks/main.yml Raspbian will not detected. After Fix that in Raspbian.yml the tasks for iptables and ip6tables will not run. This depends while iptables is not install on Debian 11.

Current Behavior

Steps to Reproduce

  1. Install Raspian OS 64BIT (Bullseye) on all Nodes
  2. Run deploy.sh

Context (variables)

Operating system: Raspian OS-64 Bullseye

Variables Used:

k3s_version: "v1.23.4+k3s1"
ansible_user: NA
systemd_dir: /etc/systemd/system

flannel_iface:"eth0"

apiserver_endpoint: "192.168.42.42"

k3s_token: "NA"

extra_server_args: "--no-deploy servicelb --write-kubeconfig-mode 644 --kube-apiserver-arg default-not-ready-toleration-seconds=30 --kube-apiserver-arg default-unreachable-toleration-seconds=30 --kube-controller-arg node-monitor-period=20s --kube-controller-arg node-monitor-grace-period=20s --kubelet-arg node-status-update-frequency=5s"
extra_agent_args: "--kubelet-arg node-status-update-frequency=5s"

kube_vip_tag_version:"v0.4.2"

# image tag for metal lb
metal_lb_speaker_tag_version: "v0.12.1"
metal_lb_controller_tag_version: "v0.12.1"

# metallb ip range for load balancer
metal_lb_ip_range: "192.168.30.23-192.168.30.33"

Possible Solution

Insert task in roles/raspberrypi/tasks/main.yml ~line 40

- name: Set detected_distribution to Raspbian (ARM64 on Debian Bullseye)
  set_fact:
    detected_distribution: Raspbian
  when:
    - ansible_facts.architecture is search("aarch64")
    - raspberry_pi|default(false)
    - ansible_facts.lsb.description|default("") is match("Debian.*bullseye")

create Copy roles/raspberrypi/tasks/prereq/Raspbian.yml to roles/raspberrypi/tasks/prereq/Raspbian-11.yml insert task in roles/raspberrypi/tasks/prereq/Raspbian-11.yml on second position

- name: Install iptables on Bullseye
  apt: name=iptables state=present
timothystewart6 commented 2 years ago

@Thro42 thank you! Would love a PR for this if you have some time!

svartis commented 2 years ago

I have created a PR based on @Thro42 suggestions #18

timothystewart6 commented 2 years ago

This was closed by https://github.com/techno-tim/k3s-ansible/pull/18 Thank you!