How to connect Google Cloud Run Container to OpenVPN?

10/20/2021

We have a Java web app that is trying to access a FTP location behind a OpenVPN. The app is deployed using Google Cloud Run Containers on their infrastructure.

I managed to deploy a solution that connects to OpenVPN using Docker in my local env but it needs "privileged" rights which we are unable to provide in GCP Cloud Run env.

Can you please help with this?

Thank you!

-- zbenev
google-cloud-platform
google-cloud-run
kubernetes
openvpn
vpn

1 Answer

10/22/2021

Try setting up an SSH port forwarding Tunnel in Open VPN to the target FTP server. Also find out what addresses your FTP(SFTP) is listening to Open VPN.

Follow below steps to connect Google Cloud Run to OpenVPN 1. Navigate to GCP and access Compute Engine > Virtual Machines > VM Instances. 2. Click Create Instance. 3. Enter the VM parameters. 4. Click Create. 5. Click the Select Linux Distribution dropdown and select the distribution that you want to install the connector on. 6. Copy the commands shown for your terminal. 7. Connect to your GCP VM through SSH and paste the commands. a. Select Yes for each prompt. b. Once the installation completes, a setup token prompt displays. 8. In the OpenVPN Cloud administration portal, click Generate Token and click to copy the token. 9. Access your Linux terminal and paste the token. a. The utility imports the connector profile and connects to OpenVPN Cloud.

-- Abhijith Chitrapu
Source: StackOverflow