Ad

Caching Server In Docker Container Orchestrated In Kubernetes

- 1 answer

I want to implement caching server in a docker container and the whole cluster is orchestrated by kubernetes.

Below is the diagram with the data flow.

Is this setup according to the best practices ? If not then please suggest the best way.

Thanks.

enter image description here

Ad

Answer

I would recommend:

  1. Use Kubernetes Operators or StatefulSets with MongoDB instead of stand-alone MongoDB pod. It is extremely dangerous by putting the MongoDB in a pod without any persistence & replica instance. You can find MongoDB operator here.

  2. Use a separate cache-server in different pods or deployment with master-slave replication for your application. Operators might help you simplify this.

  3. Attach the Load Balancer with the Ingress Controller. We don't treat database pods as applications pods (unless they shared data with each other via external storage service) since they contains data and Service LoadBalancer can forward request to any pod in the deployment object.

This varies depending upon needs and requirements.

Ad
source: stackoverflow.com
Ad