kube-hetzner / terraform-hcloud-kube-hetzner

Optimized and Maintenance-free Kubernetes on Hetzner Cloud in one command!
MIT License
2.39k stars 368 forks source link

k3s-selinux update fails (signature verification) #644

Closed Viktor-Osika closed 1 year ago

Viktor-Osika commented 1 year ago

Description

I've been running a cluster for two weeks and noticed that daily automatic MicroOS updates are not working on all the nodes with the following logs:

Mar 13 00:46:35 stage-k3s-control-plane-fsn1-hay systemd[1]: Starting Update the system... Mar 13 00:46:35 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Checking for newer version. Mar 13 00:46:48 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: New version found - updating... Mar 13 00:46:48 stage-k3s-control-plane-fsn1-hay transactional-update[25537]: Loading repository data... Mar 13 00:46:48 stage-k3s-control-plane-fsn1-hay transactional-update[25537]: Reading installed packages... Mar 13 00:46:49 stage-k3s-control-plane-fsn1-hay transactional-update[25537]: Retrieving: transactional-update-4.1.4-1.1.x86_64 (openSUSE-Tumbleweed-Oss) (1/1), 72.9 KiB Mar 13 00:46:49 stage-k3s-control-plane-fsn1-hay transactional-update[25537]: Retrieving: transactional-update-4.1.4-1.1.x86_64.rpm [..done] Mar 13 00:46:49 stage-k3s-control-plane-fsn1-hay transactional-update[25537]: .done] Mar 13 00:46:49 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: Loading repository data... Mar 13 00:46:50 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: Reading installed packages... Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: Retrieving: libtukit4-4.1.4-1.1.x86_64 (openSUSE-Tumbleweed-Oss) (1/2), 161.4 KiB Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: Retrieving: libtukit4-4.1.4-1.1.x86_64.rpm [..done] Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: .done] Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: Retrieving: tukit-4.1.4-1.1.x86_64 (openSUSE-Tumbleweed-Oss) (2/2), 70.1 KiB Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: Retrieving: tukit-4.1.4-1.1.x86_64.rpm [.done] Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25581]: .done] Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: transactional-update 4.1.4 started Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Options: cleanup dup reboot Mar 13 00:46:51 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Separate /var detected. Mar 13 00:46:52 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Deleting unused overlay /var/lib/overlay/4 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: 2023-03-13 00:46:52 tukit 4.1.4 started Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: 2023-03-13 00:46:52 Options: -c3 open Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: 2023-03-13 00:46:52 Using snapshot 3 as base for new snapshot 4. Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: 2023-03-13 00:46:52 Syncing /etc of previous snapshot 2 as base into new snapshot "/.snapshots/4/snapshot" Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: 2023-03-13 00:46:52 SELinux is enabled. Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: /var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Relabeled /var/lib/rancher/k3s from unconfined_u:object_r:var_lib_t:s0 to unconfined_u:object_r:container_var_lib_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Relabeled /var/lib/rancher/k3s/agent from unconfined_u:object_r:var_lib_t:s0 to unconfined_u:object_r:container_var_lib_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Relabeled /var/lib/rancher/k3s/agent/containerd from unconfined_u:object_r:var_lib_t:s0 to unconfined_u:object_r:container_var_lib_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Relabeled /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs from unconfined_u:object_r:var_lib_t:s0 to unconfined_u:object_r:container_var_lib_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Relabeled /var/lib/rancher/k3s/data from unconfined_u:object_r:var_lib_t:s0 to unconfined_u:object_r:k3s_data_t:s0 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: ID: 4 Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: 2023-03-13 00:46:55 Transaction completed. Mar 13 00:46:55 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Calling zypper --no-cd dup Mar 13 00:46:57 stage-k3s-control-plane-fsn1-hay transactional-update[25580]: /var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:46:57 stage-k3s-control-plane-fsn1-hay transactional-update[25580]: /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:47:02 stage-k3s-control-plane-fsn1-hay transactional-update[25391]: Applying workaround for broken libfdisk1 Mar 13 00:47:02 stage-k3s-control-plane-fsn1-hay transactional-update[25828]: 2023-03-13 00:47:02 tukit 4.1.4 started Mar 13 00:47:02 stage-k3s-control-plane-fsn1-hay transactional-update[25828]: 2023-03-13 00:47:02 Options: call 4 rpm -e --justdb --nodeps libfdisk1 Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25580]: /var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25580]: /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25828]: 2023-03-13 00:47:05 Executing rpm -e --justdb --nodeps libfdisk1: Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25828]: 2023-03-13 00:47:05 Application returned with exit status 0. Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25828]: 2023-03-13 00:47:05 Transaction completed. Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: 2023-03-13 00:47:05 tukit 4.1.4 started Mar 13 00:47:05 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: 2023-03-13 00:47:05 Options: call 4 zypper --no-cd dup -y --auto-agree-with-product-licenses Mar 13 00:47:07 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: /var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:47:07 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 13 00:47:07 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: 2023-03-13 00:47:07 Executing zypper --no-cd dup -y --auto-agree-with-product-licenses: Mar 13 00:47:08 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Loading repository data... Mar 13 00:47:08 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Reading installed packages... Mar 13 00:47:09 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more informati> Mar 13 00:47:09 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Computing distribution upgrade... Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: The following 94 packages are going to be upgraded: Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: MicroOS-release MicroOS-release-dvd NetworkManager NetworkManager-branding-openSUSE boost-license1_81_0 branding-openSUSE btrfsprogs btrfsprogs-udev-rules cloud-init curl dbus-1 dbu> Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: The following 2 patterns are going to be upgraded: Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: bootloader minimal_base Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: The following product is going to be upgraded: Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: openSUSE MicroOS Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: 20230226-0 -> 20230311-0 Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: The following 2 NEW packages are going to be installed: Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: libfdisk1 python310-responses Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: The following package requires a system reboot: Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: kernel-default Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: 94 packages to upgrade, 2 new. Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Overall download size: 8.9 MiB. Already cached: 232.0 MiB. After the operation, additional 25.8 MiB will be used. Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Note: System reboot required. Mar 13 00:47:10 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Continue? [y/n/v/...? shows all options] (y): y Mar 13 00:47:12 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Retrieving: MicroOS-release-dvd-20230311-2158.1.x86_64 (openSUSE-Tumbleweed-Oss) (1/96), 8.3 KiB Mar 13 00:47:12 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Retrieving: MicroOS-release-dvd-20230311-2158.1.x86_64.rpm [..done] Mar 13 00:47:12 stage-k3s-control-plane-fsn1-hay transactional-update[25835]: Retrieving: boost-license1_81_0-1.81.0-2.1.noarch (openSUSE-Tumbleweed-Oss) (2/96), 18.7 KiB Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Repository: Rancher K3s Common (stable) Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Key Fingerprint: C8CF F216 4551 26E9 B9C9 18BE 925E A29A E257 814A Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Key Name: Rancher (CI) ci@rancher.com Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Key Algorithm: RSA 3072 Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Key Created: Tue Mar 10 22:43:06 2020 Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Key Expires: (does not expire) Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Subkey: AA7E9EC8FE21FDCF 2020-03-10 [does not expire] Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Rpm Name: gpg-pubkey-e257814a-5e6817fa Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Note: Signing data enables the recipient to verify that no modifications occurred after the data Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: and in extreme cases even to a system compromise. Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Note: A GPG pubkey is clearly identified by its fingerprint. Do not rely on the key's name. If Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: you are not sure whether the presented key is authentic, ask the repository provider or check Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: their web site. Many providers maintain a web page showing the fingerprints of the GPG keys they Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: are using. Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Do you want to reject the key, or trust always? [r/a/?] (r): r Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: k3s-selinux-1.2-2.sle.noarch (Rancher K3s Common (stable)): Signature verification failed [4-Signatures public key is not available] Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Abort, retry, ignore? [a/r/i] (a): a Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Problem occurred during or after installation or removal of packages: Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Installation has been aborted as directed. Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: Please see the above error message for a hint. Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13667]: 2023-03-12 01:14:29 Application returned with exit status 8. Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13327]: ERROR: zypper --no-cd dup on /.snapshots/4/snapshot failed with exit code 8! Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13327]: Use '--interactive' for manual problem resolution. Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13327]: Removing snapshot #4... Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13841]: 2023-03-12 01:14:29 tukit 4.1.3 started Mar 12 01:14:29 stage-k3s-control-plane-fsn1-hay transactional-update[13841]: 2023-03-12 01:14:29 Options: abort 4 Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay transactional-update[13841]: /var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay transactional-update[13841]: /var/lib/rancher/k3s/agent/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots not reset as customized by admin to unconfined_u:object_r:container_file_t:s0 Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay transactional-update[13841]: 2023-03-12 01:14:32 Discarding snapshot 4. Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay transactional-update[13841]: 2023-03-12 01:14:32 Transaction completed. Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay transactional-update[13326]: transactional-update finished Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay systemd[1]: transactional-update.service: Main process exited, code=exited, status=1/FAILURE Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay systemd[1]: transactional-update.service: Failed with result 'exit-code'. Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay systemd[1]: Failed to start Update the system. Mar 12 01:14:32 stage-k3s-control-plane-fsn1-hay systemd[1]: transactional-update.service: Consumed 31.736s CPU time.

And this is the cause:

Do you want to reject the key, or trust always? [r/a/?] (r): r
k3s-selinux-1.2-2.sle.noarch (Rancher K3s Common (stable)): Signature verification failed [4-Signatures public key is not available]
Abort, retry, ignore? [a/r/i] (a): a

As a sidenote - is there an easy way to expose microos updates metrics so they can be monitored?

Kube.tf file

locals {

  hcloud_token = 
}

module "kube-hetzner" {
  providers = {
    hcloud = hcloud
  }
  hcloud_token = local.hcloud_token

  source = "github.com/kube-hetzner/terraform-hcloud-kube-hetzner"

  ssh_public_key = file("~/.ssh/id_ed25519.pub")

  ssh_private_key = file("~/.ssh/id_ed25519")

  network_region = "eu-central" 

  control_plane_nodepools = [
    {
      name        = "control-plane-fsn1",
      server_type = "cx21",
      location    = "fsn1",
      labels      = [],
      taints      = [],
      count       = 1
    }
  ]

  agent_nodepools = [
    {
      name        = "agent-fsn1",
      server_type = "cx41",
      location    = "fsn1",
      labels      = [],
      taints      = [],
      count       = 1
    },
    {
      name        = "agent-med-nbg1",
      server_type = "cpx31",
      location    = "nbg1",
      labels      = [],
      taints      = [],
      count       = 2
    }

  cluster_name = "stage-k3s"

  extra_firewall_rules = [
    {
      description     = "Allow external Postgres"
      direction       = "out"
      protocol        = "tcp"
      port            = "5000"
      source_ips      = []
      destination_ips = ["0.0.0.0/0", "::/0"]
    }
  ]

  enable_cert_manager = false

  additional_tls_sans = ["--"]

}

provider "hcloud" {
  token = local.hcloud_token
}

terraform {
  required_version = ">= 1.3.3"
  required_providers {
    hcloud = {
      source  = "hetznercloud/hcloud"
      version = ">= 1.35.2"
    }
  }
}

output "kubeconfig" {
  value     = module.kube-hetzner.kubeconfig
  sensitive = true
}
mysticaltech commented 1 year ago

Thanks @Viktor-Osika for letting us know, there is a more official package that we can use, I will fix it.

mysticaltech commented 1 year ago

@Viktor-Osika I understood what is happening, we forgot to add a update lock for the package k3s-selinux, I am pushing new version now. But if your cluster is already deployed, just ssh into each node (see readme), and run:

transactional-update --continue shell <<< "zypper addlock k3s-selinux"
touch /var/run/reboot-required

After that, your nodes will start updating normally again.

bvehse commented 11 months ago

@mysticaltech Thanks for the solution and your work in general!

On two separate clusters created with kube-hetzner we're experiencing HostKernelVersionDeviations alerts because Micro OS transactional updates haven't been successful one some nodes recently.

~ % kubectl get nodes -o wide
NAME                           STATUS   ROLES                       AGE    VERSION        INTERNAL-IP    EXTERNAL-IP      OS-IMAGE           KERNEL-VERSION    CONTAINER-RUNTIME
abc-agent-nbg1-1-vla           Ready    <none>                      113d   v1.27.8+k3s2   10.2.0.101     PLACEHOLDER      openSUSE MicroOS   6.6.6-1-default   containerd://1.7.7-k3s1.27
abc-agent-nbg1-2-nxw           Ready    <none>                      113d   v1.27.8+k3s2   10.3.0.101     PLACEHOLDER      openSUSE MicroOS   6.6.6-1-default   containerd://1.7.7-k3s1.27
abc-control-plane-nbg1-1-qbu   Ready    control-plane,etcd,master   515d   v1.27.8+k3s2   10.255.0.101   PLACEHOLDER      openSUSE MicroOS   6.5.9-1-default   containerd://1.7.7-k3s1.27
abc-control-plane-nbg1-2-keh   Ready    control-plane,etcd,master   515d   v1.27.8+k3s2   10.254.0.101   PLACEHOLDER      openSUSE MicroOS   6.5.9-1-default   containerd://1.7.7-k3s1.27
abc-control-plane-nbg1-3-cal   Ready    control-plane,etcd,master   515d   v1.27.8+k3s2   10.253.0.101   PLACEHOLDER      openSUSE MicroOS   6.5.9-1-default   containerd://1.7.7-k3s1.27

As you can see the agent nodes were recreated at a later point and have successfully updated to kernel version 6.6.6.-1-default while the control plane nodes are stuck at 6.5.9-1-default.

I encountered the same error as @Viktor-Osika and followed the procedure described above with the following result:

~ # transactional-update --continue shell <<< "zypper addlock k3s-selinux"
Checking for newer version.
Repository 'openSUSE-Tumbleweed-Non-Oss' is invalid.
[repo-non-oss|http://download.opensuse.org/tumbleweed/repo/non-oss/] Valid metadata not found at specified URL
History:
 - Signature verification failed for repomd.xml
 - Can't provide /repodata/repomd.xml

Please check if the URIs defined for this repository are pointing to a valid repository.
Repository 'openSUSE-Tumbleweed-Oss' is invalid.
[repo-oss|http://download.opensuse.org/tumbleweed/repo/oss/] Valid metadata not found at specified URL
History:
 - Signature verification failed for repomd.xml
 - Can't provide /repodata/repomd.xml

Please check if the URIs defined for this repository are pointing to a valid repository.
Some of the repositories have not been refreshed because of an error.
transactional-update 4.4.0 started
[...]

As a result the kernel on these nodes is not updated. I can reach http://download.opensuse.org/tumbleweed/repo/non-oss/repodata/repomd.xml locally and on the nodes though.

Here are the configured repos:

~ # zypper lr -d
# | Alias                     | Name                        | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                      | Service
--+---------------------------+-----------------------------+---------+-----------+---------+----------+--------+----------------------------------------------------------+--------
1 | rancher-k3s-common-stable | Rancher K3s Common (stable) | Yes     | ( p) Yes  | No      |   99     | rpm-md | https://rpm.rancher.io/k3s/stable/common/microos/noarch  | 
2 | repo-debug                | openSUSE-Tumbleweed-Debug   | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/  | 
3 | repo-non-oss              | openSUSE-Tumbleweed-Non-Oss | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/non-oss/    | 
4 | repo-oss                  | openSUSE-Tumbleweed-Oss     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/tumbleweed/repo/oss/        | 
5 | repo-source               | openSUSE-Tumbleweed-Source  | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/ | 
6 | repo-update               | openSUSE-Tumbleweed-Update  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/tumbleweed/          | 

Because of this I executed zypper -v ref:

~ # zypper -v ref
Verbosity: 2
Initializing Target
Specified repositories: 
Checking whether to refresh metadata for Rancher K3s Common (stable)
Retrieving: repomd.xml .........................................................................................................................................................................[done (2.9 KiB/s)]
Repository 'Rancher K3s Common (stable)' is up to date.                                                                                                                                                           
Skipping disabled repository 'openSUSE-Tumbleweed-Debug'
Checking whether to refresh metadata for openSUSE-Tumbleweed-Non-Oss
Retrieving: repomd.xml .........................................................................................................................................................................[done (9.8 KiB/s)]
Retrieving: media ................................................................................................................................................................................[done (109 B/s)]
Retrieving: repomd.xml.asc .......................................................................................................................................................................[done (827 B/s)]
Retrieving: repomd.xml.key .....................................................................................................................................................................[done (1.6 KiB/s)]
Retrieving: repomd.xml .....................................................................................................................................................................................[done]

New repository or package signing key received:

  Repository:       openSUSE-Tumbleweed-Non-Oss
  Key Fingerprint:  AD48 5664 E901 B867 051A B15F 35A2 F86E 29B7 00A4
  Key Name:         openSUSE Project Signing Key <opensuse@opensuse.org>
  Key Algorithm:    RSA 4096
  Key Created:      Mon Jun 20 14:03:14 2022
  Key Expires:      Fri Jun 19 14:03:14 2026
  Rpm Name:         gpg-pubkey-29b700a4-62b07e22

    Note: Signing data enables the recipient to verify that no modifications occurred after the data
    were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
    and in extreme cases even to a system compromise.

    Note: A GPG pubkey is clearly identified by its fingerprint. Do not rely on the key's name. If
    you are not sure whether the presented key is authentic, ask the repository provider or check
    their web site. Many providers maintain a web page showing the fingerprints of the GPG keys they
    are using.

Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a
Subprocess failed. Error: Failed to import public key [35A2F86E29B700A4-62b07e22] [openSUSE Project Signing Key <opensuse@opensuse.org>] [expires: 2026-06-19]
History:
 - Command exited with status 1.
 - error: /var/tmp/zypp.ogavgi/pubkey-35A2F86E29B700A4-TeKC1n: key 1 import failed.
 - error: can't create transaction lock on /usr/lib/sysimage/rpm/.rpm.lock (Read-only file system)

  Repository:       openSUSE-Tumbleweed-Non-Oss
  Key Fingerprint:  AD48 5664 E901 B867 051A B15F 35A2 F86E 29B7 00A4
  Key Name:         openSUSE Project Signing Key <opensuse@opensuse.org>
  Key Algorithm:    RSA 4096
  Key Created:      Mon Jun 20 14:03:14 2022
  Key Expires:      Fri Jun 19 14:03:14 2026
  Rpm Name:         gpg-pubkey-29b700a4-62b07e22
Retrieving: 40048a4bf062c8bbce9474b8ff0b63f42af9b6fa0a1df7cebd119398b64233647af9026832c78bff4e9c3901d168a18dc264f65529da08b5b4384a6dc2050307-primary.xml.zst ...............................................[done]
Retrieving: b5abb7b269a511ba13fff889514a0fb5861b57f08a3512e74583d87c894c5d02-susedata.xml.gz ...............................................................................................................[done]
Retrieving repository 'openSUSE-Tumbleweed-Non-Oss' metadata ...............................................................................................................................................[done]
Building repository 'openSUSE-Tumbleweed-Non-Oss' cache ....................................................................................................................................................[done]
Checking whether to refresh metadata for openSUSE-Tumbleweed-Oss
Retrieving: repomd.xml ........................................................................................................................................................................[done (10.5 KiB/s)]
Retrieving: media .................................................................................................................................................................................[done (93 B/s)]
Retrieving: repomd.xml.asc .......................................................................................................................................................................[done (827 B/s)]
Retrieving: repomd.xml.key .....................................................................................................................................................................[done (1.6 KiB/s)]
Retrieving: repomd.xml .....................................................................................................................................................................................[done]
  Repository:       openSUSE-Tumbleweed-Oss
  Key Fingerprint:  AD48 5664 E901 B867 051A B15F 35A2 F86E 29B7 00A4
  Key Name:         openSUSE Project Signing Key <opensuse@opensuse.org>
  Key Algorithm:    RSA 4096
  Key Created:      Mon Jun 20 14:03:14 2022
  Key Expires:      Fri Jun 19 14:03:14 2026
  Rpm Name:         gpg-pubkey-29b700a4-62b07e22
Retrieving: 5c34e521e18b22b8e35bbe8c985e3bfc0ccd12291633d64f6a81f49a05ce3aeb-appdata.xml.gz ...................................................................................................[done (23.2 MiB/s)]
Retrieving: 2c968f93e08ae0391e453db2c201670a5d73042c9d2e9a2d3f505446057e78f7-appdata-icons.tar.gz .............................................................................................[done (31.1 MiB/s)]
Retrieving: af2b85770531511b7339ec1fd148d40d631a06fedf96c1289a70ef8ee76883d868defd55740c56a831529e1ff20bd9a0922e1dca576abc926ebf87f1207ded6a-primary.xml.zst ..................................[done (98.0 MiB/s)]
Retrieving: d3d5d7ad2ee16fff407ce9e4d781ce4922351ed80c461216facb7fe375ead4be-susedata.xml.gz ..................................................................................................[done (44.6 MiB/s)]
Retrieving repository 'openSUSE-Tumbleweed-Oss' metadata ...................................................................................................................................................[done]
Building repository 'openSUSE-Tumbleweed-Oss' cache ........................................................................................................................................................[done]
Skipping disabled repository 'openSUSE-Tumbleweed-Source'
Checking whether to refresh metadata for openSUSE-Tumbleweed-Update
Retrieving: repomd.xml .........................................................................................................................................................................[done (3.5 KiB/s)]
Repository 'openSUSE-Tumbleweed-Update' is up to date.                                                                                                                                                            
All repositories have been refreshed.

After verifying the new key's fingerprint via https://en.opensuse.org/openSUSE:Signing_Keys I accepted it. I presume the resulting error Failed to import public key was caused by the read-only filesystem. On subsequent calls of zypper -v ref no new keys or errors were encountered.

Running transactional-update again led to no errors but also no updated kernel after reboot:

~ # transactional-update --continue shell <<< "zypper addlock k3s-selinux"
Checking for newer version.
New version found - updating...
Loading repository data...
Reading installed packages...
Retrieving: transactional-update-4.5.0-1.1.x86_64 (openSUSE-Tumbleweed-Oss)                                                                                                                   (1/1),  73.2 KiB    
Retrieving: transactional-update-4.5.0-1.1.x86_64.rpm ..........................................................................................................................................[done (2.7 KiB/s)]
(1/1) /tmp/transactional-update.hDj4EkXhiw/repo-oss/x86_64/transactional-update-4.5.0-1.1.x86_64.rpm .......................................................................................................[done]
Loading repository data...
Reading installed packages...
Retrieving: libtukit4-4.5.0-1.1.x86_64 (openSUSE-Tumbleweed-Oss)                                                                                                                              (1/2), 166.3 KiB    
Retrieving: libtukit4-4.5.0-1.1.x86_64.rpm .................................................................................................................................................................[done]
(1/2) /tmp/transactional-update.hDj4EkXhiw/repo-oss/x86_64/libtukit4-4.5.0-1.1.x86_64.rpm ..................................................................................................................[done]
Retrieving: tukit-4.5.0-1.1.x86_64 (openSUSE-Tumbleweed-Oss)                                                                                                                                  (2/2),  70.3 KiB    
Retrieving: tukit-4.5.0-1.1.x86_64.rpm .....................................................................................................................................................................[done]
(2/2) /tmp/transactional-update.hDj4EkXhiw/repo-oss/x86_64/tukit-4.5.0-1.1.x86_64.rpm ......................................................................................................................[done]
transactional-update 4.5.0 started
Options: --continue shell
Separate /var detected.
2023-12-22 11:17:35 tukit 4.5.0 started
2023-12-22 11:17:35 Options: -c177 open 
2023-12-22 11:17:35 Using snapshot 177 as base for new snapshot 178.
2023-12-22 11:17:35 /var/lib/overlay/177/etc
2023-12-22 11:17:35 Syncing /etc of previous snapshot 176 as base into new snapshot "/.snapshots/178/snapshot"
2023-12-22 11:17:35 SELinux is enabled.
/var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0
ID: 178
2023-12-22 11:17:38 Transaction completed.
Opening chroot in snapshot 178, continue with 'exit'
2023-12-22 11:17:38 tukit 4.5.0 started
2023-12-22 11:17:38 Options: call 178 bash 
/var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0
2023-12-22 11:17:39 Executing `bash`:
2023-12-22 11:17:40 Application returned with exit status 0.
2023-12-22 11:17:40 Transaction completed.
2023-12-22 11:17:40 tukit 4.5.0 started
2023-12-22 11:17:40 Options: close 178 
/var/lib/kubelet/pods not reset as customized by admin to unconfined_u:object_r:container_file_t:s0
2023-12-22 11:17:42 New default snapshot is #178 (/.snapshots/178/snapshot).
2023-12-22 11:17:42 Transaction completed.

Please reboot your machine to activate the changes and avoid data loss.
New default snapshot is #178 (/.snapshots/178/snapshot).
transactional-update finished
~ # touch /var/run/reboot-required
~ # uname -r
6.5.9-1-default

I'm thinking either there is something wrong with the mirrors I am redirected to (see https://github.com/openSUSE/zypper/issues/478) or I misconfigured something during my manual attempts at using transactional-update. Could using different (current at the time) versions of the kube-hetzner provider for the initial creation of agent and control plane nodes be a problem?

Thanks a lot in advance!