Files
kubevpn/pkg/test/pod.yaml
2025-03-08 23:13:45 +08:00

33 lines
898 B
YAML

apiVersion: v1
kind: Pod
metadata:
name: test
labels:
app: test
spec:
terminationGracePeriodSeconds: 0
containers:
- name: traffic-test
image: ghcr.io/kubenetworks/kubevpn:v1.1.28
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
args:
- |
sysctl net.ipv4.ip_forward=1
sysctl net.ipv6.conf.all.forwarding=1
update-alternatives --set iptables /usr/sbin/iptables-legacy
iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
ip6tables -t nat -A POSTROUTING -s fe80::cff4:d42c:7e73:e84b/64 -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