Duration: ~2 hours Goal: Complete local Kubernetes deployment that was started November 2nd Status: ✅ COMPLETE SUCCESS - All pods running and healthy!
ALL SERVICES RUNNING IN KUBERNETES:
NAME READY STATUS RESTARTS AGE
glorylabs-postgresql-0 1/1 Running 0 10m
glorylabs-recruitment-platform-backend 1/1 Running 0 3m
glorylabs-recruitment-platform-frontend 1/1 Running 0 30s
glorylabs-redis-master-0 1/1 Running 0 10m
Services Created:
service/glorylabs-postgresql ClusterIP 10.111.59.5 5432/TCP
service/glorylabs-recruitment-platform-backend ClusterIP 10.105.234.142 8080/TCP
service/glorylabs-recruitment-platform-frontend ClusterIP 10.102.138.234 80/TCP
service/glorylabs-redis-master ClusterIP 10.102.48.62 6379/TCP
Problem: Backend crashing with "Read-only file system" error when trying to write log files to /tmp
Solution:
logback-spring.xmlbackend-configmap.yaml to set SPRING_PROFILES_ACTIVE=kubernetesFiles Changed:
backend/src/main/resources/logback-spring.xml - Added kubernetes profilehelm/recruitment-platform/templates/backend-configmap.yaml - Added SPRING_PROFILES_ACTIVEProblem: Backend trying to use H2 driver for PostgreSQL URL
Root Cause: Missing SPRING_DATASOURCE_DRIVER_CLASS_NAME environment variable
Solution:
SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver to backend ConfigMapFiles Changed:
helm/recruitment-platform/templates/backend-configmap.yamlProblem: UnknownHostException: recruitment-postgresql
Root Cause: Incorrect hostname in values file (didn't match actual Kubernetes service names)
Solution:
recruitment-postgresql → glorylabs-postgresqlrecruitment-redis-master → glorylabs-redis-masterFiles Changed:
helm/recruitment-platform/values-local.yamlProblem: Kubernetes readiness/liveness probes failing because actuator endpoints required authentication
Root Cause: Security config only allowed /actuator/health/** but Kubernetes was calling /api/actuator/health/**
Solution:
.requestMatchers("/api/actuator/health/**").permitAll() to SecurityConfigFiles Changed:
backend/src/main/java/nl/glorylabs/config/SecurityConfig.javaProblem: Frontend crashing: "host not found in upstream 'glorylabs-recruitment-platform-backend'"
Root Cause: Missing Kubernetes Service resources! Helm templates didn't include service definitions
Solution:
helm/recruitment-platform/templates/backend-service.yamlhelm/recruitment-platform/templates/frontend-service.yamlFiles Created:
helm/recruitment-platform/templates/backend-service.yaml ⭐helm/recruitment-platform/templates/frontend-service.yaml ⭐Problem: ImagePullBackOff for PostgreSQL and Redis (specific Bitnami tags didn't exist)
Solution:
latest tag for both PostgreSQL and Redis in values-local.yamldocker pull bitnami/postgresql:latest and docker pull bitnami/redis:latestFiles Changed:
helm/recruitment-platform/values-local.yamlEnvironment Variables:
SPRING_PROFILES_ACTIVE: kubernetes
SPRING_DATASOURCE_DRIVER_CLASS_NAME: org.postgresql.Driver
SPRING_DATASOURCE_URL: jdbc:postgresql://glorylabs-postgresql:5432/recruitment_local
SPRING_DATASOURCE_USERNAME: recruitment
SPRING_REDIS_HOST: glorylabs-redis-master
SPRING_REDIS_PORT: 6379
postgresql:
enabled: true
image:
repository: bitnami/postgresql
tag: "latest"
auth:
username: recruitment
password: "localpass123"
database: recruitment_local
redis:
enabled: true
image:
repository: bitnami/redis
tag: "latest"
auth:
password: "localredis123"
cd backend
docker build -t recruitment-backend:local .
cd ../frontend/recruitment-portal
docker build --target production -t recruitment-frontend:local .
# Install/Upgrade Helm release
helm upgrade --install glorylabs ./helm/recruitment-platform \
-f ./helm/recruitment-platform/values-local.yaml \
-n glorylabs-local --create-namespace
# Check status
kubectl get pods -n glorylabs-local
kubectl get svc -n glorylabs-local
# View logs
kubectl logs -f deployment/glorylabs-recruitment-platform-backend -n glorylabs-local
kubectl logs -f deployment/glorylabs-recruitment-platform-frontend -n glorylabs-local
# Port-forward frontend
kubectl port-forward -n glorylabs-local svc/glorylabs-recruitment-platform-frontend 4300:80
# Port-forward backend
kubectl port-forward -n glorylabs-local svc/glorylabs-recruitment-platform-backend 8090:8080
# Access application
open http://localhost:4300
# Check backend health
curl http://localhost:8090/api/actuator/health
┌─────────────────────────────────────────────────────────────┐
│ Kubernetes Cluster │
│ (glorylabs-local) │
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Frontend │──────│ Backend │ │
│ │ nginx:80 │ │ Java:8080 │ │
│ └──────────────┘ └──────┬───────┘ │
│ │ │
│ ┌──────┴───────┐ │
│ │ │ │
│ ┌─────▼─────┐ ┌────▼────┐ │
│ │ PostgreSQL │ │ Redis │ │
│ │ :5432 │ │ :6379 │ │
│ └────────────┘ └─────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
helm/recruitment-platform/templates/backend-service.yaml ⭐helm/recruitment-platform/templates/frontend-service.yaml ⭐helm/recruitment-platform/templates/serviceaccount.yamlhelm/recruitment-platform/Chart.lockhelm/recruitment-platform/charts/postgresql-18.1.3.tgzhelm/recruitment-platform/charts/redis-23.2.2.tgzbackend/src/main/java/nl/glorylabs/config/SecurityConfig.javabackend/src/main/resources/logback-spring.xmlbackend/Dockerfilefrontend/recruitment-portal/Dockerfilehelm/recruitment-platform/Chart.yamlhelm/recruitment-platform/templates/backend-configmap.yamlhelm/recruitment-platform/templates/backend-deployment.yamlhelm/recruitment-platform/templates/cv-service-deployment.yamlhelm/recruitment-platform/templates/frontend-deployment.yamlhelm/recruitment-platform/values-local.yamllatest is safer for local devvalues-prod.yaml)bin/SESSION_2025-11-02_K8S_DEPLOYMENT.mdSession End: November 3, 2025 Status: ✅ DEPLOYMENT SUCCESSFUL - Ready for application testing Next Session: Test application functionality and create production deployment config
Reacties