Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create package bundle for ubuntu 22.04 #1250

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/aws-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
buildConfig: "basic"
- os: "ubuntu 22.04"
buildConfig: "nvidia"
- os: "ubuntu 22.04"
buildConfig: "offline"
# Rocky 9.1
- os: "rocky 9.1"
buildConfig: "basic"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/vsphere-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
buildConfig: "basic"
- os: "ubuntu 22.04"
buildConfig: "basic"
- os: "ubuntu 22.04"
buildConfig: "offline"
- os: "rocky 9.1"
buildConfig: "offline"
- os: "oracle 9.4"
Expand Down
35 changes: 35 additions & 0 deletions bundles/ubuntu22.04/bundle.sh.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https software-properties-common dpkg-dev curl gpg

KUBERNETES_DEB_BUILD_VERSION="1.1"
CRI_TOOLS_DEB_BUILD_VERSION="1.1"

# Install dependencies.
mkdir -p /etc/apt/keyrings
curl -fsSL "https://pkgs.k8s.io/core:/stable:/{{ .KubernetesMajorMinorVersion }}/deb/Release.key" | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/{{ .KubernetesMajorMinorVersion }}/deb/ /" | tee /etc/apt/sources.list.d/kubernetes.list
apt-get update
#shellcheck disable=SC2046
apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends $(< packages.txt) | grep "^\w" > /tmp/packages

# The list returned by apt-cache depends does not contain the versions
# Append the bare Kubernetes packages with the provided versions
sed -i 's/kubelet/kubelet='"{{ .KubernetesVersion }}-${KUBERNETES_DEB_BUILD_VERSION}"'/' /tmp/packages
sed -i 's/kubectl/kubectl='"{{ .KubernetesVersion }}-${KUBERNETES_DEB_BUILD_VERSION}"'/' /tmp/packages
sed -i 's/kubeadm/kubeadm='"{{ .KubernetesVersion }}-${KUBERNETES_DEB_BUILD_VERSION}"'/' /tmp/packages
sed -i 's/cri-tools/cri-tools='"{{ .CRIToolsVersion }}-${CRI_TOOLS_DEB_BUILD_VERSION}"'/' /tmp/packages

TMP_DIR="$(mktemp -d repodata-XXXX)"
pushd "${TMP_DIR}"
#shellcheck disable=SC2046
apt-get download $(< /tmp/packages)
dpkg-scanpackages -m . | gzip > Packages.gz
#shellcheck disable=SC1083,SC2035
tar -czf {{ .OutputDirectory }}/{{ .KubernetesVersion }}_ubuntu_22.04_x86_64.tar.gz *
#shellcheck disable=SC1083
chmod 777 {{ .OutputDirectory }}/{{ .KubernetesVersion }}_ubuntu_22.04_x86_64.tar.gz
popd
rm -rf "${TMP_DIR}"
19 changes: 19 additions & 0 deletions bundles/ubuntu22.04/packages.txt.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apt-transport-https
chrony
nfs-common
python3-cryptography
python3-pip
libseccomp2
kubectl={{ .KubernetesVersion }}-1.1
kubelet={{ .KubernetesVersion }}-1.1
kubeadm={{ .KubernetesVersion }}-1.1
cloud-init
cloud-guest-utils
cloud-initramfs-copymods
cloud-initramfs-dyn-netconf
open-iscsi
lvm2
xfsprogs
ipvsadm
lsscsi
sysstat
6 changes: 5 additions & 1 deletion cmd/konvoy-image-wrapper/cmd/create-package-bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ var osToConfig = map[string]OSConfig{
configDir: "bundles/ubuntu20.04",
containerImage: "docker.io/library/ubuntu:20.04",
},
"ubuntu-22.04": {
configDir: "bundles/ubuntu22.04",
containerImage: "docker.io/library/ubuntu:22.04",
},
"oracle-9.4": {
configDir: "bundles/oracle9.4",
containerImage: "docker.io/library/oraclelinux:9",
Expand Down Expand Up @@ -296,7 +300,7 @@ func templateObjects(targetOS, kubernetesVersion, outputDir string, fips, fetchK
}
var criToolsVersion string
var kubernetesMajorMinorVersion string
if targetOS == "ubuntu-20.04" {
if strings.Contains(targetOS, "ubuntu") {
kubernetesMajorMinorVersionNoV := strings.Join(strings.Split(kubernetesVersion, ".")[0:2], ".")
// according to ansible.group_vars/all/defaults.yaml L18 this is k8s major minor.1
criToolsVersion = fmt.Sprintf("%s.1", kubernetesMajorMinorVersionNoV)
Expand Down
Loading