Optimize GCP Prod Environment: Minimal Sizing, Deployment Resilience, and Registry Integration#8
Merged
benjamin-747 merged 1 commit intogitmono-dev:mainfrom Feb 10, 2026
Conversation
…ployment - Minimizes Cloud SQL and Redis instance sizes and removes HA/replicas. - Adds Artifact Registry support and image sync script to bypass Cloud Run source restrictions. - Implements SQLite fallback config for backend startup stability. - Simplifies terraform.tfvars by leveraging sane defaults in variables.tf. Signed-off-by: Hongze Gao <15101764808@163.com>
benjamin-747
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This Pull Request optimizes the GCP production deployment configuration to align with cost‑efficiency requirements while resolving critical deployment blockers. The primary focus is on utilizing the smallest possible instance sizes, removing high-availability overhead, and ensuring reliable image delivery and database failover.
Key Changes
1. Registry & Image Management
artifact_registrymodule. This is now a requirement as Cloud Run cannot pull directly from AWS ECR Public.deployment/scripts/sync_images_to_ar.shto facilitate the migration of images from ECR to GCP.main.tfto auto-construct full image URLs usingproject_id,image_name, andimage_tag. This eliminates the need to manually update long registry strings interraform.tfvars.2. Database & Cache Optimization (Cost Control)
edition = "ENTERPRISE"support to thecloud_sqlmodule. This allows the use of thedb-f1-microtier, which is restricted in the defaultENTERPRISE_PLUSedition.BASICtier with 1GB memory to minimize hourly costs./tmp. This ensures the application can start even if Cloud SQL peering is restricted by project-level IAM permissions.Motivation
These updates cater to a lab/teaching environment where minimizing GCP billing and reducing deployment friction are essential. The new configuration provides a more resilient "out-of-the-box" experience by handling common Cloud Run and Cloud SQL permission issues gracefully.