Chapter 21. Immutable Configuration
The Immutable Configuration pattern offers two ways to make configuration data immutable so that your application’s configuration is always in a well-known and recorded state. With this pattern, we can not only use immutable and versioned configuration data, but also overcome the size limitation of configuration data stored in environment variables or ConfigMaps.
Problem
As you saw in Chapter 19, “EnvVar Configuration”, environment variables provide a simple way to configure container-based applications. And although they are easy to use and universally supported, as soon as the number of environment variables exceeds a certain threshold, managing them becomes hard.
This complexity can be handled to some degree by using Configuration Resources, as described in Chapter 20, “Configuration Resource”, which since Kubernetes 1.21 can be declared as immutable. However, ConfigMaps still have a size limitation, so if you work with large configuration data (like precomputed data models in a machine learning context), then ConfigMaps are not suitable even when marked as immutable.
Immutability here means that we can’t change the configuration after the application has started, in order to ensure that we always have a well-defined state for our configuration data. In addition, immutable configuration can be put under version control and follow a change control process.
Solution
There are several options to address the concern of configuration immutability. ...
Get Kubernetes Patterns, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.