How charlesgm/oidc-gcp-integration-project works
Project type and purpose
• This is a full‐stack CI/CD demonstration project that provisions GCP infrastructure (VPC, GKE, Artifact Registry, Workload Identity Federation, ArgoCD) with Terraform (and optionally Crossplane), builds a Python Flask app container via GitHub Actions, pushes images to GCP Artifact Registry, and deploys to GKE via Helm/ArgoCD.
• Key purpose: showcase keyless authentication (OIDC) for GitHub Actions → GCP, automated infra provisioning, and GitOps deployment.
File structure
• Top‐level: Dockerfile, app.py (Flask app), README.md, requirements.txt
• Infrastructure as Code:
• terraform/ (backend.tf, provider.tf, modules/{vpc, gke, artifact-registry}, etc.)
• crossplane/ (Crossplane YAMLs to provision same or supplementary resources)
• ledgerndary-interview-helm/ (Helm chart/templates for Kubernetes deployment)
• CI/CD definition lives in .github/workflows/deploy.yaml; Dockerfile defines container build.
Key README insights
• The flow: Push → GitHub Actions (OIDC auth) → Terraform apply (provision infra & ArgoCD install) → Build & push Docker image → Update Helm values → ArgoCD syncs → Deploy to GKE.
• Technologies: Terraform, GCS backend, GKE (private), Artifact Registry, Workload Identity, ArgoCD, Helm, Python/Flask, Crossplane, GitHub Actions.
Main components & interactions
a. Components:
• Developer (pushes code)
• GitHub Repo & GitHub Actions runner
• OIDC Token Provider (GitHub’s OIDC endpoint)
• GCP Workload Identity Federation & Service Account
• Terraform (with GCS backend)
• GCP Resources: VPC Network, Subnets, Firewall rules
• GKE Cluster (control plane & node pool)
• Artifact Registry
• ArgoCD (installed in cluster)
• Helm Chart (ledgerndary-interview-helm)
• Flask App Container (app.py)
• Crossplane (optional, demonstrating an alternative IaC tool)
b. Relationships & data flow:
1. Developer push → triggers GitHub Actions
2. GitHub Actions obtains OIDC token → authenticates to GCP Workload Identity → acquires GCP credentials
3. GitHub Actions step “terraform apply” → provisions or updates VPC, GKE, Artifact Registry, ArgoCD installation
4. GitHub Actions builds Docker image → pushes to Artifact Registry
5. GitHub Actions updates Helm values.yaml with new image tag → commits or applies via ArgoCD
6. ArgoCD continuously monitors Helm chart repo/values → deploys new release to GKE
7. Crossplane optionally watches Crossplane YAMLs → provisions same or extra infrastructure
c. Architectural patterns & principles:
• GitOps pattern (ArgoCD + Helm) for application deployment
• Infrastructure as Code (Terraform modules, optional Crossplane)
• Workload Identity Federation (OIDC) for keyless CI/CD authentication
• Modular Terraform design (reusable modules for VPC, GKE, Artifact Registry)
• Separation of concerns: CI/CD pipeline vs infra provisioning vs application deployment
d. Technologies & frameworks:
• GitHub Actions (CI/CD orchestrator)
• OIDC (token provider)
• Terraform + GCS backend
• Crossplane (optional/in parallel)
• GCP: IAM, VPC, GKE, Artifact Registry
• Helm & ArgoCD (GitOps)
• Python Flask (app)