2022-03-08 09:36:02 -08:00
# Networking Dashboard
This repository provides an end-to-end solution to gather some GCP Networking quotas and limits (that cannot be seen in the GCP console today) and display them in a dashboard.
The goal is to allow for better visibility of these limits, facilitating capacity planning and avoiding hitting these limits.
2022-09-30 01:51:16 -07:00
Here is an example of dashboard you can get with this solution:
2022-03-18 02:43:16 -07:00
< img src = "metric.png" width = "640px" >
2022-03-18 02:45:54 -07:00
Here you see utilization (usage compared to the limit) for a specific metric (number of instances per VPC) for multiple VPCs and projects.
2022-03-18 02:46:30 -07:00
2022-10-04 01:11:09 -07:00
Three metric descriptors are created for each monitored resource: usage, limit and utilization. You can follow each of these and create alerting policies if a threshold is reached.
2022-03-18 02:45:54 -07:00
2022-03-08 09:36:02 -08:00
## Usage
Clone this repository, then go through the following steps to create resources:
- Create a terraform.tfvars file with the following content:
2022-09-30 01:51:16 -07:00
- organization_id = "< YOUR-ORG-ID > "
- billing_account = "< YOUR-BILLING-ACCOUNT > "
2022-03-08 09:36:02 -08:00
- monitoring_project_id = "project-0" # Monitoring project where the dashboard will be created and the solution deployed
- monitored_projects_list = ["project-1", "project2"] # Projects to be monitored by the solution
2022-09-30 01:51:16 -07:00
- monitored_folders_list = ["folder_id"] # Folders to be monitored by the solution
2022-03-08 09:36:02 -08:00
- `terraform init`
- `terraform apply`
Once the resources are deployed, go to the following page to see the dashboard: https://console.cloud.google.com/monitoring/dashboards?project=< YOUR-MONITORING-PROJECT > .
A dashboard called "quotas-utilization" should be created.
2022-03-18 02:43:16 -07:00
The Cloud Function runs every 5 minutes by default so you should start getting some data points after a few minutes.
2022-03-08 09:36:02 -08:00
You can change this frequency by modifying the "schedule_cron" variable in variables.tf.
Once done testing, you can clean up resources by running `terraform destroy` .
## Supported limits and quotas
The Cloud Function currently tracks usage, limit and utilization of:
- active VPC peerings per VPC
- VPC peerings per VPC
- instances per VPC
- instances per VPC peering group
- Subnet IP ranges per VPC peering group
- internal forwarding rules for internal L4 load balancers per VPC
- internal forwarding rules for internal L7 load balancers per VPC
- internal forwarding rules for internal L4 load balancers per VPC peering group
- internal forwarding rules for internal L7 load balancers per VPC peering group
2022-03-30 08:03:31 -07:00
- Dynamic routes per VPC
2022-04-12 00:58:12 -07:00
- Dynamic routes per VPC peering group
2022-09-30 01:51:16 -07:00
- IP utilization per subnet (% of IP addresses used in a subnet)
2022-10-04 01:11:09 -07:00
- VPC firewall rules per project (VPC drill down is available for usage)
2022-03-08 09:36:02 -08:00
2022-03-28 09:44:16 -07:00
It writes this values to custom metrics in Cloud Monitoring and creates a dashboard to visualize the current utilization of these metrics in Cloud Monitoring.
2022-03-30 08:03:31 -07:00
Note that metrics are created in the cloud-function/metrics.yaml file.
2022-09-30 01:51:16 -07:00
You can also edit default limits for a specific network in that file. See the example for `vpc_peering_per_network` .
2022-03-30 08:03:31 -07:00
2022-03-28 09:44:16 -07:00
## Next steps and ideas
In a future release, we could support:
- Static routes per VPC / per VPC peering group
- Google managed VPCs that are peered with PSA (such as Cloud SQL or Memorystore)
2022-09-30 01:51:16 -07:00
If you are interested in this and/or would like to contribute, please contact legranda@google.com.