How to prevent the autoscaler from evicting certain pods?

Hello @Kyle_Flavin

Indeed, there is no way for the time being to prevent autoscaler from evicting certain pods.

Indeed annotations might land at some point later on and might allow you to prevent this from happening.
Another feature which might be an option for you will be to use Karpenter and this post (a feature aiming to totally replace autoscaler, with specific annotations, you should be then able to prevent your pod from moving).

Just so you have the background around why we allow the postgres pods to move is to allow the autoscaler to properly optimize your nodes, otherwise, you can eventually waste a lot of resources if you have postgres pods spread across a lot of nodes preventing nodes to be freed. CF this post.

Also, I am assuming you are using container DBs, which are not meant for production, if you need to have something reliable, you should consider moving to managed database via RDS.

Also maybe using larger EC2 instances might help to reduce pod moves eventually (to be tested).

Cheers