Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caching in kubernetes

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

like image 305
AMIT KUMAR Avatar asked Apr 16 '19 10:04

AMIT KUMAR


People also ask

Does Kubernetes have cache?

Kubernetes itself doesn't cache the images, it is the underlying OCI runtime that does the caching.

What is CoreDNS in Kubernetes?

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.

What is memory limit in Kubernetes?

Each container has a limit of 0.5 CPU and 128MiB of memory.

How much RAM do I need for Kubernetes?

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.


1 Answers

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).

like image 89
Janshair Khan Avatar answered Oct 12 '22 21:10

Janshair Khan