This repository contains instructions for deploying a media sharing application in a Kubernetes (k8s) cluster. The application is structured using Kubernetes resources such as Deployments, Services, PersistentVolumes (PVs), PersistentVolumeClaims (PVCs), and ConfigMaps. Here's an overview of each component and its role within the application:
- Manages MongoDB for storing media and metadata.
- Ensures data persistence and availability using PersistentVolumes (PVs) and PersistentVolumeClaims (PVCs).
- Frontend built with React.
- Configured via
react-app-configConfigMap to specify environment-specific variables like API URLs. - Accessible externally through a NodePort Service (
react-service).
-
db-service:
- Provides internal cluster communication for the MongoDB database.
-
react-service:
- Exposes the React frontend to external users via NodePort (
react-service).
- Exposes the React frontend to external users via NodePort (
-
nodejs-service:
- Backend service supporting media uploads, metadata storage, and retrieval.
- Exposed via NodePort (
nodejs-service).
Follow these steps to deploy the media sharing application in your Kubernetes cluster:
-
Configure ConfigMap:
- Define
react-app-configto set API URLs and other configurations.
- Define
-
Deploy Components:
- Apply YAML manifests for
db-deployment,react-app, andnodejs-deployment.
- Apply YAML manifests for
-
PersistentVolumes (PVs) and PersistentVolumeClaims (PVCs):
- Ensure PV and PVC configurations are set up for MongoDB data persistence.
-
Services:
- Expose
react-serviceandnodejs-serviceusing NodePort for external accessibility.
- Expose
-
Access the Application:
- Access the React frontend via the NodePort Service endpoint.
- Interact with the media sharing application to manage media content.
-
Navigate to directory:
-
Start Minikube:
run
minikube startto start the minikube cluster. -
Apply the files to the cluster:
run
kubectl apply -f .to deploy the services. -
Start the servies:
Execute
minikube service react-serviceto run the react app service.Execute
minikube service web-serviceto run the backend server service.
