Merge pull request #10476 from BbolroC/switch-to-kubeadm-s390x

gha: Switch KUBERNETES from k3s to kubeadm on s390x
This commit is contained in:
Hyounggyu Choi
2024-10-30 09:52:06 +01:00
committed by GitHub
2 changed files with 18 additions and 5 deletions

View File

@@ -36,7 +36,7 @@ jobs:
- qemu-runtime-rs
- qemu-coco-dev
k8s:
- k3s
- kubeadm
include:
- snapshotter: devmapper
pull-type: default
@@ -97,9 +97,6 @@ jobs:
echo "KBS_INGRESS=nodeport" >> $GITHUB_ENV
if: ${{ matrix.vmm == 'qemu-coco-dev' }}
- name: Deploy ${{ matrix.k8s }}
run: bash tests/integration/kubernetes/gha-run.sh deploy-k8s
# qemu-runtime-rs only works with overlayfs
# See: https://github.com/kata-containers/kata-containers/issues/10066
- name: Configure the ${{ matrix.snapshotter }} snapshotter

View File

@@ -80,21 +80,37 @@ EOF
containerd_config_file="/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl"
sudo cp /var/lib/rancher/k3s/agent/etc/containerd/config.toml "${containerd_config_file}"
;;
kubeadm)
containerd_config_file="/etc/containerd/config.toml"
;;
*) >&2 echo "${KUBERNETES} flavour is not supported"; exit 2 ;;
esac
# We're not using this with baremetal machines, so we're fine on cutting
# corners here and just append this to the configuration file.
cat<<EOF | sudo tee -a "${containerd_config_file}"
# Check if the "devmapper" plugin section exists in the file
if grep -q 'plugins."io.containerd.snapshotter.v1.devmapper"' "${containerd_config_file}"; then
echo "devmapper section found. Updating pool_name and base_image_size..."
sudo sed -i '/\[plugins."io.containerd.snapshotter.v1.devmapper"\]/,/\[plugins\./ {
s/pool_name = ".*"/pool_name = "contd-thin-pool"/
s/base_image_size = ".*"/base_image_size = "4096MB"/
}' "${containerd_config_file}"
else
echo "devmapper section not found. Appending to the config file..."
cat<<EOF | sudo tee -a "${containerd_config_file}"
[plugins."io.containerd.snapshotter.v1.devmapper"]
pool_name = "contd-thin-pool"
base_image_size = "4096MB"
EOF
fi
case "${KUBERNETES}" in
k3s)
sudo sed -i -e 's/snapshotter = "overlayfs"/snapshotter = "devmapper"/g' "${containerd_config_file}"
sudo systemctl restart k3s ;;
kubeadm)
sudo sed -i -e 's/snapshotter = "overlayfs"/snapshotter = "devmapper"/g' "${containerd_config_file}"
sudo systemctl restart containerd ;;
*) >&2 echo "${KUBERNETES} flavour is not supported"; exit 2 ;;
esac