k3s-ansible icon indicating copy to clipboard operation
k3s-ansible copied to clipboard

Issue on Rasbian x64

Open jfbourner opened this issue 3 years ago • 9 comments

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

jfbourner avatar Mar 10 '22 13:03 jfbourner

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.

IanTeda avatar Mar 12 '22 00:03 IanTeda

I have the same issue even after adding the cgroup_memory=1 cgroup_enable=memory to /boot/cmdline.txt.

gaatnietdoor avatar Mar 15 '22 19:03 gaatnietdoor

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.

JohanNicander avatar Mar 31 '22 15:03 JohanNicander

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.

jpconstantineau avatar Apr 02 '22 23:04 jpconstantineau

enabling cgroups and then rebooting did the trick for me as well

dpedersen13 avatar Apr 22 '22 02:04 dpedersen13

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

tstackhouse avatar May 06 '22 15:05 tstackhouse

I just want to add that a fix for this is in the works here: PR #185

JohanNicander avatar May 08 '22 15:05 JohanNicander

having the same issue :(

francRang avatar Jun 06 '22 02:06 francRang

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

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

nouknouk avatar Jul 23 '22 16:07 nouknouk

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)

KI7ODK avatar Jan 29 '23 20:01 KI7ODK

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.

romelBen avatar Jun 02 '23 02:06 romelBen

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.

dereknola avatar Nov 09 '23 21:11 dereknola