diff --git a/cicd/k8s-flannel-incluster-multus/node_scripts/common.sh b/cicd/k8s-flannel-incluster-multus/node_scripts/common.sh index c01ad688f..ded6b8b5d 100755 --- a/cicd/k8s-flannel-incluster-multus/node_scripts/common.sh +++ b/cicd/k8s-flannel-incluster-multus/node_scripts/common.sh @@ -15,6 +15,7 @@ cat </dev/null; echo "@reboot /sbin/swapoff -a") | crontab - || true sudo apt-get update -y -# Install CRI-O Runtime -VERSION="$(echo ${KUBERNETES_VERSION} | grep -oE '[0-9]+\.[0-9]+')" -CRIO_VERSION=1.27 -# Create the .conf file to load the modules at bootup -cat <> /etc/default/crio << EOF -${ENVIRONMENT} -EOF -sudo systemctl daemon-reload -sudo systemctl enable crio --now - -echo "CRI runtime installed successfully" - -sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg -curl -fsSL https://pkgs.k8s.io/core:/stable:/v$VERSION/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg +curl -fsSL https://pkgs.k8s.io/core:/stable:/v$VERSION/deb/Release.key | sudo gpg --no-tty --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:/v'$VERSION'/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update -y diff --git a/cicd/k8s-flannel-incluster-multus/node_scripts/master.sh b/cicd/k8s-flannel-incluster-multus/node_scripts/master.sh index 43d431e53..c971e90a3 100755 --- a/cicd/k8s-flannel-incluster-multus/node_scripts/master.sh +++ b/cicd/k8s-flannel-incluster-multus/node_scripts/master.sh @@ -6,12 +6,6 @@ set -euxo pipefail NODENAME=$(hostname -s) -sudo sed -i 's#10.85.0.0/16#10.244.0.0/24#g' /etc/cni/net.d/100-crio-bridge.conflist - -sudo kubeadm config images pull - -echo "Preflight Check Passed: Downloaded All Required Images" - #sudo kubeadm init --apiserver-advertise-address=$CONTROL_IP --apiserver-cert-extra-sans=$CONTROL_IP --pod-network-cidr=$POD_CIDR --service-cidr=$SERVICE_CIDR --node-name "$NODENAME" --ignore-preflight-errors Swap sudo kubeadm init --ignore-preflight-errors Swap --config /vagrant/yaml/kubeadm-config.yaml @@ -35,7 +29,9 @@ cp -i /etc/kubernetes/admin.conf $config_path/config touch $config_path/join.sh chmod +x $config_path/join.sh -kubeadm token create --print-join-command > $config_path/join.sh +join_cmd=`kubeadm token create --print-join-command` +echo $join_cmd "--cri-socket /var/run/cri-dockerd.sock" > $config_path/join.sh + sudo -i -u vagrant bash << EOF whoami diff --git a/cicd/k8s-flannel-incluster-multus/node_scripts/worker.sh b/cicd/k8s-flannel-incluster-multus/node_scripts/worker.sh index 0fd5eaee9..08d1ebd35 100755 --- a/cicd/k8s-flannel-incluster-multus/node_scripts/worker.sh +++ b/cicd/k8s-flannel-incluster-multus/node_scripts/worker.sh @@ -4,11 +4,11 @@ set -euxo pipefail -if [[ $(hostname -s) == "worker1" ]]; then - sudo sed -i 's#10.85.0.0/16#10.244.1.0/24#g' /etc/cni/net.d/100-crio-bridge.conflist -else - sudo sed -i 's#10.85.0.0/16#10.244.2.0/24#g' /etc/cni/net.d/100-crio-bridge.conflist -fi +#if [[ $(hostname -s) == "worker1" ]]; then +# sudo sed -i 's#10.85.0.0/16#10.244.1.0/24#g' /etc/cni/net.d/100-crio-bridge.conflist +#else +# sudo sed -i 's#10.85.0.0/16#10.244.2.0/24#g' /etc/cni/net.d/100-crio-bridge.conflist +#fi config_path="/vagrant/configs" diff --git a/cicd/k8s-flannel-incluster-multus/yaml/kubeadm-config.yaml b/cicd/k8s-flannel-incluster-multus/yaml/kubeadm-config.yaml index e8de10b86..fccd933c0 100644 --- a/cicd/k8s-flannel-incluster-multus/yaml/kubeadm-config.yaml +++ b/cicd/k8s-flannel-incluster-multus/yaml/kubeadm-config.yaml @@ -16,6 +16,7 @@ nodeRegistration: taints: null kubeletExtraArgs: node-ip: 192.168.80.250 + criSocket: unix:///var/run/cri-dockerd.sock --- apiVersion: kubeadm.k8s.io/v1beta3 certificatesDir: /etc/kubernetes/pki @@ -68,3 +69,7 @@ metricsBindAddress: 127.0.0.1:10249 nodePortAddresses: null oomScoreAdj: -999 portRange: "" +--- +kind: KubeletConfiguration +apiVersion: kubelet.config.k8s.io/v1beta1 +cgroupDriver: systemd