To delete an environment properly, you must make several configuration changes and
apply them to your cluster. These changes include removing the environment definition and
references to it from
your overrides file, deleting the synchronizer, runtime,
and udca components, and finally re-applying your overrides to
restore your cluster without
including the environment you wish to delete.
The reason you can't only delete the environment in one step is because the other elements,
synchronizer, runtime,
and udca are connected to each environment through their internal configurations. Only by
deleting them and re-applying them can you properly delete an environment.
How to delete an environment
Assume that you have two environments, test and prod. In
your overrides file, the definitions might look something like this:
To delete the prod environment, follow these steps:
Copy your original overrides file -- the one that contains both the prod
and test environment definitions --
to a new file called, for example, prod-delete.yaml.
Open prod-delete.yaml.
Delete the test environment definition from envs and virtualhosts,
leaving only the prod definitions. For
example:
Open your original overrides file (the one that includes both the test and prod environment
definitions).
Delete the prod environment definition from the envs and
virtualhosts elements. You
only want the test environment definition to be present in the file.
Apply the modified overrides file to your cluster. This command will recreate the deleted
elements and, because it is omitted, not recreate the prod environment.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eThis document details the process for deleting an environment in Apigee hybrid, which involves multiple steps due to interconnected configurations.\u003c/p\u003e\n"],["\u003cp\u003eDeleting an environment requires removing its definition and references from the overrides file, which include \u003ccode\u003esynchronizer\u003c/code\u003e, \u003ccode\u003eruntime\u003c/code\u003e, and \u003ccode\u003eudca\u003c/code\u003e components.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating a temporary overrides file, deleting specific component definitions, and then applying a modified original file to exclude the environment in question.\u003c/p\u003e\n"],["\u003cp\u003eAfter applying changes in the cluster, you must also delete the environment through the Apigee Hybrid UI to fully remove it from the system.\u003c/p\u003e\n"],["\u003cp\u003eThe current version of the documentation is out of date and should be upgraded to a supported version as noted at the top of the documentation page.\u003c/p\u003e\n"]]],[],null,["# Delete environments\n\n| You are currently viewing version 1.2 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis topic explains how to delete environments. For an introduction, see\n[About environments and environment groups](/apigee/docs/api-platform/fundamentals/environments-overview).\n\nAbout deleting environments\n---------------------------\n\n\nTo delete an environment properly, you must make several configuration changes and\napply them to your cluster. These changes include removing the environment definition and\nreferences to it from\nyour overrides file, deleting the `synchronizer`, `runtime`,\nand `udca` components, and finally re-applying your overrides to\nrestore your cluster without\nincluding the environment you wish to delete.\n\n\nThe reason you can't only delete the environment in one step is because the other elements,\n`synchronizer`, `runtime`,\nand `udca` are connected to each environment through their internal configurations. Only by\ndeleting them and re-applying them can you properly delete an environment.\n\nHow to delete an environment\n----------------------------\n\nAssume that you have two environments, **test** and **prod**. In\nyour overrides file, the definitions might look something like this:\n\n```\n...\nvirtualhosts:\n - name: default-test\n hostAliases: [\"api-test.example.com\"]\n sslCertPath: ./certs/fullchain-test.pem\n sslKeyPath: ./certs/privkey-test.pem\n env: test\n - name: default-prod\n hostAliases: [\"api.example.com\"]\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n env: prod\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 - 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\nTo delete the **prod** environment, follow these steps:\n\n1. Copy your original overrides file -- the one that contains both the **prod** and **test** environment definitions -- to a new file called, for example, `prod-delete.yaml`.\n2. Open `prod-delete.yaml`.\n3. Delete the `test` environment definition from `envs` and `virtualhosts`, leaving only the **prod** definitions. For example: \n\n ```\n ...\n virtualhosts:\n - name: default-prod\n hostAliases: [\"api.example.com\"]\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n env: prod\n ...\n envs:\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 ```\n4. Remove everything else from `prod-delete.yaml` ***except*** the `cassandra` config, if present:\n\n\n After making the above changes, your overrides file should look something\n like this: \n\n ```\n ...\n virtualhosts:\n - name: default-prod\n hostAliases: [\"api.example.com\"]\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n env: prod\n\n envs:\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 cassandra:\n replicaCount: 3\n resources:\n requests:\n cpu: 3500m\n memory: 7Gi\n storage:\n storageClass: pd-ssd\n capacity: 10Gi\n ```\n5. Run this command to delete the specified components: \n\n ```\n apigeectl delete -f prod-delete.yaml -c runtime, udca, synchronizer\n ```\n6. Open your **original** overrides file (the one that includes both the test and prod environment definitions).\n7. Delete the `prod` environment definition from the `envs` and `virtualhosts` elements. You only want the `test` environment definition to be present in the file.\n8. Apply the modified overrides file to your cluster. This command will recreate the deleted elements and, because it is omitted, not recreate the `prod` environment. \n\n ```\n apigeectl apply -f original-overrides.yaml -c runtime, udca, synchronizer\n ```\n9. Save your changes.\n\n10. You're not quite done. You must now update the environments in the hybrid UI.\n11. Open a browser and navigate to the hybrid UI at [Apigee UI](https://apigee.google.com).\n12. Remove the environment using the steps described [Delete an existing environment in the Hybrid UI](/apigee/docs/hybrid/v1.2/manage-environments#delete)."]]