Environment Config is a useful tool for defining Environment-level properties that need to be propagated to many Entities in the Environment. Good candidates for Environment Config properties include those that are intrinsic to the Environment (such as cloud provider or region) and properties of the Environment that need to be referenced across a broad range of Entities (such as DNS name). If a property is only useful for a small subset of Entities in an Environment, consider using config overrides instead.
Environment Config can be updated from the Config tab found on an Environment's home page. It must contain valid YAML configuration and any keys should not contain hyphens, periods, or whitespace. For example, here is a valid configuration:
domainName: my-domain-name.com
numConnectionsAllowed: 5
enableSchedulingConstraints: true
availabilityZones:
- availability-zone-1
- availability-zone-2
namespaces:
defaultNamespace:
name: myNamespace
As with other settings, edits to Environment Config are added via change requests and are subject to the approval policies configured for the Environment. This creates a robust historical record of configuration changes, a clear audit trail for production environments, and opportunities for validation. Once changes to Environment Config have been approved, Apollo will issue a Plan to update the configuration for each Entity that utilizes Environment Config in the Environment.
You can reference Environment Config in your Helm chart templates using Helm's built-in Values
object:
Copied!1
{{ .Values.apollo.environment.<configKey> }}
You should substitute <configKey>
with the key in your Environment Config YAML file.
For example, if you have an entry myKey: myValue
in Environment Config, you can reference this entry using the following syntax:
Copied!1
{{ .Values.apollo.environment.myKey }}
This will be rendered to myValue
when Helm renders the template.
You can also reference Environment Config in your Entity's config overrides with the preprocess
directive:
Copied!1
{{ preprocess .Values.apollo.environment.<configKey> }}
You should substitute <configKey>
with the key in your Environment Config YAML file.
For example, if you have an entry myKey: myValue
in Environment Config, you can reference this entry in your Entity config overrides using the following syntax:
Copied!1
{{ preprocess .Values.apollo.environment.myKey }}
This will be rendered to myValue
when Helm renders the Values
object.