4
Ezard
3y

Infrastructure as Code is all fun and games until you end up needing asymmetric environments (as in, staging contains different services to production, that kind of thing) for cost-saving reasons...

Comments
  • 0
    Can you give an example of this?
  • 1
    @sariel so we have 1 Google Cloud project per environment, with at least 3 environments (QA, staging, production - sometimes there are more if needed) per client

    Each project contains its own "cheap" services, like logging, PubSub, etc

    But there's only a single K8s cluster, which sits in the production environment, and actually orchestrates the containers for all environments (each environment gets its own namespace). Because of this, all of the database servers are also in the production project - we usually have a single "non-prod" DB server (which contains individual databases for QA, staging, etc), and then a separate DB server for production (which is usually beefier, has replicas, etc)

    It's basically the difference between the bill for each client being £100 vs £300

    These clients are usually very-early startups, and that extra money is usually directed towards new features
  • 1
    (yes, K8s is a bit overkill for this, but it helps keep things standardised across all clients regardless of their size, and allows for easy scaling if any client starts to do really well)
  • 0
    @Ezard at my company we use the same stack but leverage smaller instances. This way the architecture is the same across all environments just not as performant.

    Since these environments only handle around 50 users vs 50,000 it's not nearly as costly.

    Also, didn't terraform just recently release if logic for this exact use case?
  • 0
    *TerraGrunt has entered the chat*
Add Comment