k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
28.22k stars 2.36k forks source link

Install fails on Raspberry Pi 4 2021-03-04-raspios-buster-armhf-lite #3283

Closed NRKirby closed 3 years ago

NRKirby commented 3 years ago

K3s Version:

k3s version v1.20.6+k3s1 (8d043282)
go version go1.16.2

Node(s) CPU architecture, OS, and Version: Linux kmaster 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux

Cluster Configuration: Single master node

Describe the bug: Installing k3s fails on newly installed 2021-03-04-raspios-buster-armhf-lite on Raspberry Pi

Steps To Reproduce:

pi@kmaster:~ $ curl -sfL https://get.k3s.io | sh -
[INFO]  Finding release for channel stable
[INFO]  Using v1.20.6+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.20.6+k3s1/sha256sum-arm.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.20.6+k3s1/k3s-armhf
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s
Job for k3s.service failed because the control process exited with error code.
See "systemctl status k3s.service" and "journalctl -xe" for details.

Expected behavior: k3s installs successfully

Actual behavior: k3s doesn't install successfully

Additional context / logs:

pi@kmaster:~ $ journalctl -xe
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.322416342+01:00" level=info msg="Running kube-controller-ma
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.328309717+01:00" level=info msg="Node token is available at
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.328401438+01:00" level=info msg="To join node to cluster: k
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.332063421+01:00" level=info msg="Wrote kubeconfig /etc/ranc
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.332155716+01:00" level=info msg="Run: k3s kubectl"
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.332467526+01:00" level=error msg="Failed to find memory cgr
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.332646912+01:00" level=fatal msg="failed to find memory cgr
May 06 18:28:02 kmaster systemd[1]: k3s.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit k3s.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
May 06 18:28:02 kmaster systemd[1]: k3s.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit k3s.service has entered the 'failed' state with result 'exit-code'.
May 06 18:28:02 kmaster systemd[1]: Failed to start Lightweight Kubernetes.
-- Subject: A start job for unit k3s.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit k3s.service has finished with a failure.
--
-- The job identifier is 3200 and the job result is failed.
pi@kmaster:~ $ systemctl status k3s.service
● k3s.service - Lightweight Kubernetes
   Loaded: loaded (/etc/systemd/system/k3s.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2021-05-06 18:30:54 BST; 2s ago
     Docs: https://k3s.io
  Process: 7082 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
  Process: 7083 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
  Process: 7084 ExecStart=/usr/local/bin/k3s server (code=exited, status=1/FAILURE)
 Main PID: 7084 (code=exited, status=1/FAILURE)
brandond commented 3 years ago

You appear to have cut off the meaningful errors:

May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.332467526+01:00" level=error msg="Failed to find memory cgr
May 06 18:28:02 kmaster k3s[6404]: time="2021-05-06T18:28:02.332646912+01:00" level=fatal msg="failed to find memory cgr

See the thread at https://github.com/k3s-io/k3s/issues/2067#issuecomment-664052806

NRKirby commented 3 years ago

@brandond thanks for your reply.

Following the link in the thread link you posted I have:

and I appear to be getting the same error

May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.307774   11816 server.go:659] external host was not specified, using 192.168.1.50
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.308804   11816 server.go:196] Version: v1.20.6+k3s1
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.321396   11816 shared_informer.go:240] Waiting for caches to sync for node_authorizer
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.325919   11816 plugins.go:158] Loaded 12 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,TaintNodesBy
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.325967   11816 plugins.go:161] Loaded 10 validating admission controller(s) successfully in the following order: LimitRanger,ServiceAccount,Priority,PersistentVolumeClaimResize,RuntimeC
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.330280   11816 plugins.go:158] Loaded 12 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,TaintNodesBy
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.330329   11816 plugins.go:161] Loaded 10 validating admission controller(s) successfully in the following order: LimitRanger,ServiceAccount,Priority,PersistentVolumeClaimResize,RuntimeC
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.404350   11816 instance.go:289] Using reconciler: lease
May 06 18:51:44 kmaster k3s[11816]: I0506 18:51:44.530346   11816 rest.go:131] the default service ipfamily for this cluster is: IPv4
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.429822   11816 genericapiserver.go:425] Skipping API batch/v2alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.471311   11816 genericapiserver.go:425] Skipping API discovery.k8s.io/v1alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.517179   11816 genericapiserver.go:425] Skipping API node.k8s.io/v1alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.551677   11816 genericapiserver.go:425] Skipping API rbac.authorization.k8s.io/v1alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.566793   11816 genericapiserver.go:425] Skipping API scheduling.k8s.io/v1alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.590874   11816 genericapiserver.go:425] Skipping API storage.k8s.io/v1alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.601671   11816 genericapiserver.go:425] Skipping API flowcontrol.apiserver.k8s.io/v1alpha1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.622868   11816 genericapiserver.go:425] Skipping API apps/v1beta2 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: W0506 18:51:45.622922   11816 genericapiserver.go:425] Skipping API apps/v1beta1 because it has no resources.
May 06 18:51:45 kmaster k3s[11816]: I0506 18:51:45.660933   11816 plugins.go:158] Loaded 12 mutating admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,TaintNodesBy
May 06 18:51:45 kmaster k3s[11816]: I0506 18:51:45.660984   11816 plugins.go:161] Loaded 10 validating admission controller(s) successfully in the following order: LimitRanger,ServiceAccount,Priority,PersistentVolumeClaimResize,RuntimeC
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.751373220+01:00" level=info msg="Waiting for API server to become available"
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.751427572+01:00" level=info msg="Running kube-scheduler --address=127.0.0.1 --bind-address=127.0.0.1 --kubeconfig=/var/lib/rancher/k3s/server/cred/scheduler.kubeconfig --lead
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.754249462+01:00" level=info msg="Running kube-controller-manager --address=127.0.0.1 --allocate-node-cidrs=true --bind-address=127.0.0.1 --cluster-cidr=10.42.0.0/16 --cluster
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.759007050+01:00" level=info msg="Node token is available at /var/lib/rancher/k3s/server/token"
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.759579968+01:00" level=info msg="To join node to cluster: k3s agent -s https://192.168.1.50:6443 -t ${NODE_TOKEN}"
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.763352865+01:00" level=info msg="Wrote kubeconfig /etc/rancher/k3s/k3s.yaml"
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.763912025+01:00" level=info msg="Run: k3s kubectl"
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.764695163+01:00" level=error msg="Failed to find memory cgroup, you may need to add \"cgroup_memory=1 cgroup_enable=memory\" to your linux cmdline (/boot/cmdline.txt on a Ras
May 06 18:51:45 kmaster k3s[11816]: time="2021-05-06T18:51:45.764781606+01:00" level=fatal msg="failed to find memory cgroup, you may need to add \"cgroup_memory=1 cgroup_enable=memory\" to your linux cmdline (/boot/cmdline.txt on a Ras
May 06 18:51:45 kmaster systemd[1]: k3s.service: Main process exited, code=exited, status=1/FAILURE

Do you know what I'm doing wrong here?

brandond commented 3 years ago

Did you reboot?

NRKirby commented 3 years ago

I uninstalled, rebooted and tried reinstalling & still getting the same error: Failed to find memory cgroup, you may need to add \"cgroup_memory=1 cgroup_enable=memory\" to your linux cmdline

Here is what's in my /boot/cmdline.txt

pi@kmaster:~ $ cat /boot/cmdline.txt
console=serial0,115200 console=tty1 root=PARTUUID=915d5385-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

Appreciate your time here, thank you

brandond commented 3 years ago

It needs to be put at the end of the existing first line, after all the other values, not on a line by itself. It's the kernel cmdline, not cmdlines.

NRKirby commented 3 years ago

Thanks!