概览
从 1.13.1 版开始,已启用数据驻留的 Apigee Hybrid 组织可以使用新的数据流水线,以允许运行时组件直接将数据写入控制平面。以前,这需要通过 UDCA 组件来完成,该组件会生成签名网址以写入 Google Cloud 服务。新流水线无需 UDCA 和其他相关组件来负责处理上传到 Google Cloud 服务的数据。
配置
您可以按照以下说明配置 Hybrid,以便为各个组件使用新的数据流水线。
设置授权流程
为运行时服务账号设置权限,以便与新流水线交互,将数据推送到控制平面。必须执行此步骤,才能让调试会话和 Google 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"
]
}
在用于调试和 Google Analytics 数据保留的新旧流水线之间切换
向服务账号提供正确的授权后,用户就可以切换其 Apigee 实例以使用新流水线。
如需切换到新流水线,请在 overrides.yaml 文件中设置 newDataPipeline.debugSession: true 和 newDataPipeline.analytics: true。
如需停止使用新流水线,请在 overrides.yaml 文件中设置 newDataPipeline.debugSession: false 和 newDataPipeline.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 是您要升级的环境的名称。