Skip to content

Commit

Permalink
cicd:k3s-multi-master scenario with flannel updated
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed May 14, 2024
1 parent 42d90f3 commit c9b775e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions cicd/k3s-multi-master-service-proxy/kube-loxilb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ spec:
- --externalCIDR=192.168.80.200/32
#- --setBGP=64512
- --setRoles=0.0.0.0
- --excludeRoleList=192.168.80.101,192.168.80.102
#- --monitor
#- --setBGP
#- --setLBMode=1
Expand Down
2 changes: 1 addition & 1 deletion cicd/k3s-multi-master-service-proxy/master1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo su
ip addr add 192.168.80.80/32 dev lo
apt-get update && apt-get install ipvsadm ipset -y
export MASTER_IP=$(ip a |grep global | grep -v '10.0.2.15' | grep -v '192.168.90' | grep '192.168.80' | awk '{print $2}' | cut -f1 -d '/')
curl -fL https://get.k3s.io | sh -s - server --node-ip=192.168.80.10 --disable servicelb --disable traefik --cluster-init --node-external-ip=192.168.80.80 --disable-cloud-controller --flannel-iface=eth2 --kube-proxy-arg proxy-mode=ipvs --disable-network-policy --kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
curl -fL https://get.k3s.io | sh -s - server --node-ip=192.168.80.10 --disable servicelb --disable traefik --cluster-init --disable-cloud-controller --flannel-iface=eth2 --kube-proxy-arg proxy-mode=ipvs --disable-network-policy --kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --node-name master1 --tls-san 192.168.80.80 --node-external-ip=192.168.80.10
kubectl taint nodes master1 node.cloudprovider.kubernetes.io/uninitialized:NoSchedule-
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh -
sleep 60
Expand Down
2 changes: 1 addition & 1 deletion cicd/k3s-multi-master-service-proxy/master2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sudo mkdir -p /etc/loxilb
sudo cp /vagrant/lbconfig.txt /etc/loxilb/
sudo cp /vagrant/EPconfig.txt /etc/loxilb/
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh -
curl -fL https://get.k3s.io | K3S_TOKEN=${NODE_TOKEN} sh -s - server --server https://192.168.80.10:6443 --disable traefik --disable servicelb --node-ip=192.168.80.11 --node-external-ip=192.168.80.80 --disable-cloud-controller -t ${NODE_TOKEN} --flannel-iface=eth2 --kube-proxy-arg proxy-mode=ipvs --disable-network-policy --kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
curl -fL https://get.k3s.io | K3S_TOKEN=${NODE_TOKEN} sh -s - server --server https://192.168.80.10:6443 --disable traefik --disable servicelb --node-ip=192.168.80.11 --node-external-ip=192.168.80.80 --disable-cloud-controller -t ${NODE_TOKEN} --flannel-iface=eth2 --kube-proxy-arg proxy-mode=ipvs --disable-network-policy --kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --node-name master2 --tls-san 192.168.80.80 --node-external-ip=192.168.80.11
sed -i -e "s/127.0.0.1/192.168.80.80/g" /etc/rancher/k3s/k3s.yaml
kubectl taint nodes master2 node.cloudprovider.kubernetes.io/uninitialized:NoSchedule-
/vagrant/wait_ready.sh
Expand Down
2 changes: 1 addition & 1 deletion cicd/k3s-multi-master-service-proxy/master3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sudo mkdir -p /etc/loxilb
sudo cp /vagrant/lbconfig.txt /etc/loxilb/
sudo cp /vagrant/EPconfig.txt /etc/loxilb/
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh -
curl -fL https://get.k3s.io | K3S_TOKEN=${NODE_TOKEN} sh -s - server --server https://192.168.80.10:6443 --disable traefik --disable servicelb --node-ip=192.168.80.12 --node-external-ip=192.168.80.80 --disable-cloud-controller -t ${NODE_TOKEN} --flannel-iface=eth2 --kube-proxy-arg proxy-mode=ipvs --disable-network-policy --kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
curl -fL https://get.k3s.io | K3S_TOKEN=${NODE_TOKEN} sh -s - server --server https://192.168.80.10:6443 --disable traefik --disable servicelb --node-ip=192.168.80.12 --disable-cloud-controller -t ${NODE_TOKEN} --flannel-iface=eth2 --kube-proxy-arg proxy-mode=ipvs --disable-network-policy --kube-apiserver-arg=kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname --node-name master3 --tls-san 192.168.80.80 --node-external-ip=192.168.80.12
kubectl taint nodes master2 node.cloudprovider.kubernetes.io/uninitialized:NoSchedule-
sed -i -e "s/127.0.0.1/192.168.80.80/g" /etc/rancher/k3s/k3s.yaml
sudo kubectl apply -f /vagrant/kube-loxilb.yml
Expand Down
5 changes: 4 additions & 1 deletion cicd/k3s-multi-master-service-proxy/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ apt-get update && apt-get install ipvsadm ipset -y
export WORKER_ADDR=$(ip a |grep global | grep -v '10.0.2.15' | grep '192.168.80' | awk '{print $2}' | cut -f1 -d '/')
export MASTER_ADDR=$(cat /vagrant/master-ip)
export NODE_TOKEN=$(cat /vagrant/node-token)
mkdir -p /etc/rancher/k3s/
#If you need to login to docker registry
#cp -f /vagrant/registries.yaml /etc/rancher/k3s/registries.yaml
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh -
mkdir -p /etc/rancher/k3s
cp -f /vagrant/k3s.yaml /etc/rancher/k3s/k3s.yaml
curl -sfL https://get.k3s.io | K3S_URL='https://192.168.80.80:6443' K3S_TOKEN=${NODE_TOKEN} sh -s - agent --server https://192.168.80.80:6443 --node-ip=${WORKER_ADDR} --node-external-ip=${WORKER_ADDR} -t ${NODE_TOKEN} --flannel-iface=eth1 --kube-proxy-arg proxy-mode=ipvs --disable-apiserver-lb
curl -sfL https://get.k3s.io | K3S_URL='https://192.168.80.80:6443' K3S_TOKEN=${NODE_TOKEN} sh -s - agent --server https://192.168.80.80:6443 --node-ip=${WORKER_ADDR} --node-external-ip=${WORKER_ADDR} -t ${NODE_TOKEN} --flannel-iface=eth1 --kube-proxy-arg proxy-mode=ipvs --disable-apiserver-lb --node-name worker-${WORKER_ADDR}
/vagrant/wait_ready.sh
sysctl net.core.netdev_max_backlog=10000

0 comments on commit c9b775e

Please sign in to comment.