diff --git a/cicd/k3s-multi-master-service-proxy/Vagrantfile b/cicd/k3s-multi-master-service-proxy/Vagrantfile index edd2b4f73..5e57d1619 100644 --- a/cicd/k3s-multi-master-service-proxy/Vagrantfile +++ b/cicd/k3s-multi-master-service-proxy/Vagrantfile @@ -18,8 +18,8 @@ Vagrant.configure("2") do |config| host.vm.network :private_network, ip: "192.168.90.9", :netmask => "255.255.255.0" host.vm.provision :shell, :path => "host.sh" host.vm.provider :virtualbox do |vbox| - vbox.memory = "2048" - vbox.cpus = "2" + vbox.memory = "4096" + vbox.cpus = "4" vbox.default_nic_type = "virtio" vbox.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] vbox.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] diff --git a/cicd/k3s-multi-master-service-proxy/master1.sh b/cicd/k3s-multi-master-service-proxy/master1.sh index eff8110c7..f1929464b 100755 --- a/cicd/k3s-multi-master-service-proxy/master1.sh +++ b/cicd/k3s-multi-master-service-proxy/master1.sh @@ -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 +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 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 diff --git a/cicd/k3s-multi-master-service-proxy/master2.sh b/cicd/k3s-multi-master-service-proxy/master2.sh index afd162397..33afc7727 100755 --- a/cicd/k3s-multi-master-service-proxy/master2.sh +++ b/cicd/k3s-multi-master-service-proxy/master2.sh @@ -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 +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 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 diff --git a/cicd/k3s-multi-master-service-proxy/master3.sh b/cicd/k3s-multi-master-service-proxy/master3.sh index 77bf88712..42e7ef684 100755 --- a/cicd/k3s-multi-master-service-proxy/master3.sh +++ b/cicd/k3s-multi-master-service-proxy/master3.sh @@ -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 +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 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 diff --git a/cicd/k3s-multi-master-service-proxy/worker.sh b/cicd/k3s-multi-master-service-proxy/worker.sh index 3da374b1f..ece4dad35 100644 --- a/cicd/k3s-multi-master-service-proxy/worker.sh +++ b/cicd/k3s-multi-master-service-proxy/worker.sh @@ -3,8 +3,9 @@ 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) +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_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 /vagrant/wait_ready.sh sysctl net.core.netdev_max_backlog=10000