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
          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
