Cost optimization

How to optimize the CPU and memory for docker, k8s pods and EC2?

Can anyone help me to understand this @kodekloud