diff --git a/packages/bundles/osbuilder/k3s/build.yaml b/packages/bundles/osbuilder/k3s/build.yaml deleted file mode 100644 index 15d0097..0000000 --- a/packages/bundles/osbuilder/k3s/build.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{ if eq .Values.init "systemd" }} -image: golang:1.20 -prelude: -- apt-get update -- apt-get install -y git curl systemd -{{ else }} -image: golang:1.20-alpine -prelude: -- apk add git curl openrc bash -{{ end }} -- curl -sfL https://get.k3s.io > installer.sh -steps: -- PACKAGE_VERSION=${PACKAGE_VERSION%\-*} && export INSTALL_K3S_VERSION=$PACKAGE_VERSION && bash installer.sh -- PACKAGE_VERSION=${PACKAGE_VERSION%\-*} && export INSTALL_K3S_VERSION=$PACKAGE_VERSION && bash installer.sh agent -- mkdir -p /etc/rancher/k3s/ && touch /etc/rancher/k3s/.keep - -exclude: -- etc/rancher/k3s/k3s.env -- etc/rancher/k3s/k3s-agent.env -env: -- INSTALL_K3S_SKIP_START="true" -- INSTALL_K3S_SKIP_ENABLE="true" \ No newline at end of file diff --git a/packages/bundles/osbuilder/k3s/collection.yaml b/packages/bundles/osbuilder/k3s/collection.yaml deleted file mode 100644 index 7855006..0000000 --- a/packages/bundles/osbuilder/k3s/collection.yaml +++ /dev/null @@ -1,9 +0,0 @@ -packages: -- name: "k3s-systemd" - category: "osbuilder-bundles" - version: "v1.21.14+k3s1-1" - init: systemd -- name: "k3s-openrc" - category: "osbuilder-bundles" - version: "v1.21.14+k3s1-1" - init: openrc \ No newline at end of file diff --git a/packages/k3s/build.yaml b/packages/k3s/build.yaml deleted file mode 100644 index 158845f..0000000 --- a/packages/k3s/build.yaml +++ /dev/null @@ -1,24 +0,0 @@ -requires: -- name: "toolchain-go" - category: "development" - version: ">=0" -prelude: -{{$arch:=(default .Values.arch "amd64")}} - -{{ if eq $arch "amd64" }} -- wget https://github.com/k3s-io/k3s/releases/download/v{{.Values.version}}+k3s{{.Values.k3s_version}}/k3s -{{ else }} -{{ if eq $arch "arm" }} -{{$arch:="arm64"}} -{{end}} -- wget https://github.com/k3s-io/k3s/releases/download/v{{.Values.version}}+k3s{{.Values.k3s_version}}/k3s-{{$arch}} -{{ end }} -- /bin/bash -c 'echo "{{ ( index .Values (print "checksum-" $arch) ) }} k3s" | sha256sum -c' -steps: -- | - mv {{.Values.name}} /usr/local/bin/ -- chmod +x /usr/local/bin/{{.Values.name}} -includes: -- /usr/local/bin/{{.Values.name}} - -# TODO: service files for openrc/systemd diff --git a/packages/k3s/collection.yaml b/packages/k3s/collection.yaml deleted file mode 100644 index a281967..0000000 --- a/packages/k3s/collection.yaml +++ /dev/null @@ -1,13 +0,0 @@ -packages: -- name: k3s - category: bundle - checksum-amd64: "c3c816290461dc0e8e632e70ceb0f771382629860a851ae88545c816beb9797c" - version: "1.24.2" - k3s_version: "2" - labels: - github.repo: "k3s-io" - github.owner: "k3s" - uri: - - https://github.com/k3s-io/k3s - license: "APL-2" - description: " Lightweight Kubernetes " \ No newline at end of file diff --git a/packages/k8s/containerd/build.yaml b/packages/k8s/containerd/build.yaml index 32e7000..e21664b 100644 --- a/packages/k8s/containerd/build.yaml +++ b/packages/k8s/containerd/build.yaml @@ -3,7 +3,7 @@ requires: category: "development" version: ">=0" prelude: -{{$arch:=(default .Values.arch "amd64")}} +{{$arch:=(default "amd64" .Values.arch)}} {{ if eq $arch "arm" }} {{$arch:="arm64"}} {{end}} diff --git a/packages/k8s/k3s/build.yaml b/packages/k8s/k3s/build.yaml new file mode 100644 index 0000000..607358d --- /dev/null +++ b/packages/k8s/k3s/build.yaml @@ -0,0 +1,37 @@ +requires: +- name: "toolchain-go" + 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" + - INSTALL_K3S_VERSION=v{{.Values.version}}+k3s1 + {{$arch:=(default "amd64" .Values.arch)}} + {{ if eq $arch "arm" }} + - ARCH=arm64 + {{ else }} + - ARCH={{ $arch }} + {{ end }} +steps: + - curl -sfL https://get.k3s.io > installer.sh + # Let the installer script install service files both for openrc and systemd: + # https://github.com/k3s-io/k3s/blob/36645e7311e9bdbbf2adb79ecd8bd68556bc86f6/install.sh#L114-L122 + - touch /bin/systemctl && chmod +x /bin/systemctl + - mkdir -p /etc/systemd/system/ + - bash installer.sh + - bash installer.sh agent + # Run again to create the openrc service files + - rm /bin/systemctl + - rm -rf /etc/systemd/system/ + - touch /sbin/openrc-run && chmod +x /sbin/openrc-run + - bash installer.sh + - rm -rf installer.sh + - chmod +x /usr/bin/{{.Values.name}} + +includes: +- /usr/bin/{{.Values.name}} +- /etc/systemd/system/k3s*.service +- /etc/init.d/k3s* diff --git a/packages/k8s/k3s/collection.yaml b/packages/k8s/k3s/collection.yaml new file mode 100644 index 0000000..6a3173e --- /dev/null +++ b/packages/k8s/k3s/collection.yaml @@ -0,0 +1,36 @@ +packages: + - name: k3s + 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 + 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 + category: k8s + 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 " diff --git a/packages/bundles/provider-kairos/build.yaml b/packages/system/provider-kairos/build.yaml similarity index 56% rename from packages/bundles/provider-kairos/build.yaml rename to packages/system/provider-kairos/build.yaml index 39021d7..a7dde48 100644 --- a/packages/bundles/provider-kairos/build.yaml +++ b/packages/system/provider-kairos/build.yaml @@ -1,21 +1,22 @@ -{{ if .Values.init }} - {{ if eq .Values.init "systemd" }} image: golang:1.20 +env: + - CGO_ENABLED=0 + - LDFLAGS="-s -w -X 'github.com/kairos-io/provider-kairos/v2/internal/cli.VERSION={{ .Values.version }}'" prelude: - apt-get update - apt-get install -y git - {{ else }} -image: golang:1.20-alpine -prelude: -- apk add git - {{ end }} - git clone https://github.com/kairos-io/provider-kairos - | PACKAGE_VERSION=${PACKAGE_VERSION%\-*} && \ cd provider-kairos && git checkout v$PACKAGE_VERSION steps: - mkdir -p /system/providers -- cd provider-kairos && go build -o agent-provider-kairos +- cd provider-kairos && go build -ldflags "${LDFLAGS}" -o agent-provider-kairos - mv provider-kairos/agent-provider-kairos /system/providers/agent-provider-kairos - ln -s /system/providers/agent-provider-kairos /usr/bin/kairos -{{ end }} \ No newline at end of file + +includes: +- ^/system$ +- ^/system/providers$ +- ^/system/providers/agent-provider-kairos$ +- ^/usr/bin/kairos$ diff --git a/packages/bundles/provider-kairos/collection.yaml b/packages/system/provider-kairos/collection.yaml similarity index 85% rename from packages/bundles/provider-kairos/collection.yaml rename to packages/system/provider-kairos/collection.yaml index 564a198..72ba188 100644 --- a/packages/bundles/provider-kairos/collection.yaml +++ b/packages/system/provider-kairos/collection.yaml @@ -1,6 +1,6 @@ packages: - name: "provider-kairos" - category: "bundles" + category: "system" version: "2.3.0" labels: github.repo: "provider-kairos" diff --git a/packages/utils/k3d/build.yaml b/packages/utils/k3d/build.yaml index 02477df..70d450d 100644 --- a/packages/utils/k3d/build.yaml +++ b/packages/utils/k3d/build.yaml @@ -3,8 +3,7 @@ requires: category: "development" version: ">=0" prelude: -{{$arch:=(default .Values.arch "amd64")}} - +{{$arch:=(default "amd64" .Values.arch)}} {{ if eq $arch "arm" }} {{$arch:="arm64"}}