In diesem Thema wird erläutert, wie Sie Umgebungen löschen. Eine Einführung finden Sie unter Umgebungen und Umgebungsgruppen.
Informationen zum Löschen von Umgebungen
Um eine Umgebung ordnungsgemäß zu löschen, müssen Sie mehrere Konfigurationsänderungen vornehmen und diese auf Ihren Cluster anwenden. Dazu gehören das Entfernen der Umgebungsvariablen und Verweise darauf aus der Überschreibungsdatei, das Löschen der synchronizer-, runtime- und udca-Komponenten und das Anwenden der Überschreibungen zum Wiederherstellen des Clusters, ohne die Umgebung, die Sie löschen möchten.
Sie können die Umgebung nicht nur in einem Schritt löschen, da die anderen Elemente synchronizer, runtime und udca über ihre internen Konfigurationen mit jeder Umgebung verbunden sind. Sie können eine Umgebung nur löschen, wenn Sie sie löschen und neu anwenden.
So löschen Sie eine Umgebung
Angenommen, Sie haben zwei Umgebungen test und prod. Die Definitionen in der Überschreibungendatei könnten in etwa so aussehen:
Kopieren Sie die ursprüngliche Überschreibungendatei (die sowohl die prod- als auch die test-Umgebungsvariablen enthält) in eine neue Datei mit dem Namen prod-delete.yaml.
Öffnen Sie prod-delete.yaml.
Löschen Sie die Umgebungsdefinition test aus envs und virtualhosts und lassen Sie nur die prod-Definitionen bestehen. Beispiel:
Öffnen Sie die ursprüngliche Überschreibungsdatei (die sowohl die Test- als auch die Prod-Umgebungsdefinitionen enthält).
Löschen Sie die Umgebungsdefinition prod aus den Elementen envs und virtualhosts. Es soll nur die test-Umgebungsdefinition in der Datei vorhanden sein.
Wenden Sie die geänderte Überschreibungen-Datei auf Ihren Cluster an. Mit diesem Befehl werden die gelöschten Elemente noch einmal erstellt. Da sie weggelassen wird, erstellen Sie die Umgebung prod nicht neu.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (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)."]]