設定 MART 服務帳戶

本主題說明如何設定 MART 服務帳戶。

新增 MART 服務帳戶

MART 和 Apigee Connect 需要 Google Cloud 服務帳戶進行驗證。

  1. 找出 apigee-mart 服務帳戶的金鑰檔案。檔案的副檔名應為 .json
    ls $HYBRID_FILES/service-accounts
    • PROD 安裝次數:apigee-mart.json
    • 非正式環境安裝:apigee-non-prod.json
  2. 如果沒有看到 MART 服務帳戶檔案,請使用 create-service-account 公用程式建立並下載該檔案:
    1. 確定您已設定 PROJECT_ID 環境變數:
      echo $PROJECT_ID

      視需要定義:

      export PROJECT_ID=my-project-id
    2. 建立 MART 服務帳戶。您可以在下列位置找到 create-service-account 工具:
      • 針對 Helm 資訊套件安裝作業:
        APIGEE_HELM_CHARTS_HOME/
        └── apigee-operator/
            └── etc/
                └── tools/
                    └── create-service-account
        
      • apigeectl 安裝:
        APIGEECTL_HOME/
        └── tools/
            └── create-service-account
        

      PROD

      create-service-account \
        --env prod \
        --profile apigee-mart \
        --dir PATH_TO_SERVICE_ACCOUNTS_DIR

      非正式環境

      $HYBRID_FILES/tools/create-service-account \
        --env non-prod \
        --profile apigee-mart \
        --dir PATH_TO_SERVICE_ACCOUNTS_DIR
  3. 編輯 overrides.yaml 檔案,並將金鑰檔案路徑新增至 connectAgentmart.serviceAccountPath 屬性:

    PROD

    connectAgent:
      serviceAccountPath: path_to_apigee-mart.json
    
    mart:
      serviceAccountPath: path_to_apigee-mart.json

    非正式環境

    connectAgent:
      serviceAccountPath: path_to_apigee-non-prod.json
    
    mart:
      serviceAccountPath: path_to_apigee-non-prod.json

    例如:

    Helm

    ...
          connectAgent:
            serviceAccountPath: /apigee/hybrid/helm-charts/apigee-org/apigee-mart.json
    
          mart:
            serviceAccountPath: /apigee/hybrid/helm-charts/apigee-org/apigee-mart.json
          ...

    apigeectl

    ...
    connectAgent:
      serviceAccountPath: /apigee/hybrid/hybrid-files/service-accounts/apigee-mart.json
    
    mart:
      serviceAccountPath: /apigee/hybrid/hybrid-files/service-accounts/apigee-mart.json
    ...
  4. 套用變更:

    Helm

    helm upgrade ORG_NAME apigee-org/ \
      --namespace apigee \
      --atomic \
      -f OVERRIDES_FILE.yaml
    

    apigeectl

    $APIGEECTL_HOME/apigeectl apply -f OVERRIDES_FILE.yaml --org