Commit 3bffd437 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: add k3s

parent 35d5a4c8
#!/bin/sh
TAR="$1"
RETURNTARNAME="$2"
VERSION="$3"
. $(dirname $0)/common.sh
PKGNAME=$PRODUCT-$VERSION
install -D $TAR usr/bin/$PRODUCT || fatal
ln -s $PRODUCT usr/bin/kubectl
erc pack $PKGNAME.tar usr/bin/$PRODUCT usr/bin/kubectl
return_tar $PKGNAME.tar
#!/bin/sh
PKGNAME=k3s
SUPPORTEDARCHES="x86_64 aarch64 armhf"
VERSION="$2"
DESCRIPTION="K3s - Lightweight Kubernetes from the official site"
URL="https://k3s.io"
. $(dirname $0)/common.sh
arch="$(epm print info -a)"
case "$arch" in
x86_64)
file="k3s"
;;
armhf)
file="k3s-armhf"
;;
aarch64)
file="k3s-arm64"
;;
*)
fatal "$arch arch is not supported"
;;
esac
# TODO: support for install any version
#if [ "$VERSION" = "*" ] ; then
#fi
PKGURL="$(eget --list --latest https://github.com/k3s-io/k3s/releases "$file")"
#direct url:
#https://github.com/k3s-io/k3s/releases/download/v1.27.1-rc3%2Bk3s1/k3s
VERSION="$(echo "$PKGURL" | sed -e 's|.*download/v||' -e 's|%2Bk3s1.*||' -e 's|-.*||')"
epm pack --install $PKGNAME "$PKGURL" $VERSION
#!/bin/sh -x
# It will be run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
. $(dirname $0)/common.sh
subst "s|^Group:.*|Group: File tools|" $SPEC
subst "s|^License:.*$|License: Apache-2.0|" $SPEC
subst "s|^URL:.*|URL: https://k3s.io|" $SPEC
subst "s|^Summary:.*|Summary: K3s - Lightweight Kubernetes|" $SPEC
subst '1iAutoReq:no' $SPEC
subst '1iAutoProv:no' $SPEC
#subst '1iConflicts: go-ipfs' $SPEC
#subst '1iProvides: go-ipfs' $SPEC
# Check https://get.k3s.io/
mkdir -p usr/lib/systemd/system/
cat >usr/lib/systemd/system/k3s.service << EOF
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
Wants=network-online.target
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=notify
EnvironmentFile=-/etc/default/%N
EnvironmentFile=-/etc/sysconfig/%N
EnvironmentFile=-/etc/systemd/system/k3s.service.env
KillMode=process
Delegate=yes
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Restart=always
RestartSec=5s
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/k3s server
EOF
pack_file /usr/lib/systemd/system/k3s.service
mkdir -p etc/systemd/system/
cat >etc/systemd/system/k3s.service.env << EOF
# K3S_URL=
# K3S_TOKEN=
# K3S_CLUSTER_SECRET=
EOF
pack_file /etc/systemd/system/k3s.service.env
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment