本指南說明如何在多區域環境中停用區域。
停用混合型區域
- 將 Kubernetes 內容設為需要停用的區域。
列出目前的環境,查看每個叢集的環境名稱:
kubectl config get-contexts
將環境設定為要停用的叢集和區域:
kubectl config use-context CONTEXT_NAME
其中 CONTEXT_NAME 是叢集和區域的環境名稱。
例如:
kubectl config get-contextsCURRENT NAME CLUSTER AUTHINFO NAMESPACE gke_example-org-1_us-central1_example-cluster-1 gke_example-org-1_us-central1_example-cluster-1 gke_example-org-1_us-central1_example-cluster-1 apigee * gke_example-org-1_us-central1_example-cluster-2 gke_example-org-1_us-central1_example-cluster-2 gke_example-org-1_us-central1_example-cluster-2 apigee gke_example-org-1_us-west1_example-cluster-2 gke_example-org-1_us-west1_example-cluster-2 gke_example-org-1_us-west1_example-cluster-2 apigeekubectl config use-context gke_example-org-1_us-west1_example-cluster-2 -
確認區域中的所有 Pod 都處於執行或完成狀態:
kubectl get pods -n apigee
kubectl get pods -n apigee-system
-
使用 Helm 驗證元件發布:
helm -n apigee list
helm -n apigee-system list
例如:
helm -n apigee listNAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION datastore apigee 2 2024-03-29 17:08:07.917848253 +0000 UTC deployed apigee-datastore-1.12.0 1.12.0 ingress-manager apigee 2 2024-03-29 17:21:02.917333616 +0000 UTC deployed apigee-ingress-manager-1.12.0 1.12.0 redis apigee 2 2024-03-29 17:19:51.143728084 +0000 UTC deployed apigee-redis-1.12.0 1.12.0 telemetry apigee 2 2024-03-29 17:16:09.883885403 +0000 UTC deployed apigee-telemetry-1.12.0 1.12.0 exampleor apigee 2 2024-03-29 17:21:50.899855344 +0000 UTC deployed apigee-org-1.12.0 1.12.0 -
驗證 Cassandra 叢集的狀態。
列出 Cassandra Pod:
kubectl get pods -n APIGEE_NAMESPACE -l app=apigee-cassandra
例如:
kubectl get pods -n apigee -l app=apigee-cassandraNAME READY STATUS RESTARTS AGE apigee-cassandra-default-0 1/1 Running 0 2h apigee-cassandra-default-1 1/1 Running 0 2h apigee-cassandra-default-2 1/1 Running 0 2h apigee-cassandra-default-3 1/1 Running 0 16m apigee-cassandra-default-4 1/1 Running 0 14m apigee-cassandra-default-5 1/1 Running 0 13m apigee-cassandra-default-6 1/1 Running 0 9m apigee-cassandra-default-7 1/1 Running 0 9m apigee-cassandra-default-8 1/1 Running 0 8m - 在您剛選取的環境中刪除 Apigee 執行個體:
逐一刪除元件。
helm -n apigee delete datastore
helm -n apigee delete telemetry
helm -n apigee delete ingress-manager
helm -n apigee delete redis
helm -n apigee delete ORG_NAME
針對每個環境重複執行下列指令:
helm -n apigee delete ENV_NAME
針對每個環境群組重複執行下列指令:
helm -n apigee delete ENV_GROUP_NAME
helm -n apigee-system delete operator
- 確認 Apigee 命名空間中沒有任何剩餘的 Pod:
kubectl get pods -n apigee
kubectl get pods -n apigee-system - Set the context to other existing regions and make sure the cassandra datacenter is removed
from the existing ring. The output should not show the removed data center details.
kubectl exec apigee-cassandra-default-0 -n apigee -- nodetool -u JMX_USER -pw JMX_PASSWORD status