Skip to content

[WORKAROUND] Cannot deploy quickstart on GCP: nothing provides 'selinux-tools' needed by the to be installed k3s-selinux-1.6-1.sle.noarch #250

@vrubiolo

Description

@vrubiolo

Hello,

I am not sure what is the maintenance status of this quick start given the dates of the last closed PR (2022) but this is just a note that the current version cannot be deployed as-is, at least on GCP. It fails at the K3S install stage with :

[INFO]  Using v1.24.14+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.24.14+k3s1/sha256sum-amd64.txt
[INFO]  Skipping binary downloaded, installed k3s matches hash
[INFO]  Finding available k3s-selinux versions
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: 1: nothing provides 'selinux-tools' needed by the to be installed k3s-selinux-1.6-1.sle.noarch
 Solution 1: do not install k3s-selinux-1.6-1.sle.noarch
 Solution 2: break k3s-selinux-1.6-1.sle.noarch by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/c/d/?] (c): c

The problem is that k3s-selinux-1.6-1.sle.noarch is selected for installation but on SLES 15 SP7, nothing provides the selinux-tools package. SLES itself is not listed per se as a target for the k3s-selinux package spec file (instead slemicro is) but the selinux-tools dependency is listed as a requirements in the spec file.

The K3S install script run by the Terraform SSH provider provides a workaround though, which skips the installation of the problematic SELinux RPM:

#   - INSTALL_K3S_SKIP_SELINUX_RPM
#     If set to true will skip automatic installation of the k3s RPM.

With the following I was able to successfully deploy the Quick Start:

diff --git a/rancher/rancher-common/k3s.tf b/rancher/rancher-common/k3s.tf
index 5ec28f5..a5e5f5c 100644
--- a/rancher/rancher-common/k3s.tf
+++ b/rancher/rancher-common/k3s.tf
@@ -3,7 +3,7 @@
 resource "ssh_resource" "install_k3s" {
   host = var.node_public_ip
   commands = [
-    "bash -c 'curl https://get.k3s.io | INSTALL_K3S_EXEC=\"server --node-external-ip ${var.node_public_ip} --node-ip ${var.node_internal_ip}\" INSTALL_K3S_VERSION=${var.rancher_kubernetes_version} sh -'"
+    "bash -c 'curl https://get.k3s.io |  INSTALL_K3S_SKIP_SELINUX_RPM=true INSTALL_K3S_EXEC=\"server --node-external-ip ${var.node_public_ip} --node-ip ${var.node_internal_ip}\" INSTALL_K3S_VERSION=${var.rancher_kubernetes_version} sh -'"
   ]
   user        = var.node_username
   private_key = var.ssh_private_key_pem

This worked for me both for the default versions (v1.24.14+rke2r1/v1.24.14+rke2r1) but also the ones I needed (v1.28.15+rke2r1/v1.28.15+k3s1). Hope this helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions