Deploying on GCP
On this page
- Architecture
- Prerequisites
- Machine Type Selection
- Storage Configuration
- Persistent Disk Types
- Disk Configuration
- /etc/fstab Configuration
- Networking
- Firewall Rules
- Sole-Tenant Nodes
- Encryption
- At-Rest Encryption with Cloud KMS
- In-Transit Encryption with TLS
- IAM Configuration
- Deployment with Terraform
- Monitoring Integration
- Cloud Monitoring
- Backup Strategy
- Snapshot Schedules
- Cost Optimization
- Related Documentation
Deploy Kimberlite on Google Cloud Platform.
Architecture
┌───────────────────────────────────────────────────────┐
│ VPC Network │
│ ┌────────────────┐ ┌──────────────┐ ┌────────────┐│
│ │ us-central1-a│ │ us-central1-b│ │us-central1-c││
│ │ │ │ │ │ ││
│ │ ┌──────────┐ │ │ ┌────────┐ │ │ ┌────────┐││
│ │ │ Node 1 │ │ │ │ Node 2 │ │ │ │ Node 3 │││
│ │ │ (Leader) │ │ │ │ │ │ │ │ │││
│ │ └──────────┘ │ │ └────────┘ │ │ └────────┘││
│ └────────────────┘ └──────────────┘ └────────────┘│
└───────────────────────────────────────────────────────┘
Prerequisites
- GCP project with Compute Engine API enabled
gcloudCLI installed and configured- Terraform or Deployment Manager (optional)
Machine Type Selection
Recommended Machine Types:
| Workload | Machine Type | vCPUs | Memory | Network | Disk |
|---|---|---|---|---|---|
| Small | e2-standard-2 | 2 | 8 GB | Up to 10 Gbps | 100 GB PD-SSD |
| Medium | n2-standard-4 | 4 | 16 GB | Up to 10 Gbps | 500 GB PD-SSD |
| Large | n2-standard-8 | 8 | 32 GB | Up to 16 Gbps | 1 TB PD-SSD |
| Production | n2-highmem-16 | 16 | 128 GB | 32 Gbps | 2 TB PD-SSD |
Machine Selection Tips:
- Use
n2-standardfor balanced workloads - Use
n2-highcpufor high-throughput workloads - Use
n2-highmemfor large projection caches
Storage Configuration
Persistent Disk Types
| Disk Type | IOPS (Read/Write) | Throughput | Use Case | Cost |
|---|---|---|---|---|
| PD-SSD | 30/30 per GB (max 100k) | 1,200 MB/s | Recommended | $0.17/GB-month |
| PD-Balanced | 6/6 per GB (max 80k) | 240 MB/s | Cost-optimized | $0.10/GB-month |
| PD-Standard | 0.75/1.5 per GB | 180 MB/s | NOT for log | $0.04/GB-month |
Recommendations:
- Log disk: PD-SSD (500 GB = 15k IOPS)
- Projection disk: PD-Balanced (200 GB = 1200 IOPS)
- Use separate disks for log and projections
Disk Configuration
# Create persistent disks
# Create VM and attach disks
# Format and mount (SSH into VM)
/etc/fstab Configuration
# Add to /etc/fstab
Networking
Firewall Rules
# Create VPC network
# Client traffic (from application VPC)
# Cluster traffic (between nodes)
# Metrics (from monitoring)
# SSH (from IAP only)
Sole-Tenant Nodes
For consistent performance and compliance:
# Create sole-tenant node group
# Create instances on sole-tenant nodes
Encryption
At-Rest Encryption with Cloud KMS
# /etc/kimberlite/config.toml
[encryption]
enabled = true
kms_provider = "gcp-kms"
kms_key_id = "projects/PROJECT_ID/locations/us-central1/keyRings/kimberlite/cryptoKeys/data-key"
Create KMS key:
# Create key ring
# Create encryption key
# Grant service account access
In-Transit Encryption with TLS
Use Google-managed certificates or self-signed:
# Using Certificate Manager
# Or use Let's Encrypt
IAM Configuration
Service Account Permissions:
# Create service account
# Grant permissions
Deployment with Terraform
# main.tf
resource "google_compute_instance" "kimberlite_node" {
count = 3
name = "kimberlite-node-${count.index + 1}"
machine_type = "n2-standard-4"
zone = element(var.zones, count.index)
boot_disk {
initialize_params {
image = "ubuntu-os-cloud/ubuntu-2204-lts"
size = 50
}
}
attached_disk {
source = google_compute_disk.log[count.index].self_link
device_name = "log"
}
attached_disk {
source = google_compute_disk.proj[count.index].self_link
device_name = "proj"
}
network_interface {
subnetwork = google_compute_subnetwork.kimberlite.self_link
}
service_account {
email = google_service_account.kimberlite.email
scopes = ["cloud-platform"]
}
metadata_startup_script = templatefile("startup.sh", {
node_id = count.index + 1
})
tags = ["kimberlite-node"]
}
resource "google_compute_disk" "log" {
count = 3
name = "kimberlite-log-${count.index + 1}"
type = "pd-ssd"
zone = element(var.zones, count.index)
size = 500
}
resource "google_compute_disk" "proj" {
count = 3
name = "kimberlite-proj-${count.index + 1}"
type = "pd-balanced"
zone = element(var.zones, count.index)
size = 200
}
Monitoring Integration
Cloud Monitoring
Export Kimberlite metrics to Cloud Monitoring:
# Install ops agent
# Configure agent
Backup Strategy
Snapshot Schedules
# Create snapshot schedule
# Attach to disks
Cost Optimization
Estimated Monthly Costs (3-node cluster):
| Component | Configuration | Cost |
|---|---|---|
| 3x n2-standard-4 | 24/7 | $350 |
| 3x PD-SSD 500 GB | $255 | |
| 3x PD-Balanced 200 GB | $60 | |
| Data transfer | 1 TB/month | $120 |
| Total | ~$785/month |
Cost Reduction Tips:
- Use Committed Use Discounts (up to 57% off)
- Use Sustained Use Discounts (automatic)
- Use Preemptible VMs for non-critical workloads (80% discount)
- Archive old snapshots to Coldline Storage
Related Documentation
- Deployment Guide - General deployment patterns
- Configuration Guide - Configuration options
- Security Guide - TLS setup
- Monitoring Guide - Observability
Key Takeaway: Use PD-SSD for log disk, spread nodes across zones, enable Cloud KMS encryption, and use Cloud Monitoring for observability.