Skip to main content

GKE Cluster Component

The GKE component provisions a Google Kubernetes Engine Autopilot cluster with private nodes, Workload Identity, and security features.

Architecture

Why Autopilot?

GKE Autopilot provides:

  • Automatic Node Management: No node pool configuration needed
  • Cost Optimization: Pay per pod, not per node
  • Security Hardening: Pre-configured security policies
  • Automatic Upgrades: Managed control plane and nodes
  • SLA Guaranteed: 99.9% uptime SLA

Resources Created

ResourcePurpose
GKE ClusterAutopilot Kubernetes cluster
Workload Identity PoolGCP-Kubernetes identity federation

Configuration

# Pulumi.dev.yaml (Development/Test)
config:
serko-northsky:gkeReleaseChannel: "REGULAR"

# Pulumi.prod.yaml (Production)
config:
serko-northsky:gkeReleaseChannel: "STABLE"

Release Channels

ChannelDescriptionUse Case
RAPIDLatest featuresExperimentation
REGULARBalanced stabilityDev/Test
STABLEMost stableProduction

Cluster Features

Security Configuration

  • Private Nodes: Nodes have no public IPs
  • Binary Authorization: Enforce signed container images
  • Shielded Nodes: Hardware-backed security
  • Workload Identity: Secure GCP service access

Networking

  • VPC-Native: Uses alias IPs for pods
  • Network Policy: Calico-based pod network policies
  • Private Endpoint: Optional private control plane access

Monitoring

  • Managed Prometheus: Built-in metrics collection
  • Cloud Logging: Centralized log management
  • Cloud Monitoring: Infrastructure and application metrics

Outputs

interface GkeOutputs {
clusterName: string;
clusterEndpoint: string;
clusterCaCertificate: string;
workloadIdentityPool: string;
}

Workload Identity

Workload Identity allows Kubernetes service accounts to act as GCP service accounts:

# Kubernetes ServiceAccount
apiVersion: v1
kind: ServiceAccount
metadata:
name: backend
annotations:
iam.gke.io/gcp-service-account: app@PROJECT_ID.iam.gserviceaccount.com

The binding is created in the IAM component:

// IAM binding for Workload Identity
new gcp.serviceaccount.IAMMember('workload-identity-binding', {
serviceAccountId: appServiceAccount.name,
role: 'roles/iam.workloadIdentityUser',
member: pulumi.interpolate`serviceAccount:${projectId}.svc.id.goog[default/backend]`,
});

Connecting to the Cluster

After deployment, configure kubectl:

# Get credentials
gcloud container clusters get-credentials serko-northsky-cluster \
--region us-central1 \
--project PROJECT_ID

# Verify connection
kubectl get nodes

Environment Differences

FeatureDev/TestProduction
Release ChannelREGULARSTABLE
Deletion ProtectionDisabledEnabled
Node LocationsSingle zoneMulti-zone