forked from digma-ai/otel-sample-app-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
This issue tracks the necessary changes to fix the MongoDB connectivity issues.
Required Changes
- Create Kubernetes Manifests:
# kubernetes/mongodb.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: petclinic-flaskdb
labels:
app: petclinic-flaskdb
spec:
replicas: 1
selector:
matchLabels:
app: petclinic-flaskdb
template:
metadata:
labels:
app: petclinic-flaskdb
spec:
containers:
- name: mongodb
image: mongo:latest
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_DATABASE
value: "feedbacks"
---
apiVersion: v1
kind: Service
metadata:
name: petclinic-flaskdb
spec:
selector:
app: petclinic-flaskdb
ports:
- protocol: TCP
port: 27017
targetPort: 27017
type: ClusterIP- Update Application Configuration:
- Change connection string from
http://petclinic-flaskdb:27017/feedbackstomongodb://petclinic-flaskdb:27017/feedbacks - Update any hardcoded URLs in the application code
- Deployment Steps:
- Create kubernetes directory in the repository root
- Add the mongodb.yaml manifest
- Update application configuration with correct MongoDB protocol
- Deploy the MongoDB service
- Verify connectivity
Verification Steps
- Check that MongoDB pod is running
- Verify service is accessible within the cluster
- Test the /api/clinic-feedback/count endpoint
- Monitor for connection errors
Related to issue: ff76e9d8-81bc-11f0-8462-168ae57aaddf
Reactions are currently unavailable