Infrastructure Setup
Setting Up the Network and Creating a VPC
Creating a VPC Network
- Go to VPC Network in Google Cloud Console.
- Click Create VPC network and name it
care-vpc. - Configure the following settings:
- MTU:
1460 - IPv6 Range: Disabled
- Subnet Creation Mode: Custom
- MTU:
Creating a Subnet
- Create a new subnet with these details:
- Name:
cluster-snet - Region:
asia-south1 - IP Stack Type:
IPv4 (single-stack) - IPv4 Range:
10.0.0.0/16 - Private Google Access: On
- Flow Logs: Off
- Name:
- Set Dynamic Routing Mode to
Regional. - Keep the default firewall rules.
Command-Line Equivalent
To create the VPC and subnet using gcloud:
gcloud compute networks create care-vpc --project=$PROJECT --subnet-mode=custom --mtu=1460 --bgp-routing-mode=regional
gcloud compute networks subnets create cluster-snet --project=$PROJECT --range=10.0.0.0/16 --stack-type=IPV4_ONLY --network=care-vpc --region=asia-south1 --enable-private-ip-google-access
Reserving a Static IP Address
- Navigate to VPC Networks > IP Addresses.
- Click RESERVE EXTERNAL STATIC IP ADDRESS.
- Configure the following:
- Name:
pip-care - Network Service Tier:
Premium - IP Version:
IPv4 - Type:
Regional - Region:
asia-south1 (Mumbai) - Attached to: None
- Name:
- Note down the assigned IP for future use.
Command-line equivalent:
gcloud compute addresses create pip-care --project=$PROJECT --region=asia-south1
Setting Up Databases
Creating a Cloud SQL Instance
- Go to Google Cloud Console > Cloud SQL.
- Click Create Instance and choose
PostgreSQL. - Configure the first database:
- Instance ID:
care-db - Authentication: Cloud SQL (set a strong master password)
- Database Version:
PostgreSQL 16 - Cloud SQL Edition: Enterprise
- Region:
asia-south1| Primary Zone:asia-south1-a - Machine Type:
2 vCPU, 8 GB RAM, 20 GB SSD - Enable: Automatic storage increases, backups, point-in-time recovery, deletion protection
- Instance IP: Private (assign to
care-vpc)
- Instance ID:
- Create a database named
care. - Repeat for
metabase-db, but configure it with:- Machine Type:
1 vCPU, 3.75 GB RAM - Database Name:
metabase
- Machine Type:
Configuring Cloud Storage
Creating Buckets
- Go to Cloud Storage > Buckets > Create.
- Configure the first bucket:
- Name:
<prefix>-care-facility - Location:
asia-south1 (Mumbai),Standard - Access Control: Uniform
- Public Access Prevention: Off
- Name:
- Configure the second bucket:
- Name:
<prefix>-care-patient-data - Public Access Prevention: On
- Retention Policy: 7 days
- Name:
Configuring Service Account
- Navigate to Settings > Interoperability.
- Create a service account
care-bucket-accesswith roleStorage Object Admin. - Generate access keys and note them for later use.
Configuring CORS for Cloud Storage
Setting CORS Rules
For <prefix>-care-facility:
[
{
"origin": ["*"],
"responseHeader": ["Content-Type"],
"method": ["GET", "HEAD", "PUT", "POST", "DELETE"],
"maxAgeSeconds": 3600
}
]
For <prefix>-care-patient-data:
[
{
"origin": ["care.example.com"],
"responseHeader": ["Content-Type"],
"method": ["GET", "HEAD", "PUT", "POST", "DELETE"],
"maxAgeSeconds": 3600
}
]
Command-line equivalent:
gsutil cors set cors.json gs://<prefix>-care-facility
gsutil cors set cors.json gs://<prefix>-care-patient-data
Configuring Google Kubernetes Engine (GKE)
Creating a GKE Cluster
- Navigate to Kubernetes Engine > Clusters > Create.
- Choose Standard Mode.
- Configure cluster settings:
- Name:
care-gke - Location:
Zonal - Zone:
asia-south1-a
- Name:
Configuring Node Pools
- Select
default pooland set nodes to2. - In Nodes section:
- Machine Type:
E2-Series,e2-standard-2(2 vCPU, 8 GB RAM)
- Machine Type:
- In Networking section:
- Network:
care-vpc - Subnet:
cluster-snet - Access: Public Cluster
- Network:
- Enable HTTP Load Balancing.