chapter three

3 Environment Management

 

This chapter covers:

  • What is an environment?
  • Designing the “right for me” environment using namespaces
  • How to organize your Git repo/branching strategy to support your environment
  • How to implement Config Management for your environment

In Chapter 2, you learned how GitOps can deploy applications to a runtime environment. In this chapter, we learn more about those different runtime environments and how Kubernetes namespaces can define environment boundaries. We also learn about several configuration management tools (Helm, Kustomize, and Jsonnet) and how they can help consistently manage an application's configuration in multiple environments.

We recommend you read chapters 1 and 2 before reading this chapter.

3.1   Introduction to Environment Management

In software deployment, an environment is where code is deployed and executed. Different environments serve different purposes in the life cycle of software development. For example, a local development environment (aka laptop) is where engineers can create, test, and debug new versions of code. After engineers complete the code development, the next step is to commit the changes to Git and kick off a deployment to additional environments for integration testing and eventual production release. This process is known as Continuous Integration/Continuous Deployment (CI/CD) that typically consists of the following environments: QA, E2E, Stage, and Prod.

3.1.1   Components of an environment

3.1.2   Namespace Management

3.1.3   Network isolation

3.1.4   Pre-prod and Prod Clusters

3.2   Git Strategies

3.2.1   Single branch (multiple directories)

3.2.2   Multiple branches

3.2.3   Multiple repos vs. Monorepo

3.3   Configuration Management

3.3.1   Helm

3.3.2   Kustomize

3.3.3   Jsonnet

3.3.4   Configuration Management Summary

3.4   Durable vs. Ephemeral Environments

3.5   Summary