Skip to main content

Overview

Google Kubernetes Engine (GKE) is a managed Kubernetes service that provides enterprise-grade features including Autopilot mode, Workload Identity, and tight integration with Google Cloud services.
This guide covers deploying to GKE with production-ready configuration including Workload Identity for secure service authentication, Cloud SQL for PostgreSQL, and Memorystore for Redis.

Prerequisites

  • Google Cloud account with billing enabled
  • gcloud CLI installed and configured
  • kubectl installed
  • Project with required APIs enabled

Enable Required APIs

Create GKE Cluster

GKE Autopilot manages the cluster infrastructure for you:

Standard Cluster

For more control over node configuration:

Setup Workload Identity

Workload Identity allows pods to authenticate as Google Cloud service accounts:

Cloud SQL for PostgreSQL

Create Cloud SQL Instance

Three databases required: Keycloak (identity), OpenFGA (authorization), and GDPR (compliance data storage per ADR-0041).

Initialize GDPR Schema

After creating the databases, initialize the GDPR schema:
Schema Details:
  • user_profiles: User profile data (GDPR Article 15, 16, 17)
  • user_preferences: User preferences (GDPR Article 16, 17)
  • consent_records: Consent audit trail, 7-year retention (GDPR Article 21, Article 7)
  • conversations: Conversation history, 90-day retention (GDPR Article 15, 20)
  • audit_logs: Compliance audit trail, 7-year retention (HIPAA §164.316(b)(2)(i), SOC2 CC6.6)
See GDPR Storage Configuration for retention policies and backup procedures.

Configure Cloud SQL Proxy

Option 1: Cloud SQL Auth Proxy Sidecar
Option 2: Private IP (Recommended for Production)

Memorystore for Redis

Create Redis Instance

Configure Application

Secret Manager Integration

Store Secrets in Secret Manager

Use External Secrets Operator

Google Container Registry (GCR)

Build and Push Images

Load Balancer and Ingress

Install NGINX Ingress Controller

Configure Ingress

Google Cloud Load Balancer

For GCP-native load balancing:

Monitoring with Cloud Operations

Enable Google Cloud Monitoring

Configure Pod Monitoring

Cloud Logging

Configure structured logging to Cloud Logging:

Auto-Scaling

Horizontal Pod Autoscaler

Cluster Autoscaler

GKE Autopilot handles node scaling automatically. For Standard clusters:

Complete Deployment

Cost Optimization

GKE Autopilot optimizes resource usage:
  • Pay only for pod resources
  • Automatic resource optimization
  • No node management overhead
  • Built-in security best practices
For non-production workloads:
Use node affinity to schedule on preemptible nodes:
Use GKE usage metering to analyze resource usage:
For production workloads:
  • 1-year commitment: 37% discount
  • 3-year commitment: 55% discount

Security Best Practices

Ensure only trusted images are deployed:

Troubleshooting

Check connectivity:
Verify setup:

Next Steps

EKS Deployment

Deploy to AWS EKS

AKS Deployment

Deploy to Azure AKS

Monitoring

Setup monitoring

Disaster Recovery

Backup and recovery

GKE Deployment Ready: Production-grade deployment on Google Kubernetes Engine!