Skip to content

Commit

Permalink
cicd for in-cluster mode updated
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Jul 29, 2023
1 parent 5711621 commit 9be3768
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
22 changes: 10 additions & 12 deletions cicd/k3s-flannel-incluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# vi: set ft=ruby :

workers = (ENV['WORKERS'] || "2").to_i
#box_name = (ENV['VAGRANT_BOX'] || "ubuntu/focal64")
box_name = (ENV['VAGRANT_BOX'] || "sysnet4admin/Ubuntu-k8s")
box_version = "0.7.1"
Vagrant.configure("2") do |config|
Expand All @@ -13,17 +12,16 @@ Vagrant.configure("2") do |config|
config.vbguest.auto_update = false
end

#config.vm.define "loxilb" do |loxilb|
# loxilb.vm.hostname = 'llb1'
#loxilb.vm.network "forwarded_port", guest: 55002, host: 5502, protocol: "tcp"
# loxilb.vm.network :private_network, ip: "192.168.80.9", :netmask => "255.255.255.0"
# loxilb.vm.network :private_network, ip: "192.168.90.9", :netmask => "255.255.255.0"
# loxilb.vm.provision :shell, :path => "loxilb.sh"
# loxilb.vm.provider :virtualbox do |vbox|
# vbox.customize ["modifyvm", :id, "--memory", 6000]
# vbox.customize ["modifyvm", :id, "--cpus", 4]
# end
#end
config.vm.define "host" do |host|
host.vm.hostname = 'host1'
host.vm.network :private_network, ip: "192.168.80.9", :netmask => "255.255.255.0"
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.customize ["modifyvm", :id, "--memory", 2048]
vbox.customize ["modifyvm", :id, "--cpus", 1]
end
end

config.vm.define "master1" do |master|
master.vm.hostname = 'master1'
Expand Down
2 changes: 2 additions & 0 deletions cicd/k3s-flannel-incluster/host.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sudo ip route add 123.123.123.0/24 via 192.168.90.10
echo "Host is up"
2 changes: 1 addition & 1 deletion cicd/k3s-flannel-incluster/loxilb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
containers:
- name: loxilb-app
image: "ghcr.io/loxilb-io/loxilb:latest"
command: [ "/root/loxilb-io/loxilb/loxilb", "--bgp", "--egr-hooks" ]
command: [ "/root/loxilb-io/loxilb/loxilb", "--bgp", "--egr-hooks", "--blacklist=cni[0-9a-z]|veth.|flannel." ]
ports:
- containerPort: 11111
- containerPort: 179
Expand Down
4 changes: 2 additions & 2 deletions cicd/k3s-flannel-incluster/master1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ echo $MASTER_IP > /vagrant/master-ip
cp /var/lib/rancher/k3s/server/node-token /vagrant/node-token
sed -i -e "s/127.0.0.1/${MASTER_IP}/g" /etc/rancher/k3s/k3s.yaml
cp /etc/rancher/k3s/k3s.yaml /vagrant/k3s.yaml
#sudo kubectl apply -f /vagrant/loxilb.yml
#sudo kubectl apply -f /vagrant/kube-loxilb.yml
sudo kubectl apply -f /vagrant/loxilb.yml
sudo kubectl apply -f /vagrant/kube-loxilb.yml
/vagrant/wait_ready.sh
1 change: 1 addition & 0 deletions cicd/k3s-flannel-incluster/rmconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ vagrant destroy -f worker1
vagrant destroy -f worker2
vagrant destroy -f master1
vagrant destroy -f master2
vagrant destroy -f host
1 change: 1 addition & 0 deletions cicd/k3s-flannel-incluster/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export NODE_TOKEN=$(cat /vagrant/node-token)
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.10:6443 --node-ip=${WORKER_ADDR} --node-external-ip=${WORKER_ADDR} -t ${NODE_TOKEN}
sudo kubectl apply -f /vagrant/loxilb-peer.yml
sudo kubectl apply -f /vagrant/nginx.yml
sudo kubectl apply -f /vagrant/udp.yml
sudo kubectl apply -f /vagrant/sctp.yml
Expand Down

0 comments on commit 9be3768

Please sign in to comment.