Split k3s package in 2 (one for openrc, one for systemd) (#412)

* Split k3s package in 2 (one for openrc, one for systemd)

because having all service files in places, confuses systemd because of
the sysv compatibility feature.

Part of: https://github.com/kairos-io/kairos/issues/1797

Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>

* Use new names for the new packages

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

* Use one definition for both packages with templating

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>

---------

Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Ettore Di Giacinto <ettore@spectrocloud.com>
This commit is contained in:
Dimitris Karakasilis 2023-09-08 12:56:49 +03:00 committed by GitHub
parent 3d2c10ad70
commit 038ee95bfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 54 additions and 19 deletions

View File

@ -19,27 +19,26 @@ env:
{{ end }}
steps:
- curl -sfL https://get.k3s.io > installer.sh
# Let the installer script install service files both for openrc and systemd:
# 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
# Save the service files elsewhere because the next run will delete them
- mkdir -p /service-files && cp /etc/systemd/system/k3s*.service /service-files/
# Run again to create the openrc service files
- rm /bin/systemctl
- touch /sbin/openrc-run && chmod +x /sbin/openrc-run
- bash installer.sh
- rm -rf installer.sh
- chmod +x /usr/bin/{{.Values.name}}
# Put systemd service files back in place
- mv /service-files/* /etc/systemd/system/
- chmod +x /usr/bin/k3s
includes:
- ^/usr/bin/{{.Values.name}}
- ^/usr/bin/k3s
{{ if eq .Values.name "k3s-openrc" }}
- ^/etc/init.d/$
- ^/etc/init.d/k3s.*
{{ else }}
- ^/etc/systemd$
- ^/etc/systemd/system$
- ^/etc/systemd/system/k3s.*service$
- ^/etc/init.d/$
- ^/etc/init.d/k3s.*
{{ end }}

View File

@ -1,7 +1,7 @@
packages:
- name: k3s
- name: k3s-openrc
category: k8s
version: "1.25.11+1"
version: "1.25.11"
k3s_version: "2"
labels:
github.owner: "k3s-io"
@ -11,9 +11,9 @@ packages:
license: "APL-2"
description: " Lightweight Kubernetes "
- name: k3s
- name: k3s-openrc
category: k8s
version: "1.26.6+1"
version: "1.26.6"
k3s_version: "2"
labels:
github.owner: "k3s-io"
@ -23,9 +23,45 @@ packages:
license: "APL-2"
description: " Lightweight Kubernetes "
- name: k3s
- name: k3s-openrc
category: k8s
version: "1.27.3+1"
version: "1.27.3"
k3s_version: "2"
labels:
github.owner: "k3s-io"
github.repo: "k3s"
uri:
- https://github.com/k3s-io/k3s
license: "APL-2"
description: " Lightweight Kubernetes "
- name: k3s-systemd
category: k8s
version: "1.25.11"
k3s_version: "2"
labels:
github.owner: "k3s-io"
github.repo: "k3s"
uri:
- https://github.com/k3s-io/k3s
license: "APL-2"
description: " Lightweight Kubernetes "
- name: k3s-systemd
category: k8s
version: "1.26.6"
k3s_version: "2"
labels:
github.owner: "k3s-io"
github.repo: "k3s"
uri:
- https://github.com/k3s-io/k3s
license: "APL-2"
description: " Lightweight Kubernetes "
- name: k3s-systemd
category: k8s
version: "1.27.3"
k3s_version: "2"
labels:
github.owner: "k3s-io"