Skip to content

Commit

Permalink
New package: k0s-1.22.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed Oct 7, 2021
1 parent 628119d commit 83b6870
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
4 changes: 4 additions & 0 deletions srcpkgs/k0s/files/k0s-worker.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# K0S_CRI_SOCKET=remote:/run/containerd/containerd.sock
# K0S_ENABLE_CLOUD_PROVIDER=true
# K0S_PROFILE=default
# K0S_TOKEN_FILE=/etc/k0s/worker.token
16 changes: 16 additions & 0 deletions srcpkgs/k0s/files/k0s-worker/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -e
. /etc/default/k0s-worker
case ${K0S_CRI_SOCKET} in
remote:*)
sv check containerd
;;
docker:*)
sv check docker
;;
esac

exec k0s -c "/etc/k0s/k0s.conf" worker \
${K0S_CRI_SOCKET:+--cri-socket="$K0S_CRI_SOCKET"} \
${K0S_ENABLE_CLOUD_PROVIDER:+--enable-cloud-provider} \
${K0S_PROFILE:+--profile="$K0S_PROFILE"} \
--token-file=${K0S_TOKEN_FILE:-/etc/k0s/worker.token}
3 changes: 3 additions & 0 deletions srcpkgs/k0s/files/k0s.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# K0S_ENABLE_WORKER=false
# K0S_PROFILE=default
# K0S_TOKEN_FILE=/etc/k0s/server.token
7 changes: 7 additions & 0 deletions srcpkgs/k0s/files/k0s/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh -e
. /etc/default/k0s

exec chpst -u _k0s:_k0s k0s -c "/etc/k0s/k0s.conf" server \
${K0S_ENABLE_WORKER:+--enable-worker} \
${K0S_PROFILE:+--profile="${K0S_PROFILE}"} \
${K0S_TOKEN_FILE:+--token-file="${K0S_TOKEN_FILE}"}
40 changes: 40 additions & 0 deletions srcpkgs/k0s/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Template file for 'k0s'
pkgname=k0s
version=1.22.2.0
revision=1
_version=${version%.*}+k0s.${version##*.}
wrksrc="${pkgname}-${_version//+/-}"
build_style=go
go_import_path=github.com/k0sproject/k0s
hostmakedepends="which golangci-lint"
depends="kubernetes containerd konnectivity-server etcd"
short_desc="Zero Friction Kubernetes"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="Apache-2.0"
homepage="https://k0sproject.io/"
distfiles="https://github.com/k0sproject/$pkgname/archive/v${_version}.tar.gz"
checksum=42d4f52a5eddd19128648c2c5510217882e0ef0a880181a2a140bc46ed61728d
system_accounts="_k0s"
make_dirs="/var/lib/k0s 0755 _k0s _k0s"
_k0s_homedir="/var/lib/k0s"
_k0s_descr="k0s server user"
conf_files="
/etc/default/*"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" k0s"
fi

pre_build() {
# Make sure files are generated correctly before actually building
make EMBEDDED_BINS_BUILDMODE=none \
static/gen_manifests.go \
pkg/assets/zz_generated_offsets_linux.go
}

post_install() {
vsv k0s
vinstall ${FILESDIR}/k0s.default 644 /etc/default/ k0s

vsv k0s-worker
vinstall ${FILESDIR}/k0s-worker.default 644 /etc/default/ k0s-worker
}

0 comments on commit 83b6870

Please sign in to comment.