Skip to content

Commit

Permalink
Merge pull request #1108 from askervin/5Wp_e2e_deb_repo
Browse files Browse the repository at this point in the history
e2e: install k8s deb packages from pkgs.k8s.io
  • Loading branch information
marquiz authored Sep 5, 2024
2 parents 86d7596 + 0734047 commit a9c958c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
19 changes: 11 additions & 8 deletions demo/lib/distro.bash
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,20 @@ debian-install-crio-pre() {
}

debian-install-k8s() {
local k8sverparam
local _k8s=$k8s
debian-refresh-pkg-db
debian-install-pkg apt-transport-https curl
debian-install-repo-key "https://packages.cloud.google.com/apt/doc/apt-key.gpg"
debian-install-repo "deb https://apt.kubernetes.io/ kubernetes-xenial main"
if [ -n "$k8s" ]; then
k8sverparam="=${k8s}-00"
else
k8sverparam=""

if [[ -z "$k8s" ]] || [[ "$k8s" == "latest" ]]; then
vm-command "curl -s https://api.github.com/repos/kubernetes/kubernetes/releases/latest | grep tag_name | sed -e 's/.*v\([0-9]\+\.[0-9]\+\).*/\1/g'"
_k8s=$COMMAND_OUTPUT
fi
debian-install-pkg "kubeadm$k8sverparam" "kubelet$k8sverparam" "kubectl$k8sverparam"
echo "installing Kubernetes v${_k8s}"
vm-command "curl -fsSL https://pkgs.k8s.io/core:/stable:/v${_k8s}/deb/Release.key | sudo gpg --dearmor --batch --yes -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg" || \
command-error "failed to download Kubernetes v${_k8s} key"
vm-command "echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v${_k8s}/deb/ /' > /etc/apt/sources.list.d/kubernetes.list && apt update" || \
command-error "failed to add Kubernetes v${_k8s} repo"
debian-install-pkg "kubeadm" "kubelet" "kubectl"
}

debian-set-kernel-cmdline() {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ usage() {
echo " cgroups=v2 is supported only on distro=fedora"
echo " k8s: Kubernetes version to be installed on VM creation"
echo " The default is the latest available on selected distro."
echo " Example: k8s=1.18.10"
echo " Example: k8s=1.31"
echo " k8scri: The container runtime pipe where kubelet connects to."
echo " Options are:"
echo " \"cri-resmgr|containerd\" cri-resmgr is a proxy to containerd."
Expand Down Expand Up @@ -153,8 +153,8 @@ usage() {
echo ""
echo "Default test input VARs: ./run.sh help defaults"
echo ""
echo "Create VM 'foo' that runs k8s 1.20.2 on Debian Sid:"
echo "vm=foo distro=debian-sid k8s=1.20.2 ./run.sh interactive"
echo "Create VM 'foo' that runs k8s 1.28 on Debian Sid:"
echo "vm=foo distro=debian-sid k8s=1.28 ./run.sh interactive"
}

error() {
Expand Down

0 comments on commit a9c958c

Please sign in to comment.