I have a NodeJS app deployed as docker container and I am using Kubernetes for orchestration. The load balancing is done by Kubernetes by default.
I want to implement caching for the app.
My Question is: Is it possible to configure the Kubernetes load balancer Proxy to handle the caching also ?
PS: If not then please suggest what is the Best Practice to handle caching in Kubernetes-Docker environment.
Thanks
Kubernetes itself doesn't cache the images, it is the underlying OCI runtime that does the caching.
CoreDNS is a flexible, extensible DNS server that can serve as the Kubernetes cluster DNS. Like Kubernetes, the CoreDNS project is hosted by the CNCF.
Each container has a limit of 0.5 CPU and 128MiB of memory.
Kubernetes cluster capacity 2 nodes: 8 CPU / 32 GB RAM. 4 nodes: 4 CPU / 16 GB RAM. 8 nodes: 2 CPU / 8 GB RAM. 16 nodes: 1 CPU / 4 GB RAM.
Proxy is not used for caching web pages, a cache server (Redis\Memcached) is used for caching web content. Proxy's job is to re-route requests and LoadBalancer has algorithms that it follows for traffic routing i.e. RoundRobin etc.
For this, you have to add a cache server in your application stack in the form of deployment with persistence storage (depending upon your needs).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With