Skip to content

Conversation

@ewerton-silva00
Copy link

…a default CNI

Description

This PR fixes #9304.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

The script in question generates CloudStack Kubernetes Service (CKS) images using Cilium as the default CNI.

Additionally, the other components are up-to-date.

image image image image

You can also use ready-made images from my repository.. See: https://download.suanuvem.io/cks/

image

@boring-cyborg
Copy link

boring-cyborg bot commented Feb 9, 2026

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.90%. Comparing base (d3e1976) to head (7fbad05).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12619      +/-   ##
============================================
- Coverage     17.90%   17.90%   -0.01%     
+ Complexity    16094    16091       -3     
============================================
  Files          5938     5938              
  Lines        532864   532864              
  Branches      65192    65192              
============================================
- Hits          95392    95385       -7     
- Misses       426793   426801       +8     
+ Partials      10679    10678       -1     
Flag Coverage Δ
uitests 3.67% <ø> (ø)
unittests 19.00% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✖️ debian ✔️ suse15. SL-JID 16769

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new utility script to generate CloudStack Kubernetes Service (CKS) “binaries ISO” images that bundle Kubernetes components plus manifests/images needed to run with Cilium as the default CNI, addressing the requested Cilium support in #9304.

Changes:

  • Introduces create-kubernetes-binaries-iso-with-cilium.sh to build an ISO with Kubernetes binaries, CNI/crictl, addons/manifests, and pre-pulled container images.
  • Generates the Cilium manifest via Helm with a set of default Cilium configuration values.
  • Updates image collection/pulling logic to include images referenced by generated Cilium and Dashboard manifests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +258 to +260
echo "Downloading etcd ${ETCD_VERSION}..."
curl -sS -L "https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz" -o ${etcd_dir}/etcd-linux-amd64.tar.gz

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

etcd tarball download is hard-coded to linux-amd64, which will produce a broken ISO when ARCH is arm64/aarch64. Use the selected ARCH when building the etcd download URL and output filename (and ensure the upstream release asset name matches the arch mapping you use).

Suggested change
echo "Downloading etcd ${ETCD_VERSION}..."
curl -sS -L "https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz" -o ${etcd_dir}/etcd-linux-amd64.tar.gz
# Determine etcd architecture based on ARCH/script argument, matching etcd release asset naming.
# Default to amd64 if ARCH is not set or unrecognized.
ETCD_ARCH="amd64"
if [ -n "${ARCH:-}" ]; then
case "${ARCH}" in
amd64|x86_64)
ETCD_ARCH="amd64"
;;
arm64|aarch64)
ETCD_ARCH="arm64"
;;
armv7*|armhf|arm)
ETCD_ARCH="arm"
;;
*)
echo "Warning: Unknown ARCH '${ARCH}', defaulting etcd architecture to 'amd64'" >&2
;;
esac
elif [ -n "${6:-}" ]; then
case "${6}" in
amd64|x86_64)
ETCD_ARCH="amd64"
;;
arm64|aarch64)
ETCD_ARCH="arm64"
;;
armv7*|armhf|arm)
ETCD_ARCH="arm"
;;
*)
echo "Warning: Unknown ARCH '${6}', defaulting etcd architecture to 'amd64'" >&2
;;
esac
fi
echo "Downloading etcd ${ETCD_VERSION} for architecture linux-${ETCD_ARCH}..."
curl -sS -L "https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-${ETCD_ARCH}.tar.gz" -o "${etcd_dir}/etcd-linux-${ETCD_ARCH}.tar.gz"

Copilot uses AI. Check for mistakes.
Comment on lines +186 to +190
sudo $PKG_MGR --assumeyes remove docker-common docker container-selinux docker-selinux docker-engine
sudo $PKG_MGR --assumeyes install lvm2 device-mapper device-mapper-persistent-data device-mapper-event device-mapper-libs device-mapper-event-libs
sudo $PKG_MGR --assumeyes install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-3.el7.noarch.rpm
sudo $PKG_MGR --assumeyes install containerd.io
elif [ -f /etc/debian_version ] || command -v apt-get > /dev/null 2>&1; then
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

RedHat install path downloads a container-selinux RPM from a CentOS 7 x86_64 URL. This will fail (and possibly install an incompatible package) on aarch64/arm64, even though the script advertises arm support. Consider selecting the correct arch/repo or using distro-provided packages/repos instead of a hard-coded x86_64 RPM URL.

Copilot uses AI. Check for mistakes.
Comment on lines +70 to +71
build_name="${5}-${ARCH_SUFFIX}.iso"
[ -z "${build_name}" ] && build_name="setup-${RELEASE}-${ARCH_SUFFIX}.iso"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The fallback default for build_name is effectively dead code: build_name is always non-empty because it appends "-${ARCH_SUFFIX}.iso" even when BUILD_NAME is empty. If you want a default name, check whether parameter $5 is empty (or validate it explicitly) before constructing build_name.

Suggested change
build_name="${5}-${ARCH_SUFFIX}.iso"
[ -z "${build_name}" ] && build_name="setup-${RELEASE}-${ARCH_SUFFIX}.iso"
if [ -z "${5}" ]; then
build_name="setup-${RELEASE}-${ARCH_SUFFIX}.iso"
else
build_name="${5}-${ARCH_SUFFIX}.iso"
fi

Copilot uses AI. Check for mistakes.
Comment on lines +77 to +80
cni_status_code=$(curl -sS -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-${ARCH}.tgz")
if [[ ${cni_status_code} -eq 404 ]]; then
curl -sS -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-${ARCH}-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-${ARCH}.tgz"
fi
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

CNI download only special-cases the first URL returning 404; if the fallback URL also returns a non-200 status (or the first call returns 500/403), the script will continue with an invalid/corrupt tarball. Consider using curl -f (or checking for 200) on both attempts and exiting with a clear error if neither URL succeeds.

Suggested change
cni_status_code=$(curl -sS -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-${ARCH}.tgz")
if [[ ${cni_status_code} -eq 404 ]]; then
curl -sS -L --write-out "%{http_code}\n" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-${ARCH}-${CNI_VERSION}.tgz" -o "${cni_dir}/cni-plugins-${ARCH}.tgz"
fi
cni_status_code=$(curl -sS -L --write-out "%{http_code}" -o "${cni_dir}/cni-plugins-${ARCH}.tgz" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz")
if [[ "${cni_status_code}" -eq 404 ]]; then
cni_status_code=$(curl -sS -L --write-out "%{http_code}" -o "${cni_dir}/cni-plugins-${ARCH}.tgz" "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-${ARCH}-${CNI_VERSION}.tgz")
fi
if [[ "${cni_status_code}" -ne 200 ]]; then
echo "ERROR: Failed to download CNI plugins (HTTP status: ${cni_status_code}) from both primary and fallback URLs."
exit 1
fi

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +69
iso_dir="/tmp/iso"
working_dir="${iso_dir}/"
mkdir -p "${working_dir}"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

Using a fixed working directory under /tmp ("/tmp/iso") can collide between concurrent runs and leaves no cleanup on failure. Prefer creating a unique temp dir (e.g., via mktemp -d) and registering a trap to remove it on exit/error, rather than relying on a final rm -rf that won't run if the script exits early.

Suggested change
iso_dir="/tmp/iso"
working_dir="${iso_dir}/"
mkdir -p "${working_dir}"
iso_dir="$(mktemp -d /tmp/iso.XXXXXX)"
trap 'rm -rf "${iso_dir}"' EXIT
working_dir="${iso_dir}/"

Copilot uses AI. Check for mistakes.
DASHBOARD_VERSION="2.7.0"
echo "Downloading Kubernetes Dashboard v${DASHBOARD_VERSION}..."
dashboard_conf_file="${working_dir}/dashboard.yaml"
curl -sSl "https://raw.githubusercontent.com/kubernetes/dashboard/v${DASHBOARD_VERSION}/aio/deploy/recommended.yaml" -o ${dashboard_conf_file}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This curl invocation uses -sSl (lowercase -l) rather than -sSL (uppercase -L). -l is an FTP-specific flag and does not enable redirect following; if the URL ever redirects, this download will fail. Use -L here for consistency with the other downloads in this script.

Suggested change
curl -sSl "https://raw.githubusercontent.com/kubernetes/dashboard/v${DASHBOARD_VERSION}/aio/deploy/recommended.yaml" -o ${dashboard_conf_file}
curl -sSL "https://raw.githubusercontent.com/kubernetes/dashboard/v${DASHBOARD_VERSION}/aio/deploy/recommended.yaml" -o ${dashboard_conf_file}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Cilium in CKS

4 participants