Skip to content

NyoikePaul/kubernetes-gke-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Enterprise Kubernetes GKE Migration Platform

Live Demo CI Terraform Kubernetes Helm Prometheus tfsec License: MIT

Production-grade Kubernetes migration and deployment platform for Google Kubernetes Engine β€” private clusters, Workload Identity, zero-trust networking, and fully automated CI/CD.

🌐 Live Demo Β· βš™οΈ CI/CD Pipeline Β· πŸ“¦ Release v1.0.0


Architecture

graph TD
    A[Google Cloud Platform] --> B[GKE Regional Cluster]
    B --> C[NGINX Ingress Controller]
    C --> D[Cloud Load Balancer]
    D --> E[Deployments]
    D --> F[StatefulSets]
    E --> G[Application Pods]
    F --> I[Database Pods]
    B --> K[Persistent Volumes]
    K --> L[GCE Persistent Disks]
    B --> M[Google Managed Prometheus]
    B --> N[Fluent Bit to Cloud Logging]
    B --> O[Calico Network Policies]
    A --> P[Cloud SQL]
    A --> Q[Cloud Storage]
    A --> R[Cloud NAT]
Loading

What Makes This Different

Feature This Repo Typical Portfolio Repos
Private GKE cluster + Cloud NAT βœ… ❌ usually public
Workload Identity (no key files) βœ… ❌ usually SA keys
Binary Authorization βœ… ❌ rarely implemented
Separate system + app node pools βœ… ❌ single pool
tfsec security scanning in CI βœ… ❌
Google Managed Prometheus βœ… ❌ self-managed
Default-deny NetworkPolicy βœ… ❌
Live demo with Vercel βœ… ❌
Surge upgrades (zero max-unavailable) βœ… ❌
Dependabot auto-updates βœ… ❌

Features

Category Capability Status
Infrastructure Private GKE cluster, regional, multi-zone βœ…
Security Workload Identity, Shielded Nodes, Binary Auth βœ…
Networking VPC-native, Cloud NAT, Calico zero-trust βœ…
Node Pools System + App pools, autoscaling, surge upgrades βœ…
Packaging Helm chart, namespaces, quotas, network policies βœ…
Monitoring Google Managed Prometheus, 8 alert rules βœ…
Logging Fluent Bit to Cloud Logging βœ…
RBAC Least-privilege roles with bindings βœ…
CI/CD fmt β†’ validate β†’ tfsec β†’ preview β†’ production βœ…
Migration Export/import scripts, rollback plan βœ…
Dependencies Dependabot weekly auto-updates βœ…

Repository Structure

kubernetes-gke-migration/
β”œβ”€β”€ terraform/                  # IaC β€” VPC, GKE, IAM, node pools
β”‚   β”œβ”€β”€ main.tf                 # Cluster, networking, node pools, IAM
β”‚   β”œβ”€β”€ variables.tf            # Typed variables with validation
β”‚   β”œβ”€β”€ outputs.tf              # Cluster endpoint, SA, WI pool
β”‚   └── terraform.tfvars.example
β”œβ”€β”€ helm/gke-platform/          # Platform Helm chart
β”‚   β”œβ”€β”€ Chart.yaml
β”‚   β”œβ”€β”€ values.yaml             # Default values
β”‚   β”œβ”€β”€ values-prod.yaml        # Production overrides
β”‚   └── templates/              # Namespaces, quotas, policies
β”œβ”€β”€ k8s/base/                   # HPA, PDB, NetworkPolicy, ResourceQuota
β”œβ”€β”€ monitoring/prometheus/      # Scrape configs + 8 alert rules
β”œβ”€β”€ logging/                    # Fluent Bit ConfigMap
β”œβ”€β”€ security/                   # RBAC roles + bindings, LimitRange
β”œβ”€β”€ examples/sample-app/        # Production-ready deployment template
β”œβ”€β”€ scripts/                    # health-check, backup, migrate, scale
β”œβ”€β”€ tests/                      # Validation script
β”œβ”€β”€ docs/                       # Architecture, Setup, Migration, Security
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ workflows/terraform.yml # CI/CD pipeline
β”‚   β”œβ”€β”€ dependabot.yml          # Automated dependency updates
β”‚   └── PULL_REQUEST_TEMPLATE.md
β”œβ”€β”€ CONTRIBUTING.md
└── CHANGELOG.md

Quick Start

# 1. Clone
git clone https://github.com/NyoikePaul/kubernetes-gke-migration
cd kubernetes-gke-migration
 
# 2. Configure
cd terraform
cp terraform.tfvars.example terraform.tfvars
# Edit: set project_id and master_authorized_networks
 
# 3. Deploy infrastructure (~15 min)
terraform init
terraform plan  -var-file=terraform.tfvars
terraform apply -var-file=terraform.tfvars
 
# 4. Connect
gcloud container clusters get-credentials gke-platform \
  --region us-central1 --project YOUR-PROJECT-ID
 
# 5. Deploy platform
helm install gke-platform ./helm/gke-platform \
  --namespace production --create-namespace \
  --values helm/gke-platform/values-prod.yaml
 
# 6. Apply manifests + security
kubectl apply -f k8s/base/
kubectl apply -f security/
 
# 7. Validate
make validate   # or: bash tests/validate-manifests.sh

CI/CD Pipeline

Push to main
    β”‚
    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Validate  │──▢│ tfsec Scan │──▢│  Preview   │──▢│ Production β”‚
β”‚ fmt+check  β”‚   β”‚  security  β”‚   β”‚environment β”‚   β”‚environment β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     ~9s              ~12s             ~12s              ~12s

Auth via Workload Identity Federation β€” zero long-lived GCP credentials stored in GitHub.


Security Highlights

Control Implementation CIS Benchmark
Private nodes No public IPs, egress via Cloud NAT CIS 6.6.1
Workload Identity Pods authenticate without key files CIS 6.2.1
Shielded nodes Secure boot + vTPM integrity CIS 6.5.4
Binary Authorization Blocks unverified images CIS 7.3
Network policies Default-deny, Calico CIS 6.6.7
Least-privilege SA 5 minimum roles only CIS 6.2.2
Metadata hardening Legacy endpoints disabled CIS 6.4.1
API server access Master Authorized Networks CIS 6.6.2

Operations

make health      # Cluster health check
make backup      # Backup production namespace
make validate    # Validate all manifests
bash scripts/migrate.sh source-ctx target-ctx
bash scripts/scale-cluster.sh 5 app-pool us-central1

Documentation

Doc Description
ARCHITECTURE.md System design and network topology
SETUP.md Prerequisites and cluster setup
MIGRATION.md Step-by-step migration runbook
SECURITY.md Security controls and CIS benchmark mapping
MONITORING.md Observability stack and alert tuning
CONTRIBUTING.md How to contribute
CHANGELOG.md Version history

Author

Paul Nyoike Β· GitHub Β· Portfolio

License

MIT β€” see LICENSE


☸️ Enterprise Kubernetes. Cloud Native. Production Ready.

About

Enterprise-grade Kubernetes GKE migration platform with Terraform, Helm, RBAC, network policies, monitoring, and automated deployment architecture.

Topics

Resources

License

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors