Skip to content

KAAP-519: Download kubelet, kubectl and cri-tools binaries from k8s / cri repo not APT - #74

Draft
hsri-pf9 wants to merge 4 commits into
mainfrom
private/main/harsh/kaap-519
Draft

KAAP-519: Download kubelet, kubectl and cri-tools binaries from k8s / cri repo not APT#74
hsri-pf9 wants to merge 4 commits into
mainfrom
private/main/harsh/kaap-519

Conversation

@hsri-pf9

@hsri-pf9 hsri-pf9 commented Jul 25, 2025

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

Changed the way of downloading kubelet, kubectl, kubeadm and cri-tools not from apt but directly downloading it from the repo via curl and adding them to the bundle.

Summary by Bito

This pull request transitions from apt-based package downloads to direct downloads from remote repositories, refining the bundle builder, Dockerfile, and download script. The changes improve command syntax, update environment variables, and implement curl for fetching binaries. The PR also corrects variable formatting, enhances docker run commands with additional environment variables, and explicitly sets CNI_VERSION in the Dockerfile for a more robust deployment process.

@bito-code-review

bito-code-review Bot commented Jul 25, 2025

Copy link
Copy Markdown

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
New Feature - Direct Download of Binaries

download.sh - Replaced APT-based package downloads with direct curl downloads for kubeadm, kubelet, kubectl, crictl, and CNI plugins to improve reliability and speed.

Feature Improvement - Enhanced Bundle Scripts

build-push-bundle.sh - Updated environment variable handling (adding OS and CNI_VERSION) and revised the docker run command to include new parameters.

build-bundle.sh - Refined file copy commands and tar operations with proper quoting and updated paths for a consistent bundling process.

Other Improvements - Configuration Updates in Dockerfile

Dockerfile - Added new environment variables (OS and CNI_VERSION) to support the updated download mechanism.

@bito-code-review bito-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #42a020

Actionable Suggestions - 1
  • installer/bundle_builder/ingredients/deb/download.sh - 1
    • Double 'v' prefix in CNI_VERSION variable · Line 17-19
Review Details
  • Files reviewed - 3 · Commit Range: 581dddc..581dddc
    • installer/bundle_builder/build-bundle.sh
    • installer/bundle_builder/ingredients/deb/Dockerfile
    • installer/bundle_builder/ingredients/deb/download.sh
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at mithil@platform9.com.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines +17 to +19
K8S_VERSION="v${KUBERNETES_VERSION%%-*}"
CRICTL_VERSION="v${CRITOOL_VERSION}"
CNI_VERSION="v${CNI_VERSION}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double 'v' prefix in CNI_VERSION variable

The K8S_VERSION and CRICTL_VERSION variables are correctly prefixed with 'v', but CNI_VERSION is incorrectly prefixed with 'v' twice since the environment variable already includes the 'v' prefix. This will cause download failures for CNI plugins.

Code suggestion
Check the AI-generated fix before applying
 @@ -17,7 +17,7 @@
  +K8S_VERSION="v${KUBERNETES_VERSION%%-*}"
  +CRICTL_VERSION="v${CRITOOL_VERSION}"
 -+CNI_VERSION="v${CNI_VERSION}"
 ++CNI_VERSION="${CNI_VERSION}"
 
  +mkdir -p /ingredients
 

Code Review Run #42a020


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@bito-code-review

bito-code-review Bot commented Jul 25, 2025

Copy link
Copy Markdown

Code Review Agent Run #472fa5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: 581dddc..d0169d8
    • installer/bundle_builder/ingredients/deb/download.sh
    • .ci/build-push-bundle.sh
    • installer/bundle_builder/ingredients/deb/Dockerfile
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at mithil@platform9.com.

Documentation & Help

AI Code Review powered by Bito Logo

Replace apt/.deb sourcing (installer/bundle_builder/ingredients/deb/download.sh)
with direct upstream releases:

- kubeadm, kubelet, kubectl: raw binaries from dl.k8s.io, each verified against
  its .sha256 before use (previously no integrity verification at all).
- crictl: kubernetes-sigs/cri-tools release tarball.
- CNI plugins: containernetworking/plugins release tarball.
- containerd: the plain containerd-<version>-<os>-<arch>.tar.gz tarball instead
  of the cri-containerd-cni-* bundle, which containerd's own release notes mark
  deprecated since 1.6 (removed in 2.0) and which duplicated crictl/CNI plugins
  already sourced separately above.
- runc: added as its own ingredient (opencontainers/runc releases), since the
  plain containerd tarball doesn't bundle it the way the deprecated one did.

Also fixes CRITOOL_VERSION's default (1.32.0-1.1, a leftover Debian-revision
suffix from the old apt-based versioning) which produced a 404 against
cri-tools' real v1.32.0 tag; strips any such suffix defensively the same way
KUBERNETES_VERSION already was.

build-bundle.sh and .ci/build-push-bundle.sh are updated to match the new
ingredient filenames and pass RUNC_VERSION through.
install.sh.tmpl and uninstall.sh.tmpl still assumed the old apt/.deb bundle
layout (dpkg --install/--purge against kubeadm.deb, kubelet.deb, kubectl.deb,
cri-tools.deb, kubernetes-cni.deb; containerd.tar). Neither matched what the
bundle builder now actually produces, so install would fail outright on a
real host: no such files exist in the bundle.

Update both scripts to the layout the previous commit's bundle builder
produces: install kubeadm/kubelet/kubectl as plain executables to /usr/bin,
extract crictl.tar.gz to /usr/local/bin, extract cni-plugins.tgz to
/opt/cni/bin, install runc to /usr/local/sbin, and extract the plain
containerd.tar.gz to /usr/local (matching containerd's own docs convention,
since the tarball's entries are now bin/containerd etc. instead of the
deprecated bundle's absolute-path layout). uninstall.sh.tmpl removes the same
set, deriving exact paths from each tarball's own file listing rather than a
hardcoded package list.
Records the rationale for sourcing kubeadm/kubelet/kubectl/crictl/CNI
plugins/containerd/runc from upstream releases instead of apt (previous two
commits), and flags why this branch is not yet mergeable: the bundle OCI tag
(quay.io/platform9/byoh-bundle-<os>_k8s:<k8s-version>) encodes only the
Kubernetes version, not the bundle's internal file layout. Since
install.sh.tmpl/uninstall.sh.tmpl are embedded in the manager binary and a
bundle push to quay.io happens independently (a human running
.ci/build-push-bundle.sh), there is no safe order to land the manager change
and the bundle push in -- whichever lands second breaks every manager version
still relying on the other format at that same mutable tag, including
already-deployed production managers.

Fixing that needs a bundle-format version folded into the OCI tag itself
(installer/bundle_downloader.go, installer/registry.go,
k8sinstallerconfig_controller.go) -- out of scope for this change, called out
here as a blocker.
Adds two test cases to common_ubuntu_test.go asserting the rendered
Install()/Uninstall() scripts reference the new bundle layout (raw
kubeadm/kubelet/kubectl binaries, crictl.tar.gz, cni-plugins.tgz, runc,
containerd.tar.gz) and contain no leftover dpkg/.deb references -- guarding
against the exact regression this branch fixes (templates drifting from what
the bundle builder actually packages) without needing a real bundle or host.
@srm6867
srm6867 force-pushed the private/main/harsh/kaap-519 branch 2 times, most recently from d0169d8 to 068a93e Compare August 18, 2026 13:25
@srm6867
srm6867 marked this pull request as draft August 18, 2026 13:26
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants