Skip to content

Commit

Permalink
Merge pull request #127 from loxilb-io/localvip
Browse files Browse the repository at this point in the history
manifest: added loxilb yml for local-vip access for incluster mode
  • Loading branch information
TrekkieCoder authored Mar 27, 2024
2 parents c25a707 + 74fd650 commit 985d028
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions manifest/in-cluster/loxilb-localvip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
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
hostPID: 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
initContainers:
- name: mkllb-cgroup
command:
- sh
- -ec
- |
ls /usr/local/sbin/mkllb_cgroup && chmod 777 /usr/local/sbin/mkllb_cgroup;
cp -f /usr/local/sbin/mkllb_cgroup /hbin/mkllb_cgroup;
nsenter --cgroup=/hproc/1/ns/cgroup --mount=/hproc/1/ns/mnt /bin/mkllb_cgroup;
echo done;
rm /hbin/mkllb_cgroup;
image: "ghcr.io/loxilb-io/loxilb:latest"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: hproc
mountPath: /hproc
- name: hbin
mountPath: /hbin
terminationMessagePolicy: FallbackToLogsOnError
securityContext:
privileged: true
capabilities:
add:
- SYS_ADMIN
containers:
- name: loxilb-app
image: "ghcr.io/loxilb-io/loxilb:latest"
imagePullPolicy: IfNotPresent
command: [ "/root/loxilb-io/loxilb/loxilb", "--egr-hooks", "--blacklist=cni[0-9a-z]|veth.|flannel.|cali.|tunl.|vxlan[.]calico", "--localvip" ]
ports:
- containerPort: 11111
- containerPort: 179
- containerPort: 50051
volumeMounts:
- name: llb-cgroup
mountPath: /opt/loxilb/cgroup
securityContext:
privileged: true
runAsUser: 0
capabilities:
add:
- SYS_ADMIN
volumes:
- name: hproc
hostPath:
path: /proc
type: Directory
- name: hbin
hostPath:
path: /bin
type: Directory
- name: llb-cgroup
hostPath:
path: /opt/loxilb/cgroup
type: DirectoryOrCreate
---
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
- name: loxilb-app-bgp
port: 179
targetPort: 179
protocol: TCP
- name: loxilb-app-gobgp
port: 50051
targetPort: 50051
protocol: TCP

0 comments on commit 985d028

Please sign in to comment.