About environments

You are currently viewing version 1.12 of the Apigee hybrid documentation.This version is end of life. You should upgrade to a newer version. For more information, seeSupported versions.

Anenvironment provides an isolated context or "sandbox" for running API proxies. In a single organization, you can create multiple environments.

The following code shows an example override configuration where multiple environments are defined.

namespace:my-namespaceorg:my-organization...envs:-name:testserviceAccountPaths:synchronizer:"your_keypath/synchronizer-manager-service-account.json      udca: "your_keypath/analytic-agent-service-account.json-name:prodserviceAccountPaths:synchronizer:"your_keypath/synchronizer-manager-service-account.json      udca: "your_keypath/analytic-agent-service-account.json...

Suppose a proxy with the base path/foo1 is deployed to environmenttest. You could call the proxy like this:

curl -k https://api.example.com/foo1

When this call hits the ingress, the ingress knows to send it to the message processor associated with thetest environment, which handles the request.

Similarly, iffoo1 is also deployed to theprod environment, you could make a proxy request like this, to the host aliasapiprod.mydomain.net:

curl -k https://apiprod.example.com/foo1

And the call is routed by the ingress to the MP associated with that host.

NOTE On a request to an API proxy, the ingress compares theHost header of the incoming request to the list of host aliases to determine which virtual host handles the request.curl commands, browsers, and many other utilities automatically set theHost header with the domain of the request. If for any reason your app is not setting theHost header automatically, you must set it manually.

Antipattern: Deploy all of your proxies to one hybrid environment.

Best practice: Create multiple environments and deploy a limited number of proxies to each one.

Limit the number of proxy deployments

For hybrid, the fact that many environments can share the same virtual hosts as defined in environment groups means that you must think carefully about how you manage your proxy deployments to any given environment. In hybrid, the best practice is to create multiple environments and deploy a limited number of proxies to each one.

How many proxies should you deploy to an environment? There is not a set answer to this question; however, the following table provides general guidance on why it's a good idea to limit the number of proxies deployed to each environment and what you need to think about when managing proxy deployments:

NOTE:When deciding how many proxies to deployto an environment, be sure to consider the product configuration limits described inLimits.
Issue to considerDescription
Message processor boot-up time There is a direct correlation between the amount of time a message processor (MP) takes to boot up and the number of proxies deployed to that MP. In an auto-scaling Kubernetes environment, an increase in boot time might be a problem. The more proxies that are deployed to the MP, the longer it will take for that MP to come up if it needs to be scaled or recreated.
Scaling performance If you have several proxies deployed to an environment, and one of the proxies gets a lot of traffic so that it frequently auto-scales, all of the proxies in that environment will scale with it. The performance effect of scaling multiple proxies with a single high-traffic proxy might be a problem.
Noisy neighbor If you have several proxies deployed to the same environment, and one proxy crashes, then all of the proxies in the environment will be taken down while the MPs restart. By limiting the number of proxies deployed to an environment, you minimize the impact of a single proxy crashing.

Environment groups and virtualhosts

Environment groups allow you to group environments together. Environments within each group share the same hostnames. You can group environments by function, by hostname address, by region if you are implementing a multi-region hybrid installation, or by any other metric you choose.

Because routing is managed by the combination of environment group hostnames, API proxy base paths, and environments, each virtual host only needs to list the name of the environment group and any appropriate certs.

The following code shows an example override configuration where multiple virtualhosts are defined. Note that name of the virtualhosts must be the names of the environment groups.

gcp:region:us-central1projectID:hybrid-examplek8sCluster:name:apigee-hybridregion:us-central1org:hybrid-examplecontractProvider:https://us-apigee.googleapis.com#ifusingdataresidencyinstanceID:"my_hybrid_example"virtualhosts:-name:group-1#thenameofanenvironmentgroupsslCertPath:./certs/keystore.pemsslKeyPath:./certs/keystore.keyvirtualhosts:-name:group-2sslCertPath:./certs/keystore.pemsslKeyPath:./certs/keystore.key...

Additional resources

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.