Skip to content

Commit

Permalink
Allow insecure apt k8s repo for cni-plugin windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
coutinhop committed Nov 14, 2024
1 parent 4b3fea3 commit 10fce3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions process/testing/winfv/create_kubeadm_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt update -y
sudo apt remove containerd
sudo apt install containerd.io
sudo rm /etc/containerd/config.toml
Expand All @@ -46,11 +46,15 @@ curl -fsSL --retry 5 "https://pkgs.k8s.io/core:/stable:/v${KUBE_REPO_VERSION}/de
sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg
# Add the Kubernetes apt repository
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v${KUBE_REPO_VERSION}/deb/ /" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list

K8S_PKG_VERSION=${KUBE_VERSION}-1.1
sudo apt-get update && sudo apt-get install -y kubelet=${K8S_PKG_VERSION} kubeadm=${K8S_PKG_VERSION} kubectl=${K8S_PKG_VERSION}
sudo apt --allow-insecure-repositories update && sudo apt install --allow-unauthenticated -y kubelet=${K8S_PKG_VERSION} kubeadm=${K8S_PKG_VERSION} kubectl=${K8S_PKG_VERSION}
sudo swapoff -a

sudo modprobe br_netfilter
sudo sh -c 'echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables'

K8S_VERSION=stable-$(echo ${KUBE_VERSION} | cut -d. -f1,2)
sudo kubeadm init --kubernetes-version ${K8S_VERSION} --pod-network-cidr=192.168.0.0/16
mkdir -p $HOME/.kube
Expand Down

0 comments on commit 10fce3f

Please sign in to comment.