eProxy is a lightweight and efficient replacement for kube-proxy in Kubernetes environments, leveraging eBPF (Extended Berkeley Packet Filter) technology for enhanced performance and flexibility.
git clone https://github.com/K-Huntun/eproxy.git
cd eproxy/deploy
kubectl apply -f deploy.yaml
kubectl create ns nginx kubectl apply -f svc.yaml
apiVersion: v1
kind: Service
metadata:
labels:
service.kubernetes.io/service-proxy-name: eproxy
name: nginx-bpf
namespace: nginx
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx-deploy
namespace: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
ports:
- containerPort: 80
name: nginx
kubectl exec -it <other-pod> bash
curl nginx-bpf:8080
Due to the fact that eproxy mounts the BTF file internally within the container, when eproxy is unmounted or when the container is killed for other reasons, both the eBPF program and map data of eproxy will disappear. Upon container restart, they will be reloaded again.
kubectl delete -f deploy.yaml
docker build -it --rm -v ${eproxy_home}:/root/eproxy registry.cn-hangzhou.aliyuncs.com/secrity/eproxy_build:0.0.1 bash
cd /root/eproxy
make clean all