From 038ee95bfdd2f404119e552bfe2e790aaa6f8b02 Mon Sep 17 00:00:00 2001 From: Dimitris Karakasilis Date: Fri, 8 Sep 2023 12:56:49 +0300 Subject: [PATCH] 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 * Use new names for the new packages Signed-off-by: Dimitris Karakasilis * Use one definition for both packages with templating Signed-off-by: Dimitris Karakasilis --------- Signed-off-by: Dimitris Karakasilis Signed-off-by: Dimitris Karakasilis Co-authored-by: Ettore Di Giacinto --- packages/k8s/k3s/build.yaml | 25 ++++++++--------- packages/k8s/k3s/collection.yaml | 48 ++++++++++++++++++++++++++++---- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/packages/k8s/k3s/build.yaml b/packages/k8s/k3s/build.yaml index bbc3330..eaaccb7 100644 --- a/packages/k8s/k3s/build.yaml +++ b/packages/k8s/k3s/build.yaml @@ -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 }} diff --git a/packages/k8s/k3s/collection.yaml b/packages/k8s/k3s/collection.yaml index 1930e46..3122e1a 100644 --- a/packages/k8s/k3s/collection.yaml +++ b/packages/k8s/k3s/collection.yaml @@ -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"