meta-virtualization/recipes-containers/k3s/k3s_git.bb
Bruce Ashfield 2ef1ee0412 k3s: update to v1.31.1+k3s1
Bumping k3s to version v1.31.1+k3s1, which comprises the following commits:

    452dbbc14c update kubernetes to v1.31.1-k3s3 (#10910)
    9ae2c39004 Update Kubernetes to v1.31.1 (#10895)
    d926e69073 Fix hosts.toml header var
    2caa785e17 Only clean up containerd hosts dirs managed by k3s
    4c8ef7f477 Fix rotateca validation failures when not touching default self-signed CAs
    0c8d3c0d58 Bump helm-controller for skip-verify/plain-http and updated tolerations
    db3cf9370e Bump containerd to v1.7.21, runc to v1.1.14
    28a1fd0302 Update coredns to 1.11.3 and metrics-server to 0.7.2
    944b3b2830 Bump traefik to v2.11.8
    703e7697b0 Tag PR image build as latest before scanning
    88d5576be6 Fix /trivy action running against target branch instead of PR branch
    9c537cb705 Bump aquasecurity/trivy-action from 0.20.0 to 0.24.0 (#10795)
    be60661f18 Add trivy scanning trigger for PRs (#10758)
    e0c4e60171 Update CNI plugins version
    3923e0c699 Cover edge case when on new minor release for E2E upgrade test (#10781)
    8bfcfd70cc Fix deploy latest commit on E2E tests (#10725)
    e8de533e90 Remove secrets encryption controller (#10612)
    34be6d96d1 Update kubernetes to v1.31.0-k3s3 (#10780)
    c7468edbe7 Bump go dependencies to match upstream 1.31
    ebbb109840 Update VERSION_K8S to handle any k3s revision
    f5c6472b16 Bump Kine to v0.12.0
    d358a89171 Fix secrets-encrypt metrics
    178aadbe20 Add k3s-io/kubernetes tags
    5087240e32 Downgrade Microsoft/hcsshim to v0.8.26
    8cbcbcd044 go generate
    20b50426ab Update to v1.31.0
    876d54cf49 chore: Bump Trivy version (#10670)
    518276fb77 adding MariaDB to README.md (#10717)
    649678bd89 Fix k3s-killall.sh support for custom data dir
    38df76708d Fix caching name for e2e vagrant box (#10695)
    ae0d79c7ea Update to v1.30.3-k3s1 and Go 1.22.5 (#10536)
    019b0afdd8 Fix: Add $SUDO prefix to transactional-update commands in install script (#10531)
    22fb7049bd Add tolerations support for DaemonSet pods
    daf0094cc7 Bump helm-controller to v0.16.3 to drop Helm v2 support
    ac247d29cf Update to newer OS images for install testing (#10681)
    0ee714d62b Bump containerd to v1.7.20 (#10659)
    acb71ee379 Allow Amazon Linux 2 rpm installs
    79ec016b6d Allow kylin V10 rpm installs
    8ff7d162cc Allow fedora iot rpm installs
    45c04f3502 Allow Amazon Linux 2023 rpm installs
    3aceb85c22 Add a change for killall to not unmount server and agent directory
    82ba778a86 bump docker/docker to v25.0.6
    38e8b01b8f update stable channel to v1.30.3+k3s1 (#10647)
    bffdf463e1 Fix cloudprovider controller name
    e168438d44 Wire lasso metrics up to common gatherer
    e2179aa957 Update pkg/cluster/managed.go
    3ec086f6f7 Update pkg/secretsencrypt/config.go
    e4f3cc7b54 remove deprecated use of wait functions
    e514940020 Fix inconsistent loading of config dropins when config file does not exist
    9111b1f77e Add K3S_DATA_DIR as env var for --data-dir flag
    a26a5ab1d7 Don't set K3S_DATA_DIR env var
    59e0761043 Use higher QPS for secrets reencryption (#10571)
    a70157c12e Allow Pprof and Superisor metrics in standalone mode (#10576)
    ecff337e00 Enhance E2E Hardened option (#10558)
    d4c3422a85 Fix ipv6 sysctl required by non-ipv6 LoadBalancer service
    21611c5665 Cap length of generated name used for servicelb daemonset
    891e72f90f Update secretsencrypt pagination
    c2216a62ad Use pagination when retrieving etcd snapshot list
    37830fe170 Don't use server and token values from config file for etcd-snapshot commands
    cb6bf74bc4 Add dial duration to debug error message
    118acabec2 Fix IPv6 primary node-ip handling
    9841517457 Fix agents removing configured supervisor address
    9d0c2e0000 Fix reentrant rlock in loadbalancer.dialContext
    b999a5b23d Bump kine to v0.11.11
    58ab25927f For E2E upgrade test, automatically determine the channel to use (#10461)
    c36db53e54 Add etcd s3 config secret implementation
    5508589fae chore: Bump Trivy version
    eb8bd15889 Ensure remotedialer kubelet connections use kubelet bind address
    a0b374508e Bump Local Path Provisioner version (#10394)
    0b417385a4 chore: Bump golang:alpine version
    f6942f3de4 Bump github.com/hashicorp/go-retryablehttp from 0.7.4 to 0.7.7
    b045465178 Add data-dir to uninstall and killall scripts
    d1709d60ce Fix INSTALL_K3S_PR support
    047664b610 Bump k3s-root to v0.14.0
    4204248bc3 Check for bad token permissions when install via PR (#10387)
    8f9ad1f992 Move test-compat to GHA (#10414)

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2024-10-03 01:28:52 +00:00

152 lines
5.9 KiB
BlitzBasic

SUMMARY = "Production-Grade Container Scheduling and Management"
DESCRIPTION = "Lightweight Kubernetes, intended to be a fully compliant Kubernetes."
HOMEPAGE = "https://k3s.io/"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/src/import/LICENSE;md5=2ee41112a44fe7014dce33e26468ba93"
SRC_URI = "git://github.com/rancher/k3s.git;branch=release-1.31;name=k3s;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX} \
file://k3s.service \
file://k3s-agent.service \
file://k3s-agent \
file://k3s-clean \
file://cni-containerd-net.conf \
file://0001-Finding-host-local-in-usr-libexec.patch;patchdir=src/import \
file://k3s-killall.sh \
file://modules.txt \
"
SRC_URI[k3s.md5sum] = "363d3a08dc0b72ba6e6577964f6e94a5"
SRCREV_k3s = "452dbbc14c747a0070fdf007ef2239a6e5d8d934"
SRCREV_FORMAT = "k3s_fuse"
PV = "v1.31.1+k3s1+git${SRCREV_k3s}"
include src_uri.inc
CNI_NETWORKING_FILES ?= "${UNPACKDIR}/cni-containerd-net.conf"
inherit go
inherit goarch
inherit systemd
inherit cni_networking
COMPATIBLE_HOST = "^(?!mips).*"
PACKAGECONFIG = ""
PACKAGECONFIG[upx] = ",,upx-native"
GO_IMPORT = "import"
GO_BUILD_LDFLAGS = "-X github.com/k3s-io/k3s/pkg/version.Version=${PV} \
-X github.com/k3s-io/k3s/pkg/version.GitCommit=${@d.getVar('SRCREV_k3s', d, 1)[:8]} \
-w -s \
"
BIN_PREFIX ?= "${exec_prefix}/local"
inherit features_check
REQUIRED_DISTRO_FEATURES ?= "seccomp"
DEPENDS += "rsync-native"
include relocation.inc
do_compile() {
export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
export CGO_ENABLED="1"
export GOFLAGS="-mod=vendor"
# TAGS="static_build ctrd no_btrfs netcgo osusergo providerless"
TAGS="static_build netcgo osusergo providerless"
cd ${S}/src/import
if ! [ -e vendor/.noclobber ]; then
ln -sf vendor.copy vendor
else
echo "[INFO]: no clobber on vendor"
fi
# these are bad symlinks, go validates them and breaks the build if they are present
rm -f vendor/go.etcd.io/etcd/client/v*/example_*
rm -f vendor/go.etcd.io/etcd/client/v*/concurrency/example_*.go
# Note: if no_brtfs is used in the tags, we'll violate build
# constraints, and the following files need to have them
# removed for the build to continue:
#
# vendor/github.com/containerd/containerd/snapshots/btrfs/plugin/*.go
cp ${UNPACKDIR}/modules.txt vendor/
VERSION_GOLANG="$(go version | cut -d" " -f3)"
${GO} build -trimpath -tags "$TAGS" -ldflags "-X github.com/k3s-io/k3s/pkg/version.UpstreamGolang=$VERSION_GOLANG ${GO_BUILD_LDFLAGS} -w -s" -o ./dist/artifacts/k3s ./cmd/server/main.go
# Use UPX if it is enabled (and thus exists) to compress binary
if command -v upx > /dev/null 2>&1; then
upx -9 ./dist/artifacts/k3s
fi
}
do_install() {
install -d "${D}${BIN_PREFIX}/bin"
install -m 755 "${S}/src/import/dist/artifacts/k3s" "${D}${BIN_PREFIX}/bin"
ln -sr "${D}/${BIN_PREFIX}/bin/k3s" "${D}${BIN_PREFIX}/bin/crictl"
# We want to use the containerd provided ctr
# ln -sr "${D}/${BIN_PREFIX}/bin/k3s" "${D}${BIN_PREFIX}/bin/ctr"
ln -sr "${D}/${BIN_PREFIX}/bin/k3s" "${D}${BIN_PREFIX}/bin/kubectl"
install -m 755 "${UNPACKDIR}/k3s-clean" "${D}${BIN_PREFIX}/bin"
install -m 755 "${UNPACKDIR}/k3s-killall.sh" "${D}${BIN_PREFIX}/bin"
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -D -m 0644 "${UNPACKDIR}/k3s.service" "${D}${systemd_system_unitdir}/k3s.service"
install -D -m 0644 "${UNPACKDIR}/k3s-agent.service" "${D}${systemd_system_unitdir}/k3s-agent.service"
sed -i "s#\(Exec\)\(.*\)=\(.*\)\(k3s\)#\1\2=${BIN_PREFIX}/bin/\4#g" "${D}${systemd_system_unitdir}/k3s.service" "${D}${systemd_system_unitdir}/k3s-agent.service"
install -m 755 "${UNPACKDIR}/k3s-agent" "${D}${BIN_PREFIX}/bin"
fi
mkdir -p ${D}${datadir}/k3s/
install -m 0755 ${S}/src/import/contrib/util/check-config.sh ${D}${datadir}/k3s/
}
PACKAGES =+ "${PN}-server ${PN}-agent"
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}-server ${PN}-agent','',d)}"
SYSTEMD_SERVICE:${PN}-server = "${@bb.utils.contains('DISTRO_FEATURES','systemd','k3s.service','',d)}"
SYSTEMD_SERVICE:${PN}-agent = "${@bb.utils.contains('DISTRO_FEATURES','systemd','k3s-agent.service','',d)}"
SYSTEMD_AUTO_ENABLE:${PN}-agent = "disable"
FILES:${PN}-agent = "${BIN_PREFIX}/bin/k3s-agent"
FILES:${PN} += "${BIN_PREFIX}/bin/*"
RDEPENDS:${PN} = "k3s-cni conntrack-tools coreutils findutils iptables iproute2 ipset virtual-containerd"
RDEPENDS:${PN}-server = "${PN}"
RDEPENDS:${PN}-agent = "${PN}"
RRECOMMENDS:${PN} = "\
kernel-module-xt-addrtype \
kernel-module-xt-nat \
kernel-module-xt-multiport \
kernel-module-xt-conntrack \
kernel-module-xt-comment \
kernel-module-xt-mark \
kernel-module-xt-connmark \
kernel-module-vxlan \
kernel-module-xt-masquerade \
kernel-module-xt-statistic \
kernel-module-xt-physdev \
kernel-module-xt-nflog \
kernel-module-xt-limit \
kernel-module-nfnetlink-log \
kernel-module-ip-vs \
kernel-module-ip-vs-rr \
kernel-module-ip-vs-sh \
kernel-module-ip-vs-wrr \
"
RCONFLICTS:${PN} = "kubectl"
PACKAGES =+ "${PN}-contrib"
FILES:${PN}-contrib += "${datadir}/k3s/check-config.sh"
RDEPENDS:${PN}-contrib += "bash"
INHIBIT_PACKAGE_STRIP = "1"
INSANE_SKIP:${PN} += "ldflags already-stripped textrel"