Skip to content

Commit

Permalink
Merge pull request #567 from nik-netlox/main
Browse files Browse the repository at this point in the history
Updated k8s calico CICD to k8s v1.29.2
  • Loading branch information
UltraInstinct14 authored Mar 4, 2024
2 parents c7f2734 + 2538c74 commit 55b8efc
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
25 changes: 25 additions & 0 deletions cicd/k8s-calico/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,28 @@ vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/sctp_onearm.yml' 2> /dev/n
vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/tcp_fullnat.yml' 2> /dev/null
vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/udp_fullnat.yml' 2> /dev/null
vagrant ssh master -c 'kubectl apply -f /vagrant/yaml/sctp_fullnat.yml' 2> /dev/null

for((i=1; i<=60; i++))
do
fin=1
pods=$(vagrant ssh master -c 'kubectl get pods -A' 2> /dev/null | grep -v "NAMESPACE")

while IFS= read -a pods; do
read -a pod <<< "$pods"
if [[ ${pod[3]} != *"Running"* ]]; then
echo "${pod[1]} is not UP yet"
fin=0
fi
done <<< "$pods"
if [ $fin == 1 ];
then
echo "Cluster is ready"
break;
fi
echo "Will try after 10s"
sleep 10
done

if [[ $fin == 0 ]]; then
exit 1
fi
16 changes: 8 additions & 8 deletions cicd/k8s-calico/node_scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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 <<EOF | sudo tee /etc/modules-load.d/crio.conf
overlay
Expand All @@ -48,11 +48,11 @@ sudo sysctl --system
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/ /
EOF
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list
deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/ /
cat <<EOF | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$CRIO_VERSION.list
deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$CRIO_VERSION/$OS/ /
EOF

curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$VERSION/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/$CRIO_VERSION/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -
curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$OS/Release.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/libcontainers.gpg add -

sudo apt-get update
Expand All @@ -67,12 +67,12 @@ 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
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg
sudo apt-get install -y apt-transport-https ca-certificates curl gpg
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --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:/v1.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list

echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update -y
sudo apt-get install -y kubelet="$KUBERNETES_VERSION" kubectl="$KUBERNETES_VERSION" kubeadm="$KUBERNETES_VERSION"
sudo apt-get install -y kubelet kubectl kubeadm
sudo apt-get update -y
sudo apt-get install -y jq

Expand Down
Empty file modified cicd/k8s-calico/node_scripts/master.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion cicd/k8s-calico/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ do
done

## Any routing updates ??
sleep 30
#sleep 30

echo Service IP : $extIP
echo -e "\nEnd Points List"
Expand Down
3 changes: 2 additions & 1 deletion cicd/k8s-calico/yaml/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ software:
version: 0.7.1
cluster:
box: bento/ubuntu-22.04
version: 202401.31.0
calico: 3.26.0
# To skip the dashboard installation, set its version to an empty value or comment it out:
kubernetes: 1.27.1-00
kubernetes: 1.29.2
os: xUbuntu_22.04
4 changes: 3 additions & 1 deletion proto/bfd.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ type Notifer interface {

type bfdSession struct {
RemoteName string
SourceIP string
Instance string
Cxn net.Conn
State SessionState
Expand Down Expand Up @@ -425,7 +426,8 @@ func (b *bfdSession) initialize(remoteIP string, sourceIP string, port uint16, i
if myIP == nil {
return errors.New("source address malformed")
}

b.SourceIP = sourceIP

if myIP.IsUnspecified() {
myIP = getMyDisc(ip)
if myIP == nil {
Expand Down

0 comments on commit 55b8efc

Please sign in to comment.