.. | ||
backend | ||
frontend | ||
k8s | ||
.gitignore | ||
prepare-app.sh | ||
README.md | ||
remove-app.sh |
Nudges.works — GKE Deployment on GCP
What it does
A service marketplace application that connects users with service providers. Users can search for professionals like plumbers, electricians, or gardeners in their area and view their profiles, including contact information and rates.
Architecture
- GKE cluster (3 nodes) running on Google Cloud
- Google-managed TLS certificate for HTTPS
- Ingress controller for traffic routing
- 2 Deployments & Services:
frontend
(React/Vite),backend
(Express) - MongoDB hosted on Atlas (external persistent database)
- Docker images stored in Google Container Registry (GCR)
Files
backend/Dockerfile
- Containerizes the Express backendfrontend/Dockerfile
- Containerizes the React frontendfrontend/nginx.conf
- Nginx configuration for serving frontend and proxying API requestsk8s/
- Kubernetes manifests:mongo-secret.yml
- Secret for MongoDB credentials and API keysbackend-deployment.yml.tpl
- Backend deployment templatebackend-service.yml
- Backend servicebackend-config.yml
- Health check configuration for backendfrontend-deployment.yml.tpl
- Frontend deployment templatefrontend-service.yml
- Frontend servicemanaged-cert.yml
- GCP-managed TLS certificateingress.yml
- Ingress configuration for routing
prepare-app.sh
- Script to deploy everythingremove-app.sh
- Script to tear down the deploymentREADME.md
- This documentation
Prerequisites
- Google Cloud SDK + billing enabled
- Install the GKE auth plugin:
gcloud components install gke-gcloud-auth-plugin
- Ensure your shell sees the Linux
gcloud
,kubectl
andnpm
, not Windows versions gcloud init
& set project- Enable APIs: Container, Compute, Cloud Build
DNS setup
- After
./prepare-app.sh
finishes you'll see the ingress external IP - In your DNS provider, set A-record for
nudges.works
→ your GKE Ingress EXTERNAL-IP. - (Optional) CNAME
www
→nudges.works
.
Deploy
chmod +x prepare-app.sh remove-app.sh
./prepare-app.sh
Wait until ManagedCertificate
→ Active
. Then browse
https://nudges.works
Note on Certificate Provisioning
- The managed certificate can take 30-60 minutes to provision
- Your application will be accessible via HTTP immediately, but HTTPS requires waiting for certificate activation
- You can check certificate status with:
kubectl get managedcertificates -n sk1
Teardown
./remove-app.sh
External Sources
- GKE ManagedCertificate guide
- MongoDB Atlas docs
- Generated with GitHub Copilot