[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-18 (世界標準時間)。"],[[["\u003cp\u003eEnvironments serve as isolated sandboxes for running API proxies, and multiple environments can be created within a single organization.\u003c/p\u003e\n"],["\u003cp\u003eDeploying a limited number of proxies to each environment is a best practice, as it improves message processor boot-up time, scaling performance, and reduces the impact of a single proxy crashing.\u003c/p\u003e\n"],["\u003cp\u003eThe number of proxies that can be deployed to a particular environment can vary, but consideration should be given to the message processor boot-up time, the scaling performance, and the risk of a noisy neighbor.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment groups allow the grouping of environments together, with the environments within each group sharing the same hostnames, and can be grouped by various metrics like function, hostname address, or region.\u003c/p\u003e\n"],["\u003cp\u003eThe combination of environment group hostnames, API proxy base paths, and environments manage the routing of API requests, and each virtual host needs only to list the environment group name and any necessary certificates.\u003c/p\u003e\n"]]],[],null,["# About environments\n\n| You are currently viewing version 1.14 of the Apigee hybrid documentation. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\nAn *environment* provides an isolated context or \"sandbox\" for running API proxies.\nIn a single organization, you can create multiple environments.\n\n\nThe following code shows an example override configuration where multiple environments are\ndefined. \n\n```actionscript-3\nnamespace: my-namespace\norg: my-organization\n...\nenvs:\n - name: test\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n\n\n - name: prod\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n...\n```\n| **Note:** See:\n|\n| - [` namespace `](/apigee/docs/hybrid/v1.14/config-prop-ref#namespace)\n| - [`org`](/apigee/docs/hybrid/v1.14/config-prop-ref#org)\n| - [`envs[].name`](/apigee/docs/hybrid/v1.14/config-prop-ref#envs-name)\n| - [`envs[].serviceAccountPaths.synchronizer`](/apigee/docs/hybrid/v1.14/config-prop-ref#envs-serviceaccountpaths-synchronizer)\n| - [`envs[].serviceAccountPaths.udca`](/apigee/docs/hybrid/v1.14/config-prop-ref#envs-saactpaths-udca)\n\n\nSuppose a proxy with the base path `/foo1` is deployed to environment\n**test**. You could call the proxy like this: \n\n```\ncurl -k https://api.example.com/foo1\n```\n\n\nWhen this call hits the ingress, the ingress knows to send it to the message processor\nassociated with the `test` environment, which handles the request.\n\n\nSimilarly, if `foo1` is also deployed to the `prod` environment,\nyou could make a proxy\nrequest like this, to the host alias `apiprod.mydomain.net`: \n\n```\ncurl -k https://apiprod.example.com/foo1\n```\n\n\nAnd the call is routed by the ingress to the MP associated with that host.\n| **NOTE** On a request to an API proxy, the ingress compares the `Host` 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 the `Host` header with the domain of the request. If for any reason your app is not setting the `Host` header automatically, you must set it manually.\n\n\n**Antipattern**: Deploy all of your proxies to one hybrid environment.\n\n\n**Best practice**: Create multiple environments and deploy a limited number of proxies\nto each one.\n\nLimit the number of proxy deployments\n-------------------------------------\n\n\nFor hybrid, the fact that many environments can share the same virtual hosts\nas defined in environment groups means\nthat you must think carefully about how you manage your proxy deployments to any given\nenvironment. In hybrid, the best practice is to create multiple environments and deploy\na limited number of proxies to each one.\n\n\n**How many proxies should you deploy to an environment?** There is not a set answer\nto this question; however, the following table provides general guidance on why it's a\ngood idea to limit the number of proxies deployed to each environment and what you\nneed to think about when managing proxy deployments:\n| **NOTE:** When deciding how many proxies to deploy to an environment, be sure to consider the product configuration limits described in [Limits](/apigee/docs/api-platform/reference/limits#hybrid).\n\nEnvironment groups and virtualhosts\n-----------------------------------\n\n[Environment groups](/apigee/docs/api-platform/fundamentals/environments-overview)\nallow you to group environments together. Environments within each group share\nthe same hostnames. You can group environments by function, by hostname address, by region if you\nare implementing a multi-region hybrid installation, or by any other metric you\nchoose.\n\n\nBecause routing is managed by the combination of environment group hostnames, API proxy base paths,\nand environments, each virtual host only needs to list the name of the environment group and any\nappropriate certs.\n\n\nThe following code shows an example override configuration where multiple virtualhosts are\ndefined. Note that name of the virtualhosts must be the names of the environment groups. \n\n```actionscript-3\ngcp:\n region: us-central1\n projectID: hybrid-example\n\n\nk8sCluster:\n name: apigee-hybrid\n region: us-central1\n\n\norg: hybrid-example\n\ncontractProvider: https://us-apigee.googleapis.com # if using data residency\n\ninstanceID: \"my_hybrid_example\"\n\n\nvirtualhosts:\n - name: group-1 # the name of an environment group\n sslCertPath: ./certs/keystore.pem\n sslKeyPath: ./certs/keystore.key\n\nvirtualhosts:\n - name: group-2\n sslCertPath: ./certs/keystore.pem\n sslKeyPath: ./certs/keystore.key\n...\n```\n| **Note:** See\n|\n| - [gcp-projectID](/apigee/docs/hybrid/v1.14/config-prop-ref#gcp-projectid).\n| - [k8scluster-name](/apigee/docs/hybrid/v1.14/config-prop-ref#k8scluster-name).\n| - [k8scluster-region](/apigee/docs/hybrid/v1.14/config-prop-ref#k8scluster-region).\n| - [instanceid](/apigee/docs/hybrid/v1.14/config-prop-ref#instanceid).\n\nAdditional resources\n--------------------\n\n- [About environments and environment groups](/apigee/docs/api-platform/fundamentals/environments-overview)\n- [Managing environments](/apigee/docs/api-platform/fundamentals/environments-working-with)\n- [Managing environment groups](/apigee/docs/api-platform/fundamentals/environmentgroups-working-with)\n- [Configuration property reference](/apigee/docs/hybrid/v1.14/config-prop-ref#envs)\n- [Configure virtual hosts](/apigee/docs/hybrid/v1.14/base-path-routing)"]]