Para excluir um ambiente corretamente, é preciso fazer várias alterações de configuração
e aplicá-las ao cluster. Essas alterações incluem a remoção da definição do ambiente e
das referências a ele do
arquivo de modificações, a exclusão dos componentes synchronizer, runtime
e udca e, por fim, a reaplicação das modificações para
restaurar o cluster sem
incluir o ambiente que você quer excluir.
Não é possível excluir o ambiente em apenas uma etapa porque os outros elementos,
synchronizer, runtime
e udca estão conectados a cada ambiente por meio das configurações internas. Você só poderá
excluir um ambiente depois de excluí-las e aplicá-las novamente.
Como excluir um ambiente
Suponha que você tenha dois ambientes, test e prod. No
seu arquivo de modificações, as definições podem ter esta aparência:
Copie o arquivo de modificações original (o que contém as definições de ambiente prod
e test),
para um novo arquivo chamado, por exemplo, prod-delete.yaml.
Abra prod-delete.yaml.
Exclua a definição de ambiente test de envs e virtualhosts,
deixando apenas as definições de prod. Por exemplo:
Abra o arquivo de modificação original (que inclui as definições de ambiente de teste
e produção).
Exclua a definição de ambiente prod dos elementos envs e virtualhosts. Você
quer que apenas a definição do ambiente test esteja presente no arquivo.
Aplique o arquivo de modificações modificadas ao cluster. Esse comando recriará os elementos excluídos
e, como ele foi omitido, não recriará o ambiente prod.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-28 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)."]]