Moodify relies on Kubernetes as the consistent deployment substrate across local development clusters, AWS Elastic Kubernetes Service (EKS), and Google Kubernetes Engine (GKE). The manifests in this directory provide the baseline workloads for the frontend and backend; the cloud-specific guides in ../aws/ and ../gcp/ extend the same primitives with managed ingress, data stores, and platform automation.
../DEPLOYMENT.md to support blue/green + canary rollouts.../aws/terraform and ../gcp/terraform, where the underlying VPC, node pools, registries, and load balancers are provisioned.| File | Purpose | Notes |
|---|---|---|
frontend-deployment.yaml |
React single-page app deployment | Uses moodify-frontend image; replace hostPath volume with a persistent volume in production. |
frontend-service.yaml |
Service that exposes the frontend | Default NodePort for local clusters; switch to LoadBalancer or ingress in managed clouds. |
backend-deployment.yaml |
Django/REST backend deployment | Consumes moodify-backend image and ConfigMap values; update environment variables per environment. |
backend-service.yaml |
Internal service for backend traffic | ClusterIP for intra-cluster access from the frontend and workers. |
configmap.yaml |
Shared non-secret configuration | Overrides runtime settings without rebuilding images. |
flowchart TB
User((End Users))
subgraph Cluster[Kubernetes Cluster]
direction TB
subgraph Ingress[Ingress Layer]
IngressCtrl[Ingress Controller / L7 LB]
end
subgraph Services[Service Plane]
FEsvc[frontend-service\nNodePort/LoadBalancer]
BEsvc[backend-service\nClusterIP]
Config[ConfigMap / Secrets]
end
subgraph Workloads[Deployments]
subgraph Frontend
FE1[Frontend Pod]
FE2[Frontend Pod]
end
subgraph Backend
BE1[Backend Pod]
BE2[Backend Pod]
end
subgraph Optional[Optional Workloads]
AI[AI/ML Pods]
Workers[Celery Workers]
end
end
subgraph External[Managed Data Services]
Redis[(Redis / ElastiCache / Memorystore)]
Mongo[(MongoDB / DocumentDB / Firestore)]
Storage[(Object Storage: S3 / Cloud Storage)]
end
end
User -->|HTTPS| IngressCtrl
IngressCtrl --> FEsvc
FEsvc --> Frontend
Frontend --> BEsvc
BEsvc --> Backend
Backend --> External
Optional --> External
Config --> Frontend
Config --> Backend
class Optional optional;
class External external;
classDef optional stroke-dasharray:5 5,fill:#f4f6fb;
classDef external stroke:#1b5e20,fill:#e8f5e9;
| Environment | Cluster Provisioning | Obtaining kubeconfig |
Reference |
|---|---|---|---|
| Local development | Kind / Minikube / Docker Desktop | kind get kubeconfig or minikube kubectl -- get pods |
Maintain parity with production for quick iteration. |
| AWS Production | EKS via Terraform modules | aws eks update-kubeconfig --name moodify-production-eks |
See ../aws/README.md for Terraform and ECR bootstrap. |
| GCP Production | GKE via Terraform modules | gcloud container clusters get-credentials moodify-production-gke --region us-central1 |
See ../gcp/README.md for node pool and Artifact Registry guidance. |
kubectl v1.27+ configured for the target cluster.kubectl create namespace moodify-production).docker build -t moodify-frontend:latest ../frontend
docker build -t moodify-backend:latest ../backend
kubectl config use-context kind-moodify
kubectl create namespace moodify-local
kubectl -n moodify-local apply -f configmap.yaml
kubectl -n moodify-local apply -f backend-deployment.yaml
kubectl -n moodify-local apply -f backend-service.yaml
kubectl -n moodify-local apply -f frontend-deployment.yaml
kubectl -n moodify-local apply -f frontend-service.yaml
kubectl -n moodify-local get pods,svc
kubectl -n moodify-local port-forward svc/frontend-service 3001:3001
Tip: The provided deployments mount code via
hostPathto accelerate local development. Replace these with persistent volumes or baked images before running in managed clusters.
image: fields to point to the registry promoted by your CI pipeline, for example 123456789012.dkr.ecr.us-east-1.amazonaws.com/moodify-frontend:2025.10.07.../DEPLOYMENT.md (moodify-staging, moodify-production).Ingress manifest referencing the cluster-specific ingress class.image tag on the live deployment. Keep .spec.strategy.type as RollingUpdate or introduce additional canary deployments if you need finer control.NodePort with LoadBalancer or reference the AWS Load Balancer Controller ingress specified in ../aws/terraform.kubectl manifests.kubectl annotate deployment frontend-deployment cloud.google.com/neg-status=true only if you rely on native container-native load balancing.../gcp/README.md.configmap.yaml or create environment-specific overlays.
kubectl -n moodify-production apply -f configmap.yaml
kubectl -n moodify-production create secret generic moodify-secrets \
--from-literal=DJANGO_SECRET_KEY=changeme \
--from-literal=SPOTIFY_CLIENT_ID=... \
--from-literal=SPOTIFY_CLIENT_SECRET=...
envFrom or explicit valueFrom. Extend the existing deployment manifests as needed.hostPath with PersistentVolumeClaim definitions backed by EBS (AWS) or Persistent Disks (GCP) for any component that needs durable storage.kubectl autoscale deployment backend-deployment \
--cpu-percent=70 --min=3 --max=10 -n moodify-production
../aws/terraform node groups, ../gcp/terraform node pools).../DEPLOYMENT.md.sequenceDiagram
participant Dev as Developer
participant Git as Git Provider
participant CI as Jenkins Pipeline
participant Registry as Container Registry
participant EKS as AWS EKS
participant GKE as GCP GKE
Dev->>Git: Push feature / tag
Git->>CI: Trigger pipeline
CI->>CI: Build, lint, test
CI->>Registry: Push versioned frontend & backend images
CI->>EKS: kubectl apply -f kubernetes/ (staging ➜ production)
CI->>GKE: kubectl apply -f kubernetes/ (staging ➜ production)
EKS-->>CI: Rollout status
GKE-->>CI: Rollout status
CI-->>Dev: Notify via Slack/Email
kubectl -n moodify-production get deploy -o widekubectl -n moodify-production rollout status deploy/frontend-deploymentkubectl -n moodify-production logs deploy/backend-deployment -fkubectl -n moodify-production create job --from=cronjob/smoke-tester smoke-on-demandkubectl -n moodify-production rollout undo deploy/backend-deployment../README.md and architecture deep dive in ../ARCHITECTURE.md.../DEPLOYMENT.md.../aws/README.md and ../gcp/README.md.../openapi.yaml for confirming service contracts post-deploy.Keeping the Kubernetes manifests aligned with these guides ensures Moodify behaves consistently across clouds, environments, and release cadence.