forked from loxilb-io/loxilb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
loxilb-iogh-87: added initial cicd for service sharding
- Loading branch information
1 parent
f0e8bf7
commit d9878cd
Showing
6 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"lbAttr":[ | ||
{ | ||
"serviceArguments":{ | ||
"externalIP":"192.168.80.80", | ||
"port":6443, | ||
"protocol":"tcp", | ||
"sel":0, | ||
"mode":2, | ||
"BGP":false, | ||
"Monitor":true, | ||
"inactiveTimeOut":240, | ||
"block":0 | ||
}, | ||
"secondaryIPs":null, | ||
"endpoints":[ | ||
{ | ||
"endpointIP":"192.168.80.10", | ||
"targetPort":6443, | ||
"weight":1, | ||
"state":"active", | ||
"counter":"" | ||
}, | ||
{ | ||
"endpointIP":"192.168.80.11", | ||
"targetPort":6443, | ||
"weight":1, | ||
"state":"active", | ||
"counter":"" | ||
}, | ||
{ | ||
"endpointIP":"192.168.80.12", | ||
"targetPort":6443, | ||
"weight":1, | ||
"state":"active", | ||
"counter":"" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: loxilb-lb | ||
namespace: kube-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: loxilb-app | ||
template: | ||
metadata: | ||
name: loxilb-lb | ||
labels: | ||
app: loxilb-app | ||
spec: | ||
hostNetwork: true | ||
dnsPolicy: ClusterFirstWithHostNet | ||
tolerations: | ||
- key: "node-role.kubernetes.io/master" | ||
operator: Exists | ||
- key: "node-role.kubernetes.io/control-plane" | ||
operator: Exists | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: "node-role.kubernetes.io/master" | ||
operator: Exists | ||
- key: "node-role.kubernetes.io/control-plane" | ||
operator: Exists | ||
volumes: | ||
- name: hllb | ||
hostPath: | ||
path: /etc/loxilb | ||
type: DirectoryOrCreate | ||
containers: | ||
- name: loxilb-app | ||
image: "ghcr.io/loxilb-io/loxilb:latest" | ||
imagePullPolicy: Always | ||
command: | ||
- /root/loxilb-io/loxilb/loxilb | ||
args: | ||
- --egr-hooks | ||
- --blacklist=cni[0-9a-z]|veth.|flannel.|cali.|tunl.|vxlan[.]calico | ||
volumeMounts: | ||
- name: hllb | ||
mountPath: /etc/loxilb | ||
ports: | ||
- containerPort: 11111 | ||
- containerPort: 179 | ||
securityContext: | ||
privileged: true | ||
capabilities: | ||
add: | ||
- SYS_ADMIN | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: loxilb-lb-service | ||
namespace: kube-system | ||
spec: | ||
clusterIP: None | ||
selector: | ||
app: loxilb-app | ||
ports: | ||
- name: loxilb-app | ||
port: 11111 | ||
targetPort: 11111 | ||
protocol: TCP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo su | ||
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 external-hostname=192.168.80.10 --node-external-ip=192.168.80.80 --disable-cloud-controller --flannel-iface=eth1 | ||
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - | ||
sleep 60 | ||
echo $MASTER_IP > /vagrant/master-ip | ||
cp /var/lib/rancher/k3s/server/node-token /vagrant/node-token | ||
cp /etc/rancher/k3s/k3s.yaml /vagrant/k3s.yaml | ||
sed -i -e "s/127.0.0.1/192.168.80.80/g" /vagrant/k3s.yaml | ||
sudo mkdir -p /etc/loxilb | ||
sudo cp /vagrant/lbconfig.txt /etc/loxilb/ | ||
sudo cp /vagrant/EPconfig.txt /etc/loxilb/ | ||
/vagrant/wait_ready.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo su | ||
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) | ||
sudo mkdir -p /etc/loxilb | ||
sudo cp /vagrant/lbconfig.txt /etc/loxilb/ | ||
sudo cp /vagrant/EPconfig.txt /etc/loxilb/ | ||
#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 external-hostname=192.168.80.11 --node-external-ip=192.168.80.11 --disable-cloud-controller -t ${NODE_TOKEN} | ||
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 external-hostname=192.168.80.11 --node-external-ip=192.168.80.80 -t ${NODE_TOKEN} --flannel-iface=eth1 | ||
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - | ||
#sudo kubectl apply -f /vagrant/loxilb.yml | ||
#sudo kubectl apply -f /vagrant/kube-loxilb.yml | ||
/vagrant/wait_ready.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sudo su | ||
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) | ||
sudo mkdir -p /etc/loxilb | ||
sudo cp /vagrant/lbconfig.txt /etc/loxilb/ | ||
sudo cp /vagrant/EPconfig.txt /etc/loxilb/ | ||
#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 external-hostname=192.168.80.11 --node-external-ip=192.168.80.11 --disable-cloud-controller -t ${NODE_TOKEN} | ||
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 external-hostname=192.168.80.12 --node-external-ip=192.168.80.80 -t ${NODE_TOKEN} --flannel-iface=eth1 | ||
curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - | ||
sudo kubectl apply -f /vagrant/loxilb.yml | ||
sudo kubectl apply -f /vagrant/kube-loxilb.yml | ||
/vagrant/wait_ready.sh |