k3s-ansible
k3s-ansible copied to clipboard
Issue on Rasbian x64
When installing on the x64 Rasbian lite I got the below errors
FAILED! => {"changed": false, "msg": "Unable to start service k3s-node: Job for k3s-node.service failed because the control process exited with error code.\nSee "systemctl status k3s-node.service" and "journalctl -xe" for details.\n"}
Mar 10 12:47:57 master-node k3s[11411]: time="2022-03-10T12:47:57Z" level=info msg="Run: k3s kubectl" Mar 10 12:47:57 master-node k3s[11411]: time="2022-03-10T12:47:57Z" level=fatal msg="failed to find memory cgroup (v2)" Mar 10 12:47:57 master-node systemd[1]: k3s.service: Main process exited, code=exited, status=1/FAILURE
I used this to resolve the issue. (Caveat that I have no idea what it does, but it resolved the issue for me) https://github.com/k3s-io/k3s/issues/1825#issuecomment-766322321
Experiencing the same error, suspect the playbook is not setting cgroup_memory=1 cgroup_enable=memory for Rasbian x64.
TASK [raspberrypi : Set detected_distribution to Raspbian (ARM64 on Debian Buster)] **************************************************
Saturday 12 March 2022 11:01:00 +1100 (0:00:00.051) 0:00:55.282 ********
skipping: [node-1]
skipping: [node-2]
Manually adding cgroup_memory=1 cgroup_enable=memory to /boot/cmdline.txt and re-running playbook worked.
I have the same issue even after adding the cgroup_memory=1 cgroup_enable=memory to /boot/cmdline.txt.
I have the same issue even after adding the cgroup_memory=1 cgroup_enable=memory to /boot/cmdline.txt.
For me enabling cgroups and then rebooting did the trick.
Although the playbook does have the code to be able to set cgroup support (see here), it doesn't get triggered.
I suspect the way the playbook detects Rasbian doesn't correctly pick up the latest 64 bit release and as such, does not run the necessary tasks.
enabling cgroups and then rebooting did the trick for me as well
Looking into this, it's not properly detecting the newest "raspberry pi os" since they renamed raspbian...
https://github.com/k3s-io/k3s-ansible/blob/master/roles/raspberrypi/tasks/main.yml#L20-L34
It seems like they report regular 'ol Debian:
fox@node1:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
I just want to add that a fix for this is in the works here: PR #185
having the same issue :(
FYI,
1) Same issue here, with RPI4 and raspbian lite ARM64.
- ansible_facts.lsb.id="Debian"
- ansible_facts.lsb.description="Debian GNU/Linux 11 (bullseye)"
shouldn't we add Debian as an eligible lsb.id ?
- name: Set detected_distribution to Raspbian
set_fact:
detected_distribution: Raspbian
when: >
raspberry_pi|default(false) and
( ansible_facts.lsb.id|default("") == "Raspbian" or
ansible_facts.lsb.id|default("") == "Debian" or
ansible_facts.lsb.description|default("") is match("[Rr]aspbian.*") )
2) Also, I get an issue with iptables-legacy
-
it seems to be required according to Rancher documentation
-
the playbook returns an error:
TASK [raspberrypi : Flush iptables before changing to iptables-legacy] *********************************************************************************
fatal: [rpi4.lan]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"iptables\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}
EDIT: forcing installation of iptables seems to do the trick, in Raspbian.yml
- name: Ensure package iptables is installed
apt:
pkg:
- iptables
I just want to add that a fix for this is in the works here: PR #185
Yep. I used this fix the other day deploying to the latest version of Raspberry Pi OS, and it worked. I believe #185 also fixes the iptables-legacy issue.
Removed requirement for iptables on Rasbpian Bullseye (this is because bullseye comes with nftables preinstalled)
I'm having the same issue with Raspbian Bullseye 64bit with the same error level=fatal msg="failed to find memory cgroup (v2)". Even with the cgroup_memory=1 cgroup_enable=memory added, I'm still receiving this error when setting up k3s.
I hope a fix will be had soon.
https://github.com/k3s-io/k3s-ansible/pull/151 has now been merged and iptables and cgroups issues around PI should now be resolved. Feel free to reopen if issue still exists.