Skip to content

Conversation

@huzzzaiffff
Copy link

@huzzzaiffff huzzzaiffff commented Oct 29, 2025

This PR improves the Kubernetes deployment setup by:

Creating separate PersistentVolumes (PV) and PersistentVolumeClaims (PVC) for MongoDB and Redis to avoid conflicts and ensure data isolation.

Fixing the volume mount paths for both MongoDB (/data/db) and Redis (/data/redis), ensuring the pods use the correct directories.

Keeping the deployment ready for production-friendly EKS cluster deployment.

These changes make the storage configuration more robust and prevent data corruption when running MongoDB and Redis on the same cluster.

Summary by CodeRabbit

  • Chores
    • Added dedicated Redis persistent storage (2Gi) for the application.
    • Updated Redis deployment to use the new persistent storage and adjusted its data mount location.
    • Adjusted MongoDB storage configuration to change provisioning behavior.
    • Refined volume references to ensure consistent storage usage across services.

@coderabbitai
Copy link

coderabbitai bot commented Oct 29, 2025

Walkthrough

Remove Mongo PV's volumeMode: Filesystem, remove storageClassName: "" from the Mongo PVC, add Redis PersistentVolume and PersistentVolumeClaim, and update the Redis Deployment to use the new Redis PVC and volume names/mount path.

Changes

Cohort / File(s) Summary
PersistentVolume updates
kubernetes/persistentVolume.yaml
Removed volumeMode: Filesystem from the MongoDB PV; added a new Redis PV redis-pv in namespace wanderlust with capacity: 2Gi, accessModes: ReadWriteOnce, and hostPath: /data/redis.
PersistentVolumeClaim updates
kubernetes/persistentVolumeClaim.yaml
Removed storageClassName: "" from the MongoDB PVC; added a second document for Redis PVC redis-pvc in namespace wanderlust with storage: 2Gi and accessModes: ReadWriteOnce; added a top comment and document separator.
Redis Deployment volume refs
kubernetes/redis.yaml
Renamed volume and mount from mongo-storageredis-storage; updated mountPath to /data/redis; changed volume's persistentVolumeClaim.claimName from mongo-pvcredis-pvc.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify PV and PVC resource names, namespaces, capacities, and accessModes match and bindable.
  • Confirm Redis Deployment volume names, claimName, and mountPath align with the new PVC and Redis container expectations.
  • Ensure removal of volumeMode and storageClassName are intentional and valid for cluster provisioning.

Poem

🐰 I hopped along to tidy stacks,
Swapped mongo tags for redis racks.
A pv here, a pvc there,
Now Redis naps in storage's care. 📦✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Separate PV/PVC for Mongo and Redis + fixed mount paths" is fully related to the main changes in the pull request. The changeset clearly demonstrates both aspects mentioned in the title: separate PersistentVolumes and PersistentVolumeClaims are created for MongoDB and Redis (removing the shared volumeMode and storageClassName configurations while adding new Redis-specific resources), and the mount paths are corrected in the redis.yaml Deployment (updating volumeMounts from mongo-storage to redis-storage with the corrected /data/redis path). The title is concise, specific, and provides clear insight into the primary objectives of the changeset.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 697f3ef and ae4d1c8.

📒 Files selected for processing (2)
  • kubernetes/persistentVolume.yaml (2 hunks)
  • kubernetes/redis.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • kubernetes/persistentVolume.yaml
  • kubernetes/redis.yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d6ff649 and 697f3ef.

📒 Files selected for processing (3)
  • kubernetes/persistentVolume.yaml (2 hunks)
  • kubernetes/persistentVolumeClaim.yaml (2 hunks)
  • kubernetes/redis.yaml (1 hunks)
🔇 Additional comments (4)
kubernetes/persistentVolume.yaml (2)

1-13: Verify MongoDB hostPath aligns with PR objectives.

The MongoDB hostPath is configured as /data/mongo, but the PR objectives specify "MongoDB uses /data/db". Verify whether this deviation is intentional or if the path should match the stated objective.


15-28: Redis PersistentVolume is properly configured.

The Redis PV is correctly separated from MongoDB with appropriate capacity (2Gi) and the hostPath /data/redis matches the PR objectives. Good separation of storage concerns.

kubernetes/persistentVolumeClaim.yaml (2)

1-12: Verify removal of storageClassName from MongoDB PVC is intentional.

The storageClassName: "" was removed from the MongoDB PVC. This explicit configuration prevented dynamic provisioning. Without it, the PVC may attempt to use a default storage class. Verify this change aligns with your cluster's storage configuration and that a suitable storage class exists or that static binding to mongo-pv is guaranteed.


14-26: Redis PersistentVolumeClaim properly configured.

The Redis PVC is correctly created as a separate resource with matching capacity (2Gi) and proper namespace/access mode configuration. The new claim name redis-pvc enables proper separation from MongoDB storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant