I'm paying over $300/month for Kubernetes to have CI/CD in GitLab. And it only covers web apps, Android apps and deployment to Google Cloud. Plus some staging environments, that do not require many resources and that I'm using rarely. It doesn't cover CD to Apple App Store though.

I'm curious if there is a way to optimize this? Maybe I should buy some hardware or optimize Google Cloud somehow?

  • What type of nodes are you using and how many do you have? Services like Digital Ocean and Linode have lower cost Kubernetes offerings.
    – casey vega
    Commented Oct 8, 2019 at 3:19

2 Answers 2


Given that you mentioned rarely using some k8s resources, you could explore some alternatives:

  • With gcloud SDK you could create scripts to be executed for the periods you want to reduce GKE nodes (even to zero) during periods you're not using it
  • With Google Cloud Functions (GCF) you can create some python/Node.js/Go script to access GKE APIs and also execute the operations to stop/reduce your instances. These GCF could be triggered by schedulers configured by Cloud Scheduler. The cost here for such executions will be really low or even zero.
  • Try to use only n1-standard-1 nodes and let the autoscaler do it's magic.
  • If you can accept some downtime (and eventually some failures of the CI/CD jobs that should be fixed when you retry) you can use preemptible nodes.
  • Migrate stateless apps to Cloud Run.
  • Follow this guide to reduce resource consumption on your cluster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.