Environment Substitution ¶
In a typical environment, a product configuration is moved from server to server. Hostnames, endpoints, DNS information, and more need a way to be easily modified.
By removing literal values and replacing them with environment variables, configurations can be deployed in multiple environments with minimal change.
When templating profiles with variables that reference other products, use the conventions defined in PingBase Image Directory.
All of our configuration files can be parameterized by adding variables using the syntax:
Passing Values to Containers ¶
Within the environment section of your container definition, declare the variable and the value for the product instance.
Values can be defined in many sources, such as inline, env_vars files, and Kubernetes ConfigMaps.
How it Works ¶
A container startup is initiated.
The configuration pulls a server profile from Git or from a bind mounted
All files with a
.substextension are identified.
The environment variables in the identified
.substfiles are replaced with the actual environment values.
.substextension is removed from all the identified files.
The product instance for the container is started.