Skip to content

Commit

Permalink
Upgrade default Talos version to 1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dbackeus committed Oct 24, 2024
1 parent e8fd4f6 commit 6848caa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM base as talosctl

RUN apt-get update -qq && apt-get install --no-install-recommends -y wget

ARG TALOS_VERSION=1.8.0-beta.0
ARG TALOS_VERSION=1.8.1
# TODO: This should use TARGETPLATFORM to determine the correct binary to download
RUN wget https://github.com/siderolabs/talos/releases/download/v${TALOS_VERSION}/talosctl-linux-amd64 -O /usr/local/bin/talosctl
RUN chmod +x /usr/local/bin/talosctl
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/configs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def show
def new
@config = Config.new(
kubernetes_version: "1.30.1",
install_image: "ghcr.io/siderolabs/installer:v1.7.6",
install_image: "ghcr.io/siderolabs/installer:v1.8.1",
kubespan: true,
)
end
Expand Down
19 changes: 13 additions & 6 deletions app/models/server.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Server < ApplicationRecord
TALOS_AMD64_IMAGE_URL = ENV["TALOS_AMD64_IMAGE_URL"] || "https://github.com/siderolabs/talos/releases/download/v1.7.6/metal-amd64.raw.xz".freeze
TALOS_ARM64_IMAGE_URL = ENV["TALOS_ARM64_IMAGE_URL"] || "https://github.com/siderolabs/talos/releases/download/v1.7.6/metal-arm64.raw.xz".freeze
TALOS_AMD64_IMAGE_URL = ENV["TALOS_AMD64_IMAGE_URL"] || "https://github.com/siderolabs/talos/releases/download/v1.8.1/metal-amd64.raw.zst".freeze
TALOS_ARM64_IMAGE_URL = ENV["TALOS_ARM64_IMAGE_URL"] || "https://github.com/siderolabs/talos/releases/download/v1.8.1/metal-arm64.raw.zst".freeze

belongs_to :cluster, optional: true

Expand Down Expand Up @@ -45,11 +45,11 @@ def bootstrappable?
end

# Equivalent of manually running the following via ssh:
# TALOS_IMAGE_URL=https://github.com/siderolabs/talos/releases/download/v1.7.6/metal-amd64.raw.xz
# TALOS_IMAGE_URL=https://github.com/siderolabs/talos/releases/download/v1.8.1/metal-amd64.raw.zst
# DEVICE=nvme0n1
# HOST=example.com
#
# wget $TALOS_IMAGE_URL --quiet -O - | xz -d | dd of=/dev/$DEVICE status=progress
# wget $TALOS_IMAGE_URL --quiet -O - | zstd -d | dd of=/dev/$DEVICE status=progress
# sync
# mount /dev/${DEVICE}p3 /mnt
# sed -i "s/vmlinuz/vmlinuz talos.config=https:\/\/$HOST\/config/" /mnt/grub/grub.cfg
Expand All @@ -72,8 +72,15 @@ def bootstrap!

boot_partition = nvme ? "p3" : "3"

# Support Talos versions 1.3 and below which were packaged as tar.gz
extract_command = talos_image_url.end_with?(".tar.gz") ? "tar xvfzO -" : "xz -d"
# Talos versions 1.3 and below were packaged as tar.gz, 1.4 -> 1.7 as xz and 1.8.0+ as zst
extract_command =
if talos_image_url.end_with?(".tar.gz")
"tar xvfzO -"
elsif talos_image_url.end_with?(".xz")
"xz -d"
else
"zstd -d"
end

Rails.logger.info "Bootstrapping #{ip} with talos image #{talos_image_url} on #{bootstrap_disk}"
ssh_exec_with_log! session,
Expand Down

0 comments on commit 6848caa

Please sign in to comment.