Restore k3s packages for patch release (#1323)

* Restore k3s packages for patch release

Signed-off-by: Itxaka <itxaka@kairos.io>

* Fix the package build

Signed-off-by: Itxaka <itxaka@kairos.io>

---------

Signed-off-by: Itxaka <itxaka@kairos.io>
This commit is contained in:
Itxaka 2025-03-14 12:04:53 +01:00 committed by GitHub
parent 9e39c645f1
commit 3fb81e44c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 68 additions and 1 deletions

43
packages/k3s/build.yaml Normal file
View File

@ -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 }}

View File

@ -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"

View File

@ -1 +0,0 @@
arch: "arm"