設定混合式,使用新的資料管道

總覽

從 1.13.1 版開始,啟用資料駐留功能的 Apigee Hybrid 機構可以使用新的資料管道,讓執行階段元件直接將資料寫入控制平面。先前是透過 UDCA 元件完成這項作業,該元件會產生簽署的網址,以便寫入 Google Cloud 服務。新管道可免除 UDCA 和其他相關元件的需求,這些元件負責處理上傳至 Google Cloud 服務的資料。

設定

您可以按照下列操作說明,設定混合式環境,讓個別元件使用新的資料管道。

設定授權流程

設定執行階段服務帳戶的權限,與新管道互動,將資料推送至控制平面。您必須完成這個步驟,才能讓偵錯工作階段和 Analytics 透過新管道運作:

curl -X  PATCH -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type:application/json" \
  "https://apigee.googleapis.com/v1/organizations/ORG_NAME/controlPlaneAccess?update_mask=analytics_publisher_identities" \
  -d '{ "analytics_publisher_identities": ["serviceAccount:apigee-runtime@ORG_NAME.iam.gserviceaccount.com"]}'

回應內容應如下所示:

{
  "name": "organizations/newpipeline-hybrid-org/operations/8316aa78-c137-4733-92ec-cc0d2d92fd29",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
    "operationType": "UPDATE",
    "targetResourceName": "organizations/newpipeline-hybrid-org/controlPlaneAccess",
    "state": "IN_PROGRESS"
  }
}

使用更新回應中的 name 參數,驗證作業狀態:

curl -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)"  \
  -H "Content-Type:application/json"  \
  "https://apigee.googleapis.com/v1/organizations/ORG_NAME/operations/8316aa78-c137-4733-92ec-cc0d2d92fd29"

回應內容應如下所示:

{
  "name": "organizations/newpipeline-hybrid-org/operations/8316aa78-c137-4733-92ec-cc0d2d92fd29",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.apigee.v1.OperationMetadata",
    "operationType": "UPDATE",
    "targetResourceName": "organizations/newpipeline-hybrid-org/controlPlaneAccess",
    "state": "FINISHED"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.apigee.v1.ControlPlaneAccess",
    "name": "organizations/newpipeline-hybrid-org/controlPlaneAccess"
  }
}

驗證機構的 ControlPlaneAccess 設定:

curl "https://apigee.googleapis.com/v1/organizations/ORG_NAME/controlPlaneAccess" \
-H "Authorization: Bearer $(gcloud auth print-access-token)"

回應內容應如下所示:

{
  "synchronizerIdentities": [
    "serviceAccount:apigee-synchronizer@newpipeline-hybrid-org.iam.gserviceaccount.com"
  ],
  "analyticsPublisherIdentities": [
    "serviceAccount:apigee-runtime@newpipeline-hybrid-org.iam.gserviceaccount.com"
  ]
}

在舊版和新版管道之間切換,以進行偵錯和 Analytics 資料存放位置

為服務帳戶提供適當授權後,使用者就能切換 Apigee 執行個體,改用新的管道。

如要切換至新管道,請在 overrides.yaml 檔案中設定 newDataPipeline.debugSession: truenewDataPipeline.analytics: true

如要停止使用新管道,請在 overrides.yaml 檔案中設定 newDataPipeline.debugSession: falsenewDataPipeline.analytics: false

例如:

... rest of the overrides.yaml ...
gcp:
  projectID: PROJECT_ID
  region: ANALYTICS_REGION  # Specifies the analytics region for the hybrid org. This attribute is
                               # the regional endpoint used to push analytics and debug data to the
                               # control plane. For example: us-central1

newDataPipeline:
  debugSession: true  # this flag enables debug session to use the new data pipeline
  analytics: true     # this flag enables analytics to use the new data pipeline

k8sCluster:
  name: CLUSTER_NAME
  region: CLUSTER_LOCATION # Must be the closest Google Cloud region to your cluster. For example, us-west1
org: ORG_NAME

... rest of the overrides.yaml ...

使用 helm upgrade 指令套用這些變更。一次升級一個環境。使用 --set env=ENV_NAME 指定環境。

helm upgrade ENV_RELEASE_NAME apigee-env/ \
  --install \
  --namespace APIGEE_NAMESPACE \
  --set env=ENV_NAME \
  -f OVERRIDES_FILE
  • ENV_RELEASE_NAME 是您先前安裝 apigee-env 圖表時使用的名稱。
  • ENV_NAME 是您要升級的環境名稱。