fleet/infrastructure/dogfood/terraform/gcp
2024-01-09 16:45:22 -06:00
..
artifact_registry.tf Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
cloud_run.tf Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
loadbalancer.tf terraform/gcp: make prefix use consistent, use new database sizing, and refer to DNS zone (#8250) 2023-04-11 11:11:36 -05:00
main.tf Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
mysql.tf enforce an uniform collation for all tables (#10515) 2023-03-16 15:49:24 -03:00
readme.md Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
redis.tf Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
services.tf Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
variables.tf Prepare v4.43.0 (#15972) 2024-01-09 16:45:22 -06:00
vpc.tf terraform/gcp: make prefix use consistent, use new database sizing, and refer to DNS zone (#8250) 2023-04-11 11:11:36 -05:00

Fleet on GCP

Required Variables:

project_id = "<your project id>"
prefix     = "fleet"
dns_name   = "<the domain you want to host fleet at>" // eg. myfleet.fleetdm.com.

Overview

Fleet server

The fleet webserver is running as Google Cloud Run containers, this is very similar to how the existing terraform for AWS runs fleet as Fargate compute. NOTE: Cloud Run has limitations on what container images it will run. In our deployment we create and Artifact Registry and deploy the public fleet container image into Artifact Registry.

MySQL

We are running MySQL using Google Cloud SQL only reachable via CloudSQLProxy and from Cloud Run using Serverless VPC Access Connector.

Redis

We are running Redis using Google Cloud Memorystore (Redis engine). This can run in cluster mode, but by default we are running in standalone mode.

Pushing the Fleet image into Google Artifact registry

More details can be found here.

Login with gcloud helper:

gcloud auth configure-docker \
    us-central1-docker.pkg.dev

Pull latest image:

docker pull <latest fleet version> for example docker pull fleetdm/fleet:v4.10.0

Tag it:

docker tag fleetdm/fleet:v10.0.0 us-central1-docker.pkg.dev/<project_id>/fleet-repository/fleet:v10.0.0

Push to Google Artifact registry:

docker push us-central1-docker.pkg.dev/<project_id>/fleet-repository/fleet:v4.9.1

GCP Managed Certificates

In this example we are using GCP Managed Certificates to handle TLS and TLS termination at the LoadBalancer. In order for the certificate to be properly issued, you'll need to update your domain registrar with the nameserver values generated by the new Zone created in GCP DNS.