I'm exploring Kustomize. I see how it is used to create base configuration files and patches to customize specific settings for different environments, such as Dev, Test, Prod. Can it be used to patch across multiple dimensions?
My project consists of multiple applications running in Kubernetes. I'd like to be able specify base settings and be able to tweak them in some cases based on environment, in some cases based on application, and in some cases both. Right now, I've got completely separate full configuration files for each environment/app combination, with huge amounts of dupliation. As simple examples of what I'm looking for:
- There are values that are common across the entire project, such as the URL of the Splunk collector.
- For logging to Splunk, there's an environment variable that specifies which index to log events to. For Dev and Test, events are added to a "sandbox" index, from which events are purged after two weeks. For Prod, they're logged to an index specific to our project, where the retention period is three months. So I'd like to be able to patch that variable according to the environment--the basic use case for Kustomize.
- Also for logging to Splunk, there's an environment variable that specifies the value of an APP_NAME field to be added to each log entry. (While application-specific values can mostly be set within the application, suppose this value will be used for purposes external to the application as well.) So I'd like to patch that variable according to the application.
- I'd like to be able to set minReplicas and maxReplicas for every environment/application combination independently. In addition, as each app has its own Dev, Test, and Prod databases, each environment/application combination has its own database connection string stored as an environment variable.
Can Kustomize handle this? Can someone point me to a resource illustrating a multi-dimension scenario? If there is one, I haven't managed to come up with a search string that leads me to it.