This topic explains how to create new environments. For an introduction, see About environments.
About environment creation
Environment creation is a two-step process:
- Create an enviroment in the management plane using either the UI or an Apigee API.
- Add configuration for that environment to your overrides file and apply it to the cluster.
How to create an environment
- Create one or more new environments in the Apigee UI or with the Create environments API. For the basic steps, see Step 5: Add an environment.
Add a new environment definition to the
envsproperty in your overrides file. Note that the property is an array; therefore, you can add more than one environment definition to it. Give the new environment the same name as the one you created in the UI. For example, the following configuration defines two environments: test and prod:
namespace: my-namespace org: my-organization ... envs: - name: test serviceAccountPaths: synchronizer: "your_keypath/synchronizer-manager-service-account.json udca: "your_keypath/analytic-agent-service-account.json - name: prod serviceAccountPaths: synchronizer: "your_keypath/synchronizer-manager-service-account.json udca: "your_keypath/analytic-agent-service-account.json ...
- Add a
virtualhostsproperty that maps its
routingRulesto the environment(s).
virtualhosts: - name: default hostAliases: ["api.example.com"] sslCertPath: ./certs/fullchain.pem sslKeyPath: ./certs/privkey.pem routingRules: - env: test
- Apply any changes to the cluster. If you changed both the
virtualhostsproperties, apply changes with the following command:
apigeectl apply -f overrides-file.yaml -c synchronizer,udca,runtime
If you only change the
virtualhostsproperty, apply those config changes with the
apigeectl apply -f overrides-file.yaml --settings virtualhosts
For more information about virtual host configuration, including how to configure multiple basepath routing rules, see Configure virtual hosts. For a complete list of environment configuration elements, see envs in the Configuration property reference.