App that accepts username and date of birth.
Shows Simple Happy Birthday Message or How many days to Birthday.
POST: { "username": "string", date_of_birth: "YYYY-mm-dd"}
GET: /hello/
GET: /hello/<usermane>
-
Git + Google Cloud Source Repository:
- Code Collaboration and Versioning
-
GCS (Google Cloud Storage):
- Kubernetes Yamls (deployments, services, ingress, secrets)
-
Cloud Build:
- Build and Deploy images to GKE
-
Container Registry
- Docker Image Repository
-
GKE (Google Kubernetes Engine):
- Application Container Cluster
-
CloudSQL:
- Private Network Application Database runnung Postgres
-
Ingress:
- External Exposure, LoadBalancing and SSL Termination
-
Stackdriver:
- Logging and future alerts
-
VPC:
- Internal conmmunication between cluster and database
Follow the Terraform Guide
- Docker Runtime Environment
- Docker Compose
There are 9 Tests in total under api/tests.py
python manage.py tests
circleci build
- Rename
.env.example
to.env
and update with necessary database details - Update
docker-compose.yaml
and.env
file with correct database details
docker-compose up
- Application will be accessible on http://localhost:8000
docker-compose down
Assumes you're using Cloud Source Respository otherwise:
- Connect Repositoy to Cloud Source Repository https://source.cloud.google.com/repo/connect
- .kubernetes/migration-job.yaml
- .kubernetes/test-job.yaml
- Merge/Push Code to master
- Trigger Build (CloudBuild)
- Image stored in Container Registry
- CloudBuild Runs migration Job.
- CloudBuild image to pods in kubernetes cluster
Recommendation: Prefer Git Tags for Production instead on Branch
-
Create Secrets:
kubetcl apply -f .kubernetes/secrets.yaml
-
Create the Migration Job
kubectl apply -f .kubernetes/migration-job.yaml
-
Create the Deployment
kubectl apply -f .kubernetes/deployment.yaml
-
Create the Service
kubectl apply -f .kubernetes/service.yaml
-
Create the LoadBalancer
kubectl apply -f .kubernetes/ingress.yaml
-
Point DNS to LoadBalancer IP Address.
Feel free to drop a feedback (kudos and critics are welcome): [email protected]