4 ms·
Not FAANG but for small to medium "cloud native" businesses I like to use this approach with minimal dependencies: Managed Kubernetes cluster such as GKE for e
by caleblloyd 7y ago
Not FAANG but for small to medium "cloud native" businesses I like to use this approach with minimal dependencies:
Managed Kubernetes cluster such as GKE for each environment, setup in cloud provider UI since this is not done often. If you automate it with terraform chances are next time you run it, the cloud provider has subtly changed some options and your automation is out-of-date.
Cluster services repository with Helm charts for ingress controller, centralized logging and monitoring, etc. Use a values-${env}.yaml for environment differences. Deploy with CI service such as Jenkins.
Configuration repository for each application with Helm Chart. If it's an app with one service or all services in a single repo this can go in the same repo. If it's an app with services across multiple repos, create a new repo. Use a values-${env}.yaml for environment differences. Deploy with CI service such as Jenkins.
Store secrets in cloud secrets manager and interpolate to Kubernetes secrets at deploy time.
Cloud provider keeps the cluster and VMs up-to-date, CI pipelines do the builds and deployments. No terraform/ansible/other required. Again, this only works for "cloud native" models.
- nickthemagicman 7y agoYeah, in a decent architecture the only place state is located is in the datastore layer. The goal is to make servers disposable, able to be destroyed and created at will, so configuration management becomes kind of a legacy technology at that point.
- polcia 7y agoYes, but created from what? This can be called config mgmt too.
- caleblloyd 7y agoFor traditional datastore, I usually do: Dev/QA/Similar: Either containerize and back to persistent volume, or use a managed DB service such as RDS or Cloud SQL and create a schema per environment. Include a deployment pipeline argument to reset to known state. CI pipeline can be tuned to handling dynamic environments in either case. Stage/Prod: Use managed DB service such as RDS or Cloud SQL. The time and cost to automate a DB upgrade with every edge case considered is huge. Rarely makes sense for small/medium business.
- saber6 7y agoNitpick: I really don't suggest a divergence in the DB/stack-of-choice between Dev/QA/Stage/Prod. I've chased so many issues that were in the planning process dismissed as "yeah that's an edge case and most likely won't happen". The reasons I've seen for doing so are usually penny-wise, pound-foolish. Penny-wise in saving a few dollars (conceptually) on a spreadsheet for per-env/per-cycle, while neglecting the long-tail consequence of your labor factor just growing, potentially forever, without regard for total cost of ownership. Sorry didn't mean to rant. Hope this helps.
- asey 7y agoOur setup is quite similar to this. Some differences - each environment is represented as a helm parent chart with each application being a child chart. Each environment chart has it's own repo where values.yaml supplies environment specific overrides for each application. Each application has its own repo where the helm charts and application source both reside.
- DelightOne 7y agoAre you using Jenkins or Jenkins X for the deployment?
- caleblloyd 7y agoNormal Jenkins, with a shared library [1] to track service versions and inject the latest deployable version in the deployment pipeline. [1] https://github.com/boxboat/dockhand https://github.com/boxboat/dockhand
- igetspam 7y agoSimilar to what I've done. Applications have a unique source repo. Each rep has a build dir. Build dir contains a sundir for docker build, terraform configs (if needed) for dependent infrastructure and a helm chart for deploy. I have a few things that don't fit the microservice pattern. They are terraform first (root of repo is TF code) and they have a build dir to define the next steps (mostly packer). As I'm writing this, I think I need to change that and make the top level a README.md file and use the build dir pattern to be consistent.