Skip to content

Forked version of VPC network tester. Deploy VPC Network Tester to App Engine or Cloud Run to investigate the traffic flow. This app demonstrates how to package network tools as a serverless service.

License

Notifications You must be signed in to change notification settings

willypalacin/vpc-network-tester

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless diagnostic tools

Forked version from GoogleCloudPlatform/vpc-network-tester

This repository contains a Google Cloud Run service that is deployable in a customer's project to diagnose and debug the configuration of serverless networking for the serverless services including the VPC Access connectors and Direct VPC Egress feature in the customer's project.

To deploy full scenario using Serverless Access Connector or VPC Direct Egress using Cloud Run, please refer to the following repo

Installation

Make sure you have a shell environment with gcloud and git

  1. Authorize to use the Google Cloud SDK
gcloud auth login
  1. Variable definition
export PROJECT_ID=<PROJECT_ID>
export REGION=<REGION>
export VPC_NAME=<VPC_NAME>
export SUBNET=<SUBNET_NAME>
  1. Clone this repo
git clone https://github.com/willypalacin/vpc-network-tester
  1. Create a container image repository
gcloud artifacts repositories create cloud-run-lab \
--repository-format=docker \
--location=$REGION --description="Docker repo for cloud run serverless"
  1. Build the image and push it to container registry
cd cloudrun
gcloud builds submit -t $REGION-docker.pkg.dev/$PROJECT_ID/cloud-run-lab/network-tester . 
  1. Deploy to Cloud Run (using direct VPC egress feature)
gcloud beta run deploy direct-vpc-egress-service \
  --image="${REGION}-docker.pkg.dev/${PROJECT_ID}/cloud-run-lab/network-tester" \
  --network=$VPC_NAME \
  --subnet="$SUBNET" \
  --network-tags=service-direct-egress \
  --region=$REGION \
  --vpc-egress=private-ranges-only \
  --allow-unauthenticated

Usage

This application presents a simple HTML UI on it's '/' path. Point a browser at this Cloud Run reported from either gcloud run deploy or command above to interact with the user interface. This currently presents the ability to diagnose HTTP(s) GET an arbitrary URL, ICMP ping an arbitrary host or IP address, or run iperf3 client against an arbirary host.

In order to use iperf3, you must have an iperf3 server running on the host specified.

Example of metrics using PING

For this particular case we have the Cloud Run service deployed and a GCE instance with a private IP of 10.128.0.12

UI Ping UI

As shown in the image, we can verify the output of a ping from the interface as well as the bar chart showing the ms it took in each one of the attempts.

About

Forked version of VPC network tester. Deploy VPC Network Tester to App Engine or Cloud Run to investigate the traffic flow. This app demonstrates how to package network tools as a serverless service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 92.9%
  • Dockerfile 7.1%