Part IV. Configuration Patterns
Every application needs to be configured, and the easiest way to do this is by storing configurations in the source code. However, this approach has the side effect of code and configuration living and dying together. We need the flexibility to adapt configurations without modifying the application and recreating its container image. In fact, mixing code and configuration is an antipattern for a continuous delivery approach, where the application is created once and then moves unaltered through the various stages of the deployment pipeline until it reaches production. The way to achieve this separation of code and configuration is by using external configuration data, which is different for each environment. The patterns in the following chapters are all about customizing and adapting applications with external configurations for various environments:
-
Chapter 19, “EnvVar Configuration”, uses environment variables to store configuration data.
-
Chapter 20, “Configuration Resource”, uses Kubernetes resources like ConfigMaps or Secrets to store configuration information.
-
Chapter 21, “Immutable Configuration”, brings immutability to large configuration sets by putting them into containers linked to the application at runtime.
-
Chapter 22, “Configuration Template”, is useful when large configuration files need to be managed for multiple environments that differ only slightly.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access