Due to the fact that you have already connected OpenVPN
Node to the Kubernetes cluster using ClusterIP
services, which are managed by kube-proxy, it is recommended to route network packets via iptables
. Now it's time to configure kube-proxy
for transferring all requests to internal CNI network
via OpenVPN
Node:
kube-proxy — kubeconfig=./kube-config/config.yaml — bind-address=xx.xx.xx.xx — cluster-cidr=yy.yy.yy.yy/cc — proxy-mode=iptables — masquerade-all
xx.xx.xx.xx - your OpenVPN node IP address
yy.yy.yy.0/cc - Cluster CIDR
Ensure that OpenVPN
Pod is configured to connect the Kubernetes network:
push “route yy.yy.0.0 255.255.0.0”
To create routes from your Node services to the OpenVPN
gateway, consider using Site-to-site routing via OpenVPN
explained in this Article.