Files
kubevpn/pkg/test/pod.yaml
2022-10-28 22:39:10 +08:00

32 lines
838 B
YAML

apiVersion: v1
kind: Pod
metadata:
name: traffic-test
labels:
app: traffic-test
spec:
terminationGracePeriodSeconds: 0
containers:
- name: traffic-test
image: naison/kubevpn:v1.1.4
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
args:
- |
sysctl net.ipv4.ip_forward=1
update-alternatives --set iptables /usr/sbin/iptables-legacy
iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -s 223.254.254.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
tail -f /dev/null
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
restartPolicy: Always