Para excluir um ambiente corretamente, é preciso fazer várias alterações de configuração
e aplicá-las ao cluster. Essas alterações incluem remover a definição de ambiente do arquivo de modificações, excluir os componentes synchronizer, runtime e udca e, por fim, reaplicar as 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 do ambiente test de envs, deixando apenas a definição 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 do elemento envs. 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 documentation outlines the process for deleting environments in Apigee hybrid version 1.1, which is now end-of-life, advising users to upgrade to a newer version.\u003c/p\u003e\n"],["\u003cp\u003eDeleting an environment involves multiple steps, including modifying the overrides file, removing the environment definition, and deleting the \u003ccode\u003esynchronizer\u003c/code\u003e, \u003ccode\u003eruntime\u003c/code\u003e, and \u003ccode\u003eudca\u003c/code\u003e components.\u003c/p\u003e\n"],["\u003cp\u003eTo remove the \u003ccode\u003eprod\u003c/code\u003e environment, a new overrides file must be created and utilized, and the \u003ccode\u003etest\u003c/code\u003e environment definition should be temporarily isolated in this file, followed by its re-inclusion in the original file.\u003c/p\u003e\n"],["\u003cp\u003eThe deletion process involves running specific \u003ccode\u003eapigeectl\u003c/code\u003e commands to delete specified components and reapply configurations to remove all traces of the deleted environment.\u003c/p\u003e\n"],["\u003cp\u003eAfter the command-line steps are completed, you must also update the environments in the hybrid UI by going to the Apigee UI and following the proper deletion procedure there.\u003c/p\u003e\n"]]],[],null,["# Delete environments\n\n| You are currently viewing version 1.1 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 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...\nenvs:\n - name: test\n sslCertPath: \"your_certpath/ingress-cert.crt\"\n sslKeyPath: \"your_keypath/ingress-key.key\"\n hostAlias: \"apitest.example.com\"\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n - name: prod\n sslCertPath: \"your_certpath/ingress-cert.crt\"\n sslKeyPath: \"your_keypath/ingress-key.key\"\n hostAlias: \"apiprod.example.com\"\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`, leaving only the **prod** definition. For example: \n\n ```\n ...\n envs:\n - name: prod\n sslCertPath: \"your_certpath/ingress-cert.crt\"\n sslKeyPath: \"your_keypath/ingress-key.key\"\n hostAlias: \"apitest.example.com\"\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\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 envs:\n - name: prod\n sslCertPath: \"your_certpath/ingress-cert.crt\"\n sslKeyPath: \"your_keypath/ingress-key.key\"\n hostAlias: \"apitest.example.com\"\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\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\n \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` element. 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 prod-delete.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.1/manage-environments#delete)."]]