From 3fb81e44c060bf3bbecfde584482b51862dcfcbd Mon Sep 17 00:00:00 2001 From: Itxaka Date: Fri, 14 Mar 2025 12:04:53 +0100 Subject: [PATCH] Restore k3s packages for patch release (#1323) * Restore k3s packages for patch release Signed-off-by: Itxaka * Fix the package build Signed-off-by: Itxaka --------- Signed-off-by: Itxaka --- packages/k3s/build.yaml | 43 ++++++++++++++++++++++++++++++++++++ packages/k3s/collection.yaml | 25 +++++++++++++++++++++ values/arm.yaml | 1 - 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 packages/k3s/build.yaml create mode 100644 packages/k3s/collection.yaml delete mode 100644 values/arm.yaml diff --git a/packages/k3s/build.yaml b/packages/k3s/build.yaml new file mode 100644 index 0000000..9d274d1 --- /dev/null +++ b/packages/k3s/build.yaml @@ -0,0 +1,43 @@ +{{$arch:=(default "amd64" .Values.arch)}} +requires: + - name: "toolchain" + category: "development" + version: ">=0" +env: + - INSTALL_K3S_BIN_DIR="/usr/bin" + - INSTALL_K3S_SELINUX_WARN=true + - INSTALL_K3S_SKIP_START="true" + - INSTALL_K3S_SKIP_ENABLE="true" + - INSTALL_K3S_SKIP_SELINUX_RPM="true" + # Remove any possible "+N" from the end of the version. We only bump that to + # avoid overwritting existing images when we want the package to be rebuilt. + - INSTALL_K3S_VERSION=v{{ regexReplaceAll "\\+\\d+$" .Values.version "" }}+k3s{{.Values.k3s_version}} + - ARCH={{ $arch }} +steps: + - curl -sfL https://get.k3s.io > installer.sh + # Let the installer script install service files for openrc or systemd: + # https://github.com/k3s-io/k3s/blob/36645e7311e9bdbbf2adb79ecd8bd68556bc86f6/install.sh#L114-L122 +{{ if eq .Values.name "k3s-openrc" }} + - touch /sbin/openrc-run && chmod +x /sbin/openrc-run +{{ else }} + - touch /bin/systemctl && chmod +x /bin/systemctl + - mkdir -p /etc/systemd/system/ +{{ end }} + - bash installer.sh + - bash installer.sh agent + - rm -rf installer.sh + - chmod +x /usr/bin/k3s + - upx -1 /usr/bin/k3s + +includes: + - ^/usr/bin/k3s +{{ if eq .Values.name "k3s-openrc" }} + - ^/etc/init.d/$ + - ^/etc/init.d/k3s.* + - ^/etc/rancher/$ + - ^/etc/rancher/k3s$ +{{ else }} + - ^/etc/systemd$ + - ^/etc/systemd/system$ + - ^/etc/systemd/system/k3s.*service$ +{{ end }} diff --git a/packages/k3s/collection.yaml b/packages/k3s/collection.yaml new file mode 100644 index 0000000..1aa579c --- /dev/null +++ b/packages/k3s/collection.yaml @@ -0,0 +1,25 @@ +packages: + - name: k3s-openrc + category: k8s + version: "1.32.2" + k3s_version: "1" + - name: k3s-openrc + category: k8s + version: "1.31.4+1" + k3s_version: "1" + - name: k3s-openrc + category: k8s + version: "1.30.8+1" + k3s_version: "1" + - name: k3s-systemd + category: k8s + version: "1.32.2" + k3s_version: "1" + - name: k3s-systemd + category: k8s + version: "1.31.4+1" + k3s_version: "1" + - name: k3s-systemd + category: k8s + version: "1.30.8+1" + k3s_version: "1" \ No newline at end of file diff --git a/values/arm.yaml b/values/arm.yaml deleted file mode 100644 index f6bcb09..0000000 --- a/values/arm.yaml +++ /dev/null @@ -1 +0,0 @@ -arch: "arm" \ No newline at end of file