|
|
|
|
|
by cbushko
1375 days ago
|
|
HPAs can definitely save you a lot of money when running Kubernetes and they are extremely useful, especially for non-production environments where you want to be efficient as possible. Strategies I have used in the past for saving money are: 1) Set requests very low for your pods. Look at the minimum CPU/Memory that your pods need go start and set it to that. Limits can be whatever.
2) Set min replicas to 1. This is a non-production environment, nobody cares if an idle pod goes away in the middle of the night.
3) Use spot instances for your cluster nodes. 80% savings is nice!
4) Increase the number of allowed pods per node. GKE sets the default to 110 pods per node but it can be increased.
5) Evaluate your nodes and determine if it makes more sense to have `fewer large sized nodes` or `several smaller nodes`. If you have a lot of daemonsets then maybe it makes sense to have fewer large nodes.
6) Look at the CPU and Memory utilization of your nodes. Are you using a lot of CPU but not much memory? Maybe you need to change the machine type you are using so that you get close(r) to 100% CPU and Memory utilization. You are just wasting money if you are only using 50% of the available memory of your nodes.
7) Use something like knative or KEDA for 'intelligent autoscaling'. I've used both extensively and I found KEDA to be considerably simpler to use. Being able to scale services down to 0 pods is extremely nice!
|
|
Wouldn't this lead to Node Over provisioning?
I ask because my company's workload is very spiky and usage is very minimal until it isn't. We are looking into ways to optimize it.