Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
ci: add k8s uninstallation to metrics tests
Browse files Browse the repository at this point in the history
IPerf bench runs on top of a K8s setup, for instance ci metrics
needs to clean the k8s setup, before start the test.

Fixes: #4205

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
  • Loading branch information
dborquez committed Nov 22, 2021
1 parent 9e01a00 commit 8933e42
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -357,24 +357,24 @@ gen_clean_arch() {
delete_containerd_cri_stale_resource
fi

if [[ $CI_JOB != "METRICS" ]]; then
#reset k8s service may impact metrics test on x86_64, so limit it to arm64
[ $(uname -m) == "aarch64" -a "$(pgrep kubelet)" != "" ] && sudo sh -c 'kubeadm reset -f'
info "Remove installed kubernetes packages and configuration"
if [ "$ID" == ubuntu ]; then
sudo rm -rf /etc/systemd/system/kubelet.service.d
sudo apt-get autoremove -y kubeadm kubelet kubectl \
$(dpkg -l | awk '{print $2}' | grep -E '^(containerd(.\io)?|docker(\.io|-ce(-cli)?))$')
fi
# Remove existing k8s related configurations and binaries.
sudo sh -c 'rm -rf /opt/cni/bin/*'
sudo sh -c 'rm -rf /etc/cni /etc/kubernetes/'
sudo sh -c 'rm -rf /var/lib/cni /var/lib/etcd /var/lib/kubelet'
sudo sh -c 'rm -rf /run/flannel'

info "Clean up stale network interface"
cleanup_network_interface

#reset k8s service may impact metrics test on x86_64, so limit it to arm64
[ $(uname -m) == "aarch64" -a "$(pgrep kubelet)" != "" ] && sudo sh -c 'kubeadm reset -f'
info "Remove installed kubernetes packages and configuration"
if [ "$ID" == ubuntu ]; then
sudo rm -rf /etc/systemd/system/kubelet.service.d
sudo apt-get autoremove -y kubeadm kubelet kubectl \
$(dpkg -l | awk '{print $2}' | grep -E '^(containerd(.\io)?|docker(\.io|-ce(-cli)?))$')
fi
# Remove existing k8s related configurations and binaries.
sudo sh -c 'rm -rf /opt/cni/bin/*'
sudo sh -c 'rm -rf /etc/cni /etc/kubernetes/'
sudo sh -c 'rm -rf /var/lib/cni /var/lib/etcd /var/lib/kubelet'
sudo sh -c 'rm -rf /run/flannel'

info "Clean up stale network interface"
cleanup_network_interface


if [[ $CI_JOB != "METRICS" ]]; then
info "Remove Kata package repo registrations"
Expand Down

0 comments on commit 8933e42

Please sign in to comment.