Caching server in Docker container orchestrated in

2019-08-16 17:03发布

问题:

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.

回答1:

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.