$ cat ./deployments/gke.md
Google Kubernetes Engine (GKE)
Deploying to GKE involves creating a container image, pushing it to a registry (like GCR or Artifact Registry), and then using Kubernetes manifests to deploy it.
Steps
-
Containerize: Ensure the application has a valid
Dockerfile. -
Build & Push:
docker build -t gcr.io/my-project/cv-website:v1 . docker push gcr.io/my-project/cv-website:v1 -
Helm Chart: Create a Helm chart to manage the deployment.
deployment.yaml: Defines the Pods and Replicas.service.yaml: Exposes the application (LoadBalancer or NodePort).ingress.yaml: Manages external access (if using an Ingress Controller).
-
Terraform: Use Terraform to provision the GKE cluster and deploy the Helm chart.
resource "google_container_cluster" "primary" { name = "cv-cluster" location = "us-central1" # ... configuration ... } resource "helm_release" "cv_website" { name = "cv-website" repository = "./charts" chart = "cv-website" # ... values ... }