GCP GKE

Google Kubernetes Engine platform managed with Terraform (infrastructure) and Helm (workloads). Provisions a GKE Autopilot cluster with Cloud SQL, Artifact Registry, Cloud Storage, and an NGINX ingress controller in europe-west1 (Belgium).

Architecture Overview

Layer

Tool

Purpose

Provider

GCP europe-west1 (Belgium)

Network

Terraform

VPC with dedicated subnets for nodes, pods, services, and Cloud SQL

Resources

Terraform

GKE Autopilot, Cloud SQL, Artifact Registry, Cloud Storage

Namespace

Helm

NGINX Ingress Controller

Deployment

Production instance


Configuration

apiVersion: strata.huybrechts.xyz/v1
kind: configuration
meta:
  name: gcp_gke_config
  annotations:
    description: GCP GKE platform — Terraform + Helm on Google Kubernetes Engine
  labels:
    version: "1.0.0"
  tags: [gcp, gke, configuration]
spec:
  layering:
    - name: environment
      description: "Deployment environment (dev, staging, prd)"
      required: true

  deployment:
    additional_properties: false
    properties:
      environment:
        pattern: "^(dev|staging|prd)$"
        required: true
        description: "Target environment"

  zones:
    - name: eu_west
      description: "Europe West (Belgium, Netherlands, London)"
      regions:
        - europe-west1
        - europe-west4
        - europe-west2
    - name: us_central
      description: "US Central (Iowa, South Carolina)"
      regions:
        - us-central1
        - us-east1

  remotes:
    - name: gcp_gke
      type: gitops
      repository: git@github.com:your-org/gcp-gke-config.git
      reference: main
      source_path: .
      deploy_path: .

  integrations:
    - name: git
      type: git
      capabilities: [repository]
      required: true
      validation:
        command: git --version
        min_version: "2.30.0"
      authentication:
        method: cli

    - name: terraform
      type: terraform
      capabilities: [infrastructure]
      required: true
      validation:
        command: terraform --version
        min_version: "1.6.0"
      authentication:
        method: cli

    - name: gcloud
      type: gcloud
      capabilities: [infrastructure]
      required: true
      validation:
        command: gcloud --version
      authentication:
        method: cli

    - name: kubectl
      type: kubectl
      capabilities: [container]
      required: true
      validation:
        command: kubectl version --client
      authentication:
        method: cli

    - name: infracost
      type: infracost
      capabilities: [cost]
      required: false
      validation:
        command: infracost --version
        min_version: "0.10.0"
      authentication:
        method: cli

    - name: helm
      type: helm
      capabilities: [container]
      required: true
      validation:
        command: helm version
        min_version: "3.12.0"
      authentication:
        method: cli

Workspace

apiVersion: strata.huybrechts.xyz/v1
kind: workspace
meta:
  name: gcp_gke_platform
  annotations:
    description: GCP GKE workspace — Terraform provisions, Helm deploys
  labels:
    version: "1.0.0"
  tags: [gcp, gke, workspace]
spec:
  providers:
    - name: gcp_europe_west1
      file: "@gcp_gke/stack/gcp-provider-europe-west1.yaml"

  provisioners:
    - name: terraform
      provisioner: terraform
      source:
        repository: gcp_gke
        source_path: terraform

    - name: helm
      provisioner: helm
      source:
        repository: gcp_gke
        source_path: charts

  topology:
    - name: gke_cluster
      provider: gcp_europe_west1
      provisioner: terraform
      type: kubernetes
      components:
        - resource: gke_cluster
        - resource: cloud_sql
        - resource: artifact_registry
        - resource: gcs_artifacts
      namespaces:
        - namespace: platform

  resources:
    - name: gke_cluster
      file: "@gcp_gke/stack/gcp-res-gke.yaml"
      description: GKE Autopilot cluster
    - name: cloud_sql
      file: "@gcp_gke/stack/gcp-res-cloudsql.yaml"
      description: Cloud SQL for PostgreSQL (regional HA)
    - name: artifact_registry
      file: "@gcp_gke/stack/gcp-res-artifact-registry.yaml"
      description: Artifact Registry for container images
    - name: gcs_artifacts
      file: "@gcp_gke/stack/gcp-res-gcs.yaml"
      description: Cloud Storage bucket for artifacts

  namespaces:
    - name: platform
      file: "@gcp_gke/stack/gcp-ns-platform.yaml"

Provider

apiVersion: strata.huybrechts.xyz/v1
kind: provider
meta:
  name: gcp_europe_west1
  annotations:
    description: GCP Europe West 1 (Belgium) region
  labels:
    version: "1.0.0"
  tags: [gcp, provider, belgium]
spec:
  properties:
    type: gcp
    region: europe-west1

Network

VPC with dedicated subnets for nodes, pods, services, and Cloud SQL private IP.

apiVersion: strata.huybrechts.xyz/v1
kind: network
meta:
  name: gcp_net_vpc
  annotations:
    description: GCP VPC network for GKE platform and supporting services
  labels:
    version: "1.0.0"
  tags: [gcp, network, vpc]
spec:
  networks:
    - name: vpc_platform
      description: Platform VPC with dedicated subnet ranges
      address_space:
        - value: "10.0.0.0/16"
        - value: "10.4.0.0/14"
      subnets:
        - name: subnet_gke_nodes
          cidr:
            value: "10.0.0.0/20"
          description: GKE node IP range
        - name: subnet_gke_pods
          cidr:
            value: "10.4.0.0/14"
          description: GKE pod secondary range
        - name: subnet_cloudsql
          cidr:
            value: "10.0.16.0/24"
          description: Cloud SQL private services range

Resources

GKE Autopilot Cluster

apiVersion: strata.huybrechts.xyz/v1
kind: resource
meta:
  name: gcp_gke_cluster
  annotations:
    description: GKE Autopilot cluster
  labels:
    version: "1.0.0"
  tags: [gcp, gke, resource, kubernetes]
spec:
  properties:
    provider_type: gcp
    resource_type: gke_cluster
    category: compute
    subcategory: kubernetes
  configuration:
    cluster_mode: autopilot
    release_channel: REGULAR
    network: vpc-platform-prd
    subnetwork: subnet-gke-prd
    master_ipv4_cidr: "172.16.0.0/28"
    enable_private_nodes: true
    enable_private_endpoint: false

Cloud SQL for PostgreSQL

apiVersion: strata.huybrechts.xyz/v1
kind: resource
meta:
  name: gcp_cloud_sql
  annotations:
    description: GCP Cloud SQL for PostgreSQL with high availability
  labels:
    version: "1.0.0"
  tags: [gcp, resource, cloudsql, postgresql, database]
spec:
  properties:
    provider_type: gcp
    resource_type: cloud_sql
    category: database
    subcategory: relational
  configuration:
    database_version: POSTGRES_16
    tier: db-custom-4-16384
    availability_type: REGIONAL
    disk_size: 100
    disk_autoresize: true
    backup_enabled: true
    point_in_time_recovery: true
    deletion_protection: true
    ip_configuration:
      ipv4_enabled: false
      private_network: vpc-platform-prd

Artifact Registry

apiVersion: strata.huybrechts.xyz/v1
kind: resource
meta:
  name: gcp_artifact_registry
  annotations:
    description: GCP Artifact Registry for container images
  labels:
    version: "1.0.0"
  tags: [gcp, resource, artifact_registry, registry]
spec:
  properties:
    provider_type: gcp
    resource_type: artifact_registry
    category: container
    subcategory: registry
  configuration:
    format: DOCKER
    mode: STANDARD_REPOSITORY
    cleanup_policy:
      keep_count: 50
      tag_state: TAGGED

Cloud Storage Bucket

apiVersion: strata.huybrechts.xyz/v1
kind: resource
meta:
  name: gcp_gcs_artifacts
  annotations:
    description: GCP Cloud Storage bucket for build artifacts and state
  labels:
    version: "1.0.0"
  tags: [gcp, resource, gcs, storage]
spec:
  properties:
    provider_type: gcp
    resource_type: gcs_bucket
    category: storage
    subcategory: object
  configuration:
    location: EU
    storage_class: STANDARD
    versioning: true
    uniform_bucket_level_access: true
    lifecycle_rules:
      - action: SetStorageClass
        storage_class: NEARLINE
        age_days: 90
      - action: Delete
        age_days: 365

Namespace

apiVersion: strata.huybrechts.xyz/v1
kind: namespace
meta:
  name: gcp_gke_ns_platform
  annotations:
    description: Platform namespace — ingress and service mesh
  labels:
    version: "1.0.0"
  tags: [gcp, gke, namespace, platform]
spec:
  modules:
    - name: ingress_nginx
      file: "@gcp_gke/stack/gcp-mod-ingress-nginx.yaml"

Module

NGINX Ingress Controller

apiVersion: strata.huybrechts.xyz/v1
kind: module
meta:
  name: gcp_gke_mod_ingress_nginx
  annotations:
    description: NGINX Ingress Controller for GKE
  labels:
    version: "1.0.0"
  tags: [gcp, gke, module, nginx, ingress]
spec:
  type: helm
  source:
    chart_repository: https://kubernetes.github.io/ingress-nginx
    chart_name: ingress-nginx
    chart_version: "4.10.0"
  kubernetes_namespace: ingress-nginx
  services:
    - name: ingress-nginx-controller
      configuration:
        controller:
          service:
            type: LoadBalancer
            annotations:
              cloud.google.com/neg: '{"ingress": true}'
          metrics:
            enabled: true

Environment

apiVersion: strata.huybrechts.xyz/v1
kind: environment
meta:
  name: gcp_gke_env_prd
  annotations:
    description: Production environment for GCP GKE platform
  labels:
    version: "1.0.0"
  tags: [gcp, gke, production, environment]
spec:
  variables:
    - key: WORKSPACE
      store: constant
      value: gcp_gke
    - key: ENVIRONMENT
      store: constant
      value: prd
    - key: GCP_PROJECT_ID
      store: environment
      value: GCP_PROJECT_ID
    - key: GCP_REGION
      store: constant
      value: europe-west1
    - key: GKE_CLUSTER_NAME
      store: constant
      value: gke-platform-prd
    - key: GKE_NETWORK
      store: constant
      value: vpc-platform-prd
    - key: CLOUD_SQL_INSTANCE
      store: constant
      value: cloudsql-platform-prd
    - key: ARTIFACT_REGISTRY
      store: constant
      value: europe-west1-docker.pkg.dev/${GCP_PROJECT_ID}/platform
    - key: GCS_ARTIFACTS_BUCKET
      store: constant
      value: platform-artifacts-prd

  secrets:
    - key: GOOGLE_CREDENTIALS
      store: environment
      value: GOOGLE_CREDENTIALS

Deployment

apiVersion: strata.huybrechts.xyz/v1
kind: deployment
meta:
  name: gcp_gke_deploy_prd
  annotations:
    description: Production deployment for GCP GKE platform
  labels:
    version: "1.0.0"
  tags: [gcp, gke, production, deployment]
spec:
  layers:
    environment: prd

  properties:
    environment: prd

  workspace:
    name: gcp_gke_platform
    description: GCP GKE Platform
    file: "@gcp_gke/stack/gcp-ws-platform.yaml"

  environments:
    - "@gcp_gke/environments/gcp-gke-env-prd.yaml"

  stages:
    - name: infrastructure
      provisioner: terraform
      scope: all
      on_failure: stop

    - name: platform
      provisioner: helm
      scope: all
      depends_on: [infrastructure]
      on_failure: stop