ovpn-admin icon indicating copy to clipboard operation
ovpn-admin copied to clipboard

K8s: OpenVPN management listening only on localhost

Open garutilorenzo opened this issue 1 year ago • 0 comments

I've tried to deploy both containers (openvpn and ovpn-admin) on K8s, but when ovpn-admin starts it cannot reach openvpn management on port 8989. So I've modified the configure.sh in this way:

openvpn --config /etc/openvpn/openvpn.conf --client-config-dir /etc/openvpn/ccd --port 1194 --proto tcp --management 0.0.0.0 8989 --dev tun0 --server ${OVPN_SRV_NET} ${OVPN_SRV_MASK}

And on the ovpn-admin deployment I've added this env variable:

- name: OVPN_MGMT
  value: "main=openvpn-svc-priv:8989"

where openvpn-svc-priv is a service:

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: openvpn
    tier: backend
  name: openvpn-svc-priv
  namespace: ovpn
spec:
  ports:
  - port: 8989
    name: openvpn-mgt
    protocol: TCP
    targetPort: 8989
  selector:
    app: openvpn
    tier: backend
  type: ClusterIP

is this right or I'm missing something? With these configs everything works fine.

garutilorenzo avatar Sep 26 '22 12:09 garutilorenzo