diff --git a/pkgs/applications/networking/cluster/k3s/1_31/chart-versions.nix b/pkgs/applications/networking/cluster/k3s/1_31/chart-versions.nix new file mode 100644 index 000000000000..aaaa3d4c2970 --- /dev/null +++ b/pkgs/applications/networking/cluster/k3s/1_31/chart-versions.nix @@ -0,0 +1,10 @@ +{ + traefik-crd = { + url = "https://k3s.io/k3s-charts/assets/traefik-crd/traefik-crd-25.0.3+up25.0.0.tgz"; + sha256 = "1z693i4kd3jyf26ccnb0sxjyxadipl6k13n7jyg5v4y93fv1rpdw"; + }; + traefik = { + url = "https://k3s.io/k3s-charts/assets/traefik/traefik-25.0.3+up25.0.0.tgz"; + sha256 = "1a24qlp7c6iri72ka1i37l1lzn13xibrd26dy295z2wzr55gg7if"; + }; +} diff --git a/pkgs/applications/networking/cluster/k3s/1_31/images-versions.json b/pkgs/applications/networking/cluster/k3s/1_31/images-versions.json new file mode 100644 index 000000000000..099ff7e3609b --- /dev/null +++ b/pkgs/applications/networking/cluster/k3s/1_31/images-versions.json @@ -0,0 +1,18 @@ +{ + "airgap-images-amd64": { + "url": "https://github.com/k3s-io/k3s/releases/download/v1.31.0%2Bk3s1/k3s-airgap-images-amd64.tar.zst", + "sha256": "13pakr8nxlbqhqcz40gyjncw4bghk7x7ryb2ynmr5airspqcdrl6" + }, + "airgap-images-arm": { + "url": "https://github.com/k3s-io/k3s/releases/download/v1.31.0%2Bk3s1/k3s-airgap-images-arm.tar.zst", + "sha256": "0vc2v89qy9gbzfbmfrdb0l5yzyprk7yma5ps0yfj60jd9av07qvh" + }, + "airgap-images-arm64": { + "url": "https://github.com/k3s-io/k3s/releases/download/v1.31.0%2Bk3s1/k3s-airgap-images-arm64.tar.zst", + "sha256": "10ffa45pm1scavcd5cimdaw29rlc55c9i40qzh3n3451g1yqlmmk" + }, + "images-list": { + "url": "https://github.com/k3s-io/k3s/releases/download/v1.31.0%2Bk3s1/k3s-images.txt", + "sha256": "0y4x02fj1iysghq6s88wsiqfpsajrrwrg89m59qk431cii23nrza" + } +} diff --git a/pkgs/applications/networking/cluster/k3s/1_31/versions.nix b/pkgs/applications/networking/cluster/k3s/1_31/versions.nix new file mode 100644 index 000000000000..74f2f1de0569 --- /dev/null +++ b/pkgs/applications/networking/cluster/k3s/1_31/versions.nix @@ -0,0 +1,15 @@ +{ + k3sVersion = "1.31.0+k3s1"; + k3sCommit = "34be6d96d17d8d65fda86272b62b752cb0e9c45e"; + k3sRepoSha256 = "16yzsx56jmca07jdnzjvy4pcfrvvibv987l1mzdaws1vkm3xqfnw"; + k3sVendorHash = "sha256-1uYlvGkW6n4aiUVX/2OjppczdobY/fk1ZaK6j3AEwvM="; + chartVersions = import ./chart-versions.nix; + imagesVersions = builtins.fromJSON (builtins.readFile ./images-versions.json); + k3sRootVersion = "0.14.0"; + k3sRootSha256 = "15cs9faw3jishsb5nhgmb5ldjc47hkwf7hz2126fp8ahf80m0fcl"; + k3sCNIVersion = "1.4.0-k3s2"; + k3sCNISha256 = "17dg6jgjx18nrlyfmkv14dhzxsljz4774zgwz5dchxcf38bvarqa"; + containerdVersion = "1.7.20-k3s1"; + containerdSha256 = "12ihr3z8vcglv5b0v9ris29zkkkdvjbcp3bf7ym71a0xdbg83s8i"; + criCtlVersion = "1.31.0-k3s2"; +} diff --git a/pkgs/applications/networking/cluster/k3s/builder.nix b/pkgs/applications/networking/cluster/k3s/builder.nix index e0288c21fc99..1fb10c82dcc1 100644 --- a/pkgs/applications/networking/cluster/k3s/builder.nix +++ b/pkgs/applications/networking/cluster/k3s/builder.nix @@ -211,7 +211,7 @@ let sed --quiet '/# --- run the install process --/q;p' ${k3sRepo}/install.sh > install.sh # Let killall expect "containerd-shim" in the Nix store - to_replace="k3s/data/\[\^/\]\*/bin/containerd-shim" + to_replace="/data/\[\^/\]\*/bin/containerd-shim" replacement="/nix/store/.*k3s-containerd.*/bin/containerd-shim" changes=$(sed -i "s|$to_replace|$replacement| w /dev/stdout" install.sh) if [ -z "$changes" ]; then diff --git a/pkgs/applications/networking/cluster/k3s/default.nix b/pkgs/applications/networking/cluster/k3s/default.nix index c8e3fbc92696..59fd6b1be344 100644 --- a/pkgs/applications/networking/cluster/k3s/default.nix +++ b/pkgs/applications/networking/cluster/k3s/default.nix @@ -43,4 +43,14 @@ in ]; } ) extraArgs; + + k3s_1_31 = common ( + (import ./1_31/versions.nix) + // { + updateScript = [ + ./update-script.sh + "31" + ]; + } + ) extraArgs; } diff --git a/pkgs/applications/networking/cluster/k3s/update-script.sh b/pkgs/applications/networking/cluster/k3s/update-script.sh index 9eab8ce08f81..ac451806ff66 100755 --- a/pkgs/applications/networking/cluster/k3s/update-script.sh +++ b/pkgs/applications/networking/cluster/k3s/update-script.sh @@ -107,7 +107,13 @@ CONTAINERD_VERSION=$(grep github.com/containerd/containerd ${FILE_GO_MOD} \ CONTAINERD_SHA256=$(nix-prefetch-url --quiet --unpack \ "https://github.com/k3s-io/containerd/archive/refs/tags/v${CONTAINERD_VERSION}.tar.gz") -CRI_CTL_VERSION=$(grep github.com/kubernetes-sigs/cri-tools ${FILE_GO_MOD} \ +# The repository of "cri-tools" changes for 1.31.x, this can likely be removed in future releases +if [ "$MINOR_VERSION" -gt 30 ]; then + CRI_CTL_REPO=sigs.k8s.io +else + CRI_CTL_REPO=github.com/kubernetes-sigs +fi +CRI_CTL_VERSION=$(grep "$CRI_CTL_REPO/cri-tools" ${FILE_GO_MOD} \ | head -n1 | awk '{print $4}' | sed -e 's/"//g' -e 's/^v//') setKV () { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4431be64a3f4..3472fac9adfd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31088,8 +31088,13 @@ with pkgs; jwm-settings-manager = callPackage ../applications/window-managers/jwm/jwm-settings-manager.nix { }; - inherit (callPackage ../applications/networking/cluster/k3s { }) k3s_1_28 k3s_1_29 k3s_1_30; - k3s = k3s_1_30; + inherit (callPackage ../applications/networking/cluster/k3s { }) + k3s_1_28 + k3s_1_29 + k3s_1_30 + k3s_1_31 + ; + k3s = k3s_1_31; k3sup = callPackage ../applications/networking/cluster/k3sup { };