This project is a simple movie review application built using Next.js for the frontend and Express.js for the backend. It's deployed using Kubernetes and includes Keycloak for authentication and PostgreSQL for data storage. This project was made as final for "Technologie Chmurowe" class at University of Gdańsk. App won't work as intended because deployment doesn't automatically set up keycloak service config until I update it. Before that it's more of a display of my ability to use Kubernetes and Docker at basic level.
The application consists of the following components:
- Frontend: Next.js application
- Backend: Express.js API
- Authentication: Keycloak
- Database: PostgreSQL
- Deployment: Kubernetes (Minikube for local development)
- Docker
- Minikube
- kubectl
-
Clone the repository:
git clone https://github.com/kruczys/keycloak-k8s-app.git cd keycloak-k8s-app
-
Start Minikube:
minikube start
-
Apply Kubernetes configurations:
kubectl apply -f k8s/
-
Wait for all pods to be ready:
kubectl get pods --watch
-
Set up port forwarding for accessing the application:
chmod +x port-forward.sh ./port-forward.sh
-
Access the application:
- Frontend: https://localhost:3000
- Backend API: https://localhost:3001
- Keycloak: https://localhost:8080
The application is deployed using Kubernetes. The k8s
folder contains all necessary Kubernetes configuration files:
backend-deployment.yaml
: Deployment for the Express.js backendbackend-service.yaml
: Service setup for backendconfigmap.yaml
: Configuration mapfrontend-deployment.yaml
: Deployment for the Next.js frontendfrontend-service.yaml
: Service setup for frontendhpa.yaml
: Configuration for Horizontal Pod Autoscalerkeycloak-deployment.yaml
: Deployment for Keycloak authentication serverkeycloak-pvc.yaml
: Configuration for keycloak service Persistent Volume Claimkeycloak-service.yaml
: Service setup for keycloakpostgres-deployment.yaml
: Deployment for PostgreSQL databasepostgres-pvc.yaml
: Configuration for postgres seruvce Persistent Volume Claimpostgres-service.yaml
: Service setup for postgressecret.yaml
: Secrets map