fix: notification failing in kubernetes#54
Conversation
Hi @cidopenup0 Thanks for creating a PR for your Issue!
|
| DB_NAME: empdir | ||
| JWT_EXPIRATION_MS: "86400000" | ||
| NOTIFICATION_SERVICE_URL: http://api.microforge.manojm.site | ||
| NOTIFICATION_SERVICE_URL: http://notification-service:8083 |
There was a problem hiding this comment.
@Manoj-14 i have tried to add ip of ingress-nginx-controller cluster IP but this is considered as bad practice so i consider the old http://notification-service:8083 way as better option and using service names is standard practice for service to service communication
spec:
+ hostAliases:
+ - ip: "10.102.83.6" # ingress-nginx-controller ClusterIP
+ hostnames:
+ - "api.microforge.manojm.site"There was a problem hiding this comment.
I worked on it but it not worked for some cases when it is mapped to dns resolver so please update the url
There was a problem hiding this comment.
ip is dynamic, so have to update it manually when the k8s namespace gets created
that is why i have been suggesting http://notification-service:8083 thingy
check the comment please |
|
@Manoj-14 any updates??? |
📌 Description
This PR fixes the notification service failure in the Kubernetes deployment by correcting configuration mismatches and missing secrets.
What does this PR do?
Why is this change needed?
The notification service was unable to connect to its database and receive events due to incorrect database configuration, missing authentication credentials, and improper inter-service communication. These issues prevented notifications from being stored and delivered in the Kubernetes environment.
🔗 Related Issue
Fixes #52
🛠️ Type of Change
Please mark the relevant option:
🧪 How Was This Tested?
Verification steps:
Confirmed all pods are running in the microforge-dev-ns namespace
Checked notification service logs for database connection errors
Verified internal service discovery using Kubernetes DNS
Tested
/api/notificationsendpoint using an in-cluster curl podConfirmed notifications are triggered on user login/registration events
Docker Compose runs successfully
Frontend loads correctly
Service builds without errors
Documentation renders correctly
Manual testing
📸 Screenshots
✅ Checklist
Please confirm the following:
📝 Additional Notes
Nothing