kubectl config current-context # Verify the current context is the correct context for the hybrid deployment
apigeectl check-ready -f overrides.yaml # Check the deployment status
apigeectl delete --settings virtualhost -f overrides.yaml
apigeectl check-ready -f overrides.yaml # Check the deployment status
apigeectl delete --all-envs -f overrides.yaml
apigeectl check-ready -f overrides.yaml # Check the deployment status
apigeectl delete --org -f overrides.yaml
apigeectl check-ready -f overrides.yaml # Check the deployment status
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-08-18 (世界標準時間)。"],[[["\u003cp\u003eThis document details the process for decommissioning an organization (org) from an Apigee hybrid deployment, which includes deleting all associated data from Cassandra pods.\u003c/p\u003e\n"],["\u003cp\u003eBefore beginning, ensure that no live traffic is directed towards the org that is scheduled for removal, and note that only one org can be decommissioned at a time.\u003c/p\u003e\n"],["\u003cp\u003eThe process requires backing up the org data, optionally reconfiguring Apigee Telemetry, deleting the org's Kubernetes resources, and removing the org's data from Cassandra pods.\u003c/p\u003e\n"],["\u003cp\u003eOrg names must be properly formatted by replacing dashes with underscores, and the decommissioning procedure involves executing a sequence of \u003ccode\u003ekubectl\u003c/code\u003e and \u003ccode\u003ecqlsh\u003c/code\u003e commands to remove the org and its resources from the deployment.\u003c/p\u003e\n"],["\u003cp\u003eAfter completing the removal of org data and resources from Cassandra, it is mandatory to perform a rolling restart of all Cassandra pods, one at a time, across all regions in a multi-region deployment.\u003c/p\u003e\n"]]],[],null,["# Decommission a hybrid org\n\n| You are currently viewing version 1.10 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 document outlines the steps to decommission an org from a hybrid deployment. Decommissioning\nan org means deleting all data related to the org across all Cassandra pods in all Kubernetes\nclusters.\n| Please ensure there is no live traffic going to the org you plan to remove.\n\nLimitations\n-----------\n\n\nOnly one org can be decommissioned at a time. Decommissioning multiple orgs simultaneously is not\nsupported.\n\nGet the org name\n----------------\n\nSome commands in these instructions require you to use a properly formatted org name.\n\nTo get the org name for use in commands on this page:\n\n\n1. Retrieve the org name from the org's `overrides.yaml` file.\n2. If the org name contains any dashes (\"-\"), replace them with underscores (\"_\").\n\nInstructions\n------------\n\nFollow these instructions to decommission an org from a hybrid deployment.\n\n1. Back up the org\n 1. If it's not already enabled, enable backups on the hybrid deployment. In multi-region setups, use the hybrid deployment operating in the primary region. See [Cassandra backup overview](/apigee/docs/hybrid/v1.10/cassandra-backup-overview) for information on hybrid backups.\n 2. Trigger a hybrid backup job using the following command:\n\n ```\n kubectl create job -n apigee --from=cronjob/apigee-cassandra-backup BACKUP_JOB_NAME\n ```\n\n \u003cbr /\u003e\n\n\n The \u003cvar translate=\"no\"\u003eBACKUP_JOB_NAME\u003c/var\u003e can be any valid container name.\n 3. Once the backup job completes, use the \"Check the status of the backup job\" and\n \"Check the backup logs\" instructions in [Monitoring backups](/apigee/docs/hybrid/v1.10/monitor-cassandra-backups)\n to verify the backup was successful.\n\n2. **(Optional)** If you have configured Apigee Telemetry (Metrics and Logger) on the org to be deleted, follow these steps to reconfigure them so that the metrics and log data apply to a new org/project.\n 1. Run this command for the org where you want to send the data. Be sure to use the `overrides.yaml` file for the org. For example, if the org to be decommissioned is \"test-dev\" the `overrides.yaml` file should contain an `org: test-dev` org field.\n\n\n ```\n apigeectl apply --telemetry -f overrides.yaml\n ```\n\n \u003cbr /\u003e\n\n 2. Run this command, making sure to use the correct org/project: \n\n ```\n kubectl -n apigee get apigeetelemetry apigee-telemetry -oyaml | grep `gcpProjectID:`\n ```\n3. Delete the org's Kubernetes resources from the hybrid deployment. Be sure to use the\n `overrides.yaml` file for the org. For example, if the org to be decommissioned is\n \"test-dev\" the `overrides.yaml` file should contain an `org: test-dev`\n org field.\n\n For multi-region hybrid deployments, run these commands against each hybrid deployment in\n each region. \n\n ```text\n kubectl config current-context # Verify the current context is the correct context for the hybrid deployment\n apigeectl check-ready -f overrides.yaml # Check the deployment status\n apigeectl delete --settings virtualhost -f overrides.yaml\n apigeectl check-ready -f overrides.yaml # Check the deployment status\n apigeectl delete --all-envs -f overrides.yaml\n apigeectl check-ready -f overrides.yaml # Check the deployment status\n apigeectl delete --org -f overrides.yaml\n apigeectl check-ready -f overrides.yaml # Check the deployment status\n \n ```\n4. Delete the org data from the hybrid deployment. **Once this step is complete all org data\n will be gone from the hybrid deployment.**\n 1. Exec into the `apigee-cassandra-default-0` pod: \n\n ```text\n kubectl exec -it -n apigee apigee-cassandra-default-0 -- /bin/bash\n ```\n 2. Execute the following command. Copy the list of all the names that are shown in the output. This list will be needed later. \n\n ```carbon\n find /opt/apigee/data/apigee-cassandra/ -iname '*ORG_NAME_hybrid' -type d -maxdepth 2 -printf \"%f\\n\"\n ```\n\n\n See [Get org name](#get-org-name) for instructions on how to find and prepare the\n \u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e.\n\n Exit from the `apigee-cassandra-default-0` pod.\n 3. Create a Cassandra debug client pod as described in [Create a client container for debugging](/apigee/docs/api-platform/troubleshoot/playbooks/cassandra/ts-cassandra#create-a-client-container-for-debugging). Move on to the next step after getting a `cqlsh` prompt.\n 4. Execute the following commands in the `cqlsh` prompt: \n\n ```text\n desc keyspaces;\n ```\n\n Make sure this command returns no errors.\n\n For each name in the list created earlier from the `apigee apigee-cassandra-default-0`,\n run the following commands: \n\n ```text\n drop keyspace ;\n ```\n\n Exit from the Cassandra debug client pod.\n 5. Perform a rolling restart of all Cassandra pods. Restarting the Cassandra pods can be done in any order as long as only one Cassandra pod is restarted at a time. For multi-region deployments, perform a rolling restart on all Cassandra pods in each hybrid region. Run the following command and verify the state shows \"Running\":\n\n ```text\n kubectl get apigeeds -n apigee\n ```\n\n Restart a single Cassandra pod with the following command: \n\n ```scdoc\n kubectl delete pod -n apigee CASSANDRA_POD_NAME\n ```\n\n Wait for the pod to reach `Running` state using: \n\n ```text\n kubectl get pods -n apigee\n ```\n\n Restart the next Cassandra pod.\n 6. After executing the `cqlsh` commands, run the following commands on all Cassandra pods in the hybrid deployment. For multi-region hybrid deployments, run the commands on all Cassandra pods in all hybrid regions. \n\n ```scdoc\n kubectl exec -it -n apigee CASSANDRA_POD_NAME -- /bin/bash\n ``` \n\n ```carbon\n find /opt/apigee/data/apigee-cassandra/ -iname '*ORG_NAME_hybrid' -type d -maxdepth 2\n ```\n\n See [Get org name](#get-org-name) for instructions on how to find and prepare the\n \u003cvar translate=\"no\"\u003eORG_NAME\u003c/var\u003e. \n\n ```carbon\n find /opt/apigee/data/apigee-cassandra/ -iname '*ORG_NAME_hybrid' -type d -maxdepth 2 -exec rm -rf {} +\n ```\n 7. Exit from the Cassandra pod."]]