kubeovn / kube-ovn

A Bridge between SDN and Cloud Native (Project under CNCF)
https://kubeovn.github.io/docs/stable/en/
Apache License 2.0
2k stars 451 forks source link

VPN gw in kube-ovn #2561

Closed bobz965 closed 1 year ago

bobz965 commented 1 year ago

Feature request

trying to implement vpn gw in kube-ovn

Use case

vpn gw including:

I'm trying to make it happen, any suggestion will be appreciated!!!

bobz965 commented 1 year ago

ssl vpn gw

03-ssl-vpn-gw.md

文档中有一个vpn客户端 via 服务端访问223.5.5.5 的抓包图缺失,补充: vpc-client-ping-external-ip-via-vpc-server

2. k8s run SSL VPN server

[基于 helm 部署 openvpn server](https://artifacthub.io/packages/helm/cloudposse/openvpn)

[个人测试 helm 部署 openvpn server](https://github.com/bobz965/charts/tree/openvpn),该个人项目参考[该博客](https://levelup.gitconnected.com/setup-openvpn-access-server-on-kubernetes-bdc35ca6b6c5)修改了部分安全相关配置

部署结果:

3. kube-ovn run SSL VPN server

我们这边打算在nat-gw中引入一个openvpn server 容器,类似nat-gw 容器。设计如下:

  1. 引入一个 ssl-vpn-gw crd用于维护openvpn server 进程的启动与关闭
  2. helm configmap中的脚本可以直接放到openvpn镜像中,配置可以维护为jinja2模板,脚本,配置依赖的参数变量从ssl-vpn-gw-crd中获取
  3. 基于k8s Secret 维护 server.key, ca.crt, server.crt, dh.pem, 为了方便维护 server.key, ca.crt, server.crt, 会考虑基于cert-manager certificates来维护
  4. 客户端的openvpn配置可以基于exec nat-gw pod openvpn 执行命令来获取
  5. 绑定fip支持公网使用,这里暂不考虑直接将net1的eip直接绑定给eth0的ip。这个操作在fip的crd设计上做不到。
bobz965 commented 1 year ago

about HA

ipsec HA https://satishdotpatel.github.io/ha-strongswan-ipsec-vpn/

bobz965 commented 1 year ago

最佳实现方式,基于Operator sdk,不再直接基于kube-ovn 源码中实现,逻辑上属于间接关联,和ovn 层面没有直接关系。