GKE is an awesome service provided by Google which allows you to easily setup a fully managed Kubernetes cluster. The one downside is that the price structure can be fairly confusing and you can spend lots of money without knowing it. Below are a couple tips I’ve learned which will help you cut down on your GKE bill!
Ingress over Load Balancer
One of the biggest money saving is by using an Ingress instead of Load Balancer. If you have 5 microservices and each has
Using a reverse proxy can be useful in greatly decreasing your GKE bill. A reverse proxy will reduce the number of ingress rules by adding a small bit of routing logic to a container. A great example of how to create a reverse proxy with Nginx is here. You can also use something like HAProxy if you need extra performance. A general overview of how it would work is you have a proxy container running Nginx or HAProxy which contains instructions to route certain paths to different microservices.
/auth ---> http://auth-service.prod /search ---> http://search-service.prod
One of the best ways to reduce
The easiest way to save money is by committing to using a certain amount of resources for an extended amount of time. Obviously there is some risk to this because you are committing for between 1 and 3 years, but the discounts are very good!
CPU is 11% cheaper per vCPU month
Ram is 11% cheaper per GB month
CPU is 55.5% cheaper per vCPU month
Ram is 55.5% cheaper per GB month
Hope these tips help you reduce your GKE bill! If I missed any techniques you use I’d love to hear about them in the comment section below.