Multiple environments

During a basic installation, you likely set up a single environment for testing. Most Apigee hybrid installations, however, have multiple environments. For example, a common use case is to have a test environment and a production environment.

If you have multiple environments, each one must have its own unique DNS name; for example, the test and prod environments might have the foo-test.mydomain.com and foo-prod.mydomain.com DNS names.

DNS names map to host aliases in a hybrid configuration. If you are familiar with virtual hosts in Apigee Edge, the concept of a host alias in hybrid is similar.

To define multiple environments, therefore, you must define multiple host aliases in the overrides.yaml file. You do this by adding one or more environments to the config object's envs array, as the following example shows:

namespace: namespace
config:
  base64Credentials: encoded_credentials
  envs:
    - orgName: organization_name
      envName: environment_name_1
      hostAlias: DNS_name_1
      sslCertPath: path_to_test_cert
      sslKeyPath: path_to_test_key

    - orgName: organization_name
      envName: environment_name_2
      hostAlias: DNS_name_2
      sslCertPath: path_to_prod_cert
      sslKeyPath: path_to_test_key
...

In addition to defining the orgName and envName properties, you must also specify a host alias and its TLS properties for each environment definition in the envs array.

For testing purposes only, you can use a self-signed certificate, as described in Create a self-signed certificate/key pair.

The following table describes the properties that are required when specifying host aliases for your environments:

Property Value
config.envs.hostAlias

The DNS name for your server. For example, foo-test.mydomain.com. If you don't have a DNS name, you can use a wildcard (*).

If you have multiple environments, you must use a unique host alias name for each one. For example, foo-test.mydomain.com and foo-prod.mydomain.com.

This property is required when configuring a host alias.

config.envs.sslCertPath

The path on your system to a TLS certificate file.

This property is required when configuring a host alias.

config.envs.sslKeyPath

The path on your system to a TLS key file.

This property is required when configuring a host alias.

The following example shows a sample overrides.yaml file with two environments:

namespace: MyNamespace
config:
  base64Credentials: dXNlckBleGFtcGxlLmNvbTphYmMxMjM=
  envs:
    - orgName: MyOrganization
      envName: test
      hostAlias: foo-test.mydomain.com
      sslCertPath: /Users/myhome/ssh/ingress_test_cert.crt
      sslKeyPath: /Users/myhome/ssh/ingress_test_key.key

    - orgName: MyOrganization
      envName: prod
      hostAlias: foo-prod.mydomain.com
      sslCertPath: /Users/myhome/ssh/ingress_prod_cert.crt
      sslKeyPath: /Users/myhome/ssh/ingress_prod_key.key
...