k3s-install.sh error: Failed to apply container_runtime_exec_t to /usr/local/bin/k3s, #8188
Replies: 2 comments
-
|
If you don't want to use selinux, you should disable it at the host level before installing K3s. If selinux support is active on the host, you should install the selinux support packages and enable it in the k3s configuration for things to function properly. |
Beta Was this translation helpful? Give feedback.
-
|
I had disable SELinux, so I try uninstall it with: sudo dnf remove selinux*and when I had all removed I tried again: #!/bin/bash
curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode "0644" \
--disable metrics-server but, afresh the script installed selinux support: [INFO] Finding release for channel stable
[INFO] Using v1.27.4+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.27.4+k3s1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.27.4+k3s1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
[INFO] Finding available k3s-selinux versions
Rancher K3s Common (stable) 5.8 kB/s | 2.9 kB 00:00
Dependencies resolved.
============================================================================================================================================================================================
Package Architecture Version Repository Size
============================================================================================================================================================================================
Installing:
k3s-selinux noarch 1.4-1.el9 rancher-k3s-common-stable 21 k
Installing dependencies:
checkpolicy x86_64 3.5-1.el9 ol9_appstream 355 k
container-selinux noarch 3:2.205.0-1.el9_2 ol9_appstream 63 k
policycoreutils-python-utils noarch 3.5-1.el9 ol9_appstream 113 k
python3-audit x86_64 3.0.7-103.el9 ol9_appstream 88 k
python3-distro noarch 1.5.0-7.el9 ol9_appstream 50 k
python3-libselinux x86_64 3.5-1.el9 ol9_appstream 198 k
python3-libsemanage x86_64 3.5-1.el9 ol9_appstream 84 k
python3-policycoreutils noarch 3.5-1.el9 ol9_appstream 2.3 M
python3-setools x86_64 4.4.1-1.el9 ol9_baseos_latest 791 k
rpm-plugin-selinux x86_64 4.16.1.3-22.0.1.el9 ol9_baseos_latest 16 k
selinux-policy noarch 38.1.11-2.0.1.el9_2.3 ol9_baseos_latest 57 k
selinux-policy-targeted noarch 38.1.11-2.0.1.el9_2.3 ol9_baseos_latest 7.7 M
Transaction Summary
============================================================================================================================================================================================
Install 13 Packages
Total download size: 12 M
Installed size: 29 M
Downloading Packages:
(1/13): rpm-plugin-selinux-4.16.1.3-22.0.1.el9.x86_64.rpm 60 kB/s | 16 kB 00:00
(2/13): selinux-policy-38.1.11-2.0.1.el9_2.3.noarch.rpm 177 kB/s | 57 kB 00:00
(3/13): python3-setools-4.4.1-1.el9.x86_64.rpm 1.9 MB/s | 791 kB 00:00
(4/13): checkpolicy-3.5-1.el9.x86_64.rpm 2.9 MB/s | 355 kB 00:00
(5/13): container-selinux-2.205.0-1.el9_2.noarch.rpm 1.5 MB/s | 63 kB 00:00
(6/13): policycoreutils-python-utils-3.5-1.el9.noarch.rpm 2.0 MB/s | 113 kB 00:00
(7/13): python3-audit-3.0.7-103.el9.x86_64.rpm 1.5 MB/s | 88 kB 00:00
(8/13): python3-distro-1.5.0-7.el9.noarch.rpm 733 kB/s | 50 kB 00:00
(9/13): python3-libselinux-3.5-1.el9.x86_64.rpm 2.9 MB/s | 198 kB 00:00
(10/13): python3-libsemanage-3.5-1.el9.x86_64.rpm 992 kB/s | 84 kB 00:00
(11/13): selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch.rpm 17 MB/s | 7.7 MB 00:00
(12/13): python3-policycoreutils-3.5-1.el9.noarch.rpm 11 MB/s | 2.3 MB 00:00
(13/13): k3s-selinux-1.4-1.el9.noarch.rpm 27 kB/s | 21 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 8.3 MB/s | 12 MB 00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch 1/1
Preparing : 1/1
Installing : selinux-policy-38.1.11-2.0.1.el9_2.3.noarch 1/13
Running scriptlet: selinux-policy-38.1.11-2.0.1.el9_2.3.noarch 1/13
Running scriptlet: selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch 2/13
Installing : selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch 2/13
Running scriptlet: selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch 2/13
Installing : python3-libselinux-3.5-1.el9.x86_64 3/13
Installing : python3-libsemanage-3.5-1.el9.x86_64 4/13
Installing : python3-distro-1.5.0-7.el9.noarch 5/13
Installing : python3-audit-3.0.7-103.el9.x86_64 6/13
Installing : checkpolicy-3.5-1.el9.x86_64 7/13
Installing : python3-setools-4.4.1-1.el9.x86_64 8/13
Installing : python3-policycoreutils-3.5-1.el9.noarch 9/13
Installing : policycoreutils-python-utils-3.5-1.el9.noarch 10/13
Running scriptlet: container-selinux-3:2.205.0-1.el9_2.noarch 11/13
Installing : container-selinux-3:2.205.0-1.el9_2.noarch 11/13
Running scriptlet: container-selinux-3:2.205.0-1.el9_2.noarch 11/13
Running scriptlet: k3s-selinux-1.4-1.el9.noarch 12/13
Installing : k3s-selinux-1.4-1.el9.noarch 12/13
Running scriptlet: k3s-selinux-1.4-1.el9.noarch 12/13
Installing : rpm-plugin-selinux-4.16.1.3-22.0.1.el9.x86_64 13/13
Running scriptlet: selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch 13/13
Running scriptlet: container-selinux-3:2.205.0-1.el9_2.noarch 13/13
Running scriptlet: k3s-selinux-1.4-1.el9.noarch 13/13
Running scriptlet: rpm-plugin-selinux-4.16.1.3-22.0.1.el9.x86_64 13/13
Verifying : python3-setools-4.4.1-1.el9.x86_64 1/13
Verifying : rpm-plugin-selinux-4.16.1.3-22.0.1.el9.x86_64 2/13
Verifying : selinux-policy-38.1.11-2.0.1.el9_2.3.noarch 3/13
Verifying : selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch 4/13
Verifying : checkpolicy-3.5-1.el9.x86_64 5/13
Verifying : container-selinux-3:2.205.0-1.el9_2.noarch 6/13
Verifying : policycoreutils-python-utils-3.5-1.el9.noarch 7/13
Verifying : python3-audit-3.0.7-103.el9.x86_64 8/13
Verifying : python3-distro-1.5.0-7.el9.noarch 9/13
Verifying : python3-libselinux-3.5-1.el9.x86_64 10/13
Verifying : python3-libsemanage-3.5-1.el9.x86_64 11/13
Verifying : python3-policycoreutils-3.5-1.el9.noarch 12/13
Verifying : k3s-selinux-1.4-1.el9.noarch 13/13
Installed:
checkpolicy-3.5-1.el9.x86_64 container-selinux-3:2.205.0-1.el9_2.noarch k3s-selinux-1.4-1.el9.noarch
policycoreutils-python-utils-3.5-1.el9.noarch python3-audit-3.0.7-103.el9.x86_64 python3-distro-1.5.0-7.el9.noarch
python3-libselinux-3.5-1.el9.x86_64 python3-libsemanage-3.5-1.el9.x86_64 python3-policycoreutils-3.5-1.el9.noarch
python3-setools-4.4.1-1.el9.x86_64 rpm-plugin-selinux-4.16.1.3-22.0.1.el9.x86_64 selinux-policy-38.1.11-2.0.1.el9_2.3.noarch
selinux-policy-targeted-38.1.11-2.0.1.el9_2.3.noarch
Complete!
[INFO] Skipping /usr/local/bin/kubectl symlink to k3s, already exists
[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 k3sAnd the system looks okay, though: ● k3s.service - Lightweight Kubernetes
Loaded: loaded (/etc/systemd/system/k3s.service; enabled; preset: disabled)
Active: active (running) since Wed 2023-08-16 10:10:05 CEST; 10s ago
Docs: https://k3s.io
Process: 1562 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service (code=exited, status=0/SUCCESS)
Process: 1564 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
Process: 1565 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
Main PID: 1566 (k3s-server)
Tasks: 65
Memory: 565.0M
CGroup: /system.slice/k3s.service
├─1566 "/usr/local/bin/k3s server"
└─1650 "containerd "
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.378620 1566 shared_informer.go:311] Waiting for caches to sync for RequestHeaderAuthRequestController
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.378638 1566 configmap_cafile_content.go:202] "Starting controller" name="client-ca::kube-system::extension-apiserver-authenticat>
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.378644 1566 shared_informer.go:311] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::c>
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.378651 1566 configmap_cafile_content.go:202] "Starting controller" name="client-ca::kube-system::extension-apiserver-authenticat>
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.378654 1566 shared_informer.go:311] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::r>
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.379452 1566 secure_serving.go:210] Serving securely on 127.0.0.1:10259
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.379533 1566 tlsconfig.go:240] "Starting DynamicServingCertificateController"
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.479595 1566 shared_informer.go:318] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requesthea>
Aug 16 10:10:10 ACAYULAOMA-NB k3s[1566]: I0816 10:10:10.479676 1566 shared_informer.go:318] Caches are synced for RequestHeaderAuthRequestControllerI'm using k3s to make quicks PoCs, I feel even is better than to use minikube or kind, but I don't want to have issues in the begin because selinux block something. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the same error from here: #7994
It just starts today. I installed yesterday k3s a lot of times without problem.
I'm using WSL2 windows 10, with Oracle Linux 9:
I can't find the option in the documentation to NOT install selinux.
The alternative command that I run was this:
I have this output:
PD: I can run daemon by just have made this:
and reloaded the system with
Beta Was this translation helpful? Give feedback.
All reactions