Docker OpenConnect image which can be used in Bitbucket Pipelines for creating a VPN tunnel to your on premise servers. This allows for communication with your on premise deployment environment such as Kubernetes.
The example below shows you on how to use this image to connect to a VPN and setup a port proxy through the script tunnel of the VPN.
pipelines:
branches:
master:
- step:
name: deploy
image: yoep/openconnect
script:
# connect to vpn
- vpn-open -u ${VPN_USER} -p ${VPN_PASSWORD} -s ${SERVER} -P ${SERVER_PORT} ${VPN_HOST}
# execute request over VPN
- curl https://localhost:61000/apps/v1beta1/namespaces/
# close vpn
- vpn-close
The example below show you on how to user this image to connect to a VPN and setup a SOCKS5 proxy through the script tunnel of the VPN.
pipelines:
branches:
master:
- step:
name: deploy
image: yoep/openconnect
script:
# connect to vpn
- vpn-open -u ${VPN_USER} -p ${VPN_PASSWORD} -5 ${VPN_HOST}
# execute request over VPN
- curl --socks5 localhost:61000 https://${SERVER}:8080/apps/v1beta1/namespaces/
# close vpn
- vpn-close
Open a VPN connection to the given host gateway url.
Usage: vpn-open [options...] <url>
-u The VPN username
-p The VPN password
-s The server hostname or IP to open a proxy tunnel to
-P The server port to connect & create a proxy tunnel to
-L The local proxy port (default: 61000)
-5 Use a SOCKS5 proxy instead of a proxy port tunnel
Close the current VPN connection.
Usage: vpn-close
-L The local proxy port (default: 61000)