指定設定覆寫值
Apigee Hybrid 安裝程式會為許多設定使用預設值,但有些設定沒有預設值。您必須為這些設定提供值,如下文所述。
依慣例,設定覆寫值會寫入 $HYBRID_FILES/overrides
目錄中名為 overrides.yaml
的檔案。
- 在
$HYBRID_FILES/overrides
目錄中建立名為overrides.yaml
的新檔案。例如:vi $HYBRID_FILES/overrides/overrides.yaml
overrides.yaml
會為您專屬的 Apigee Hybrid 安裝作業提供設定。這個步驟中的覆寫檔案會為小型混合型執行階段安裝作業提供基本設定,適合用於首次安裝作業。 - 在
overrides.yaml
中,新增下列必要的屬性值。以下也提供各項屬性的詳細說明:非正式環境
請確認
overrides.yaml
檔案具有下列結構和語法。red, bold italics 中的值是您必須提供的屬性值。請參閱下表的說明。不同平台的 Google Cloud 專案區域和 Kubernetes 叢集區域有所不同。選擇要安裝 Apigee Hybrid 的平台。
gcp: region: ANALYTICS_REGION projectID: GCP_PROJECT_ID k8sCluster: name: CLUSTER_NAME region: CLUSTER_LOCATION # Must be the closest Google Cloud region to your cluster. org: ORG_NAME instanceID: "UNIQUE_INSTANCE_IDENTIFIER" cassandra: hostNetwork: false # Set to false for single region installations and multi-region installations # with connectivity between pods in different clusters, for example GKE installations. # Set to true for multi-region installations with no communication between # pods in different clusters, for example GKE On-prem, GKE on AWS, Anthos on bare metal, # AKS, EKS, and OpenShift installations. # See Multi-region deployment: Prerequisites virtualhosts: - name: ENVIRONMENT_GROUP_NAME selector: app: apigee-ingressgateway ingress_name: INGRESS_NAME sslCertPath: ./certs/CERT_NAME.pem sslKeyPath: ./certs/KEY_NAME.key ao: args: # This configuration is introduced in hybrid v1.8 disableIstioConfigInAPIServer: true # This configuration is introduced in hybrid v1.8 ingressGateways: - name: INGRESS_NAME # maximum 17 characters. replicaCountMin: 2 replicaCountMax: 10 # You do not need to set Annotations or LoadBalancerIP if you are creating your own Kubernetes # service for ingress deployment. In prod, it's recommended to create your own Kubernetes service. # See: Expose Apigee ingress gateway. svcAnnotations: # optional. If you are on AKS, see Known issue #260772383. SVC_ANNOTATIONS_KEY: SVC_ANNOTATIONS_VALUE svcLoadBalancerIP: SVC_LOAD_BALANCER_IP # optional envs: - name: ENVIRONMENT_NAME serviceAccountPaths: synchronizer: NON_PROD_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-non-prod.json" udca: NON_PROD_SERVICE_ACCOUNT_FILEPATH runtime: NON_PROD_SERVICE_ACCOUNT_FILEPATH mart: serviceAccountPath: NON_PROD_SERVICE_ACCOUNT_FILEPATH connectAgent: serviceAccountPath: NON_PROD_SERVICE_ACCOUNT_FILEPATH metrics: serviceAccountPath: NON_PROD_SERVICE_ACCOUNT_FILEPATH udca: serviceAccountPath: NON_PROD_SERVICE_ACCOUNT_FILEPATH watcher: serviceAccountPath: NON_PROD_SERVICE_ACCOUNT_FILEPATH logger: enabled: false # Set to false to disable logger for GKE installations. # Set to true for all platforms other than GKE. # See apigee-logger in Service accounts and roles used by hybrid components. serviceAccountPath: NON_PROD_SERVICE_ACCOUNT_FILEPATH
正式發布階段
請確認
overrides.yaml
檔案具有下列結構和語法。red, bold italics 中的值是您必須提供的屬性值。請參閱下表的說明。如果是在正式環境中安裝,請參閱「為實際工作環境設定 Cassandra」一文,瞭解 Cassandra 資料庫的儲存空間需求。
不同平台的 Google Cloud 專案區域和 Kubernetes 叢集區域有所不同。選擇要安裝 Apigee Hybrid 的平台。
gcp: region: ANALYTICS_REGION projectID: GCP_PROJECT_ID k8sCluster: name: CLUSTER_NAME region: CLUSTER_LOCATION # Must be the closest Google Cloud region to your cluster. org: ORG_NAME instanceID: "UNIQUE_INSTANCE_IDENTIFIER" cassandra: hostNetwork: false # Set to false for single region installations and multi-region installations # with connectivity between pods in different clusters, for example GKE installations. # Set to true for multi-region installations with no communication between # pods in different clusters, for example GKE On-prem, GKE on AWS, Anthos on bare metal, # AKS, EKS, and OpenShift installations. # See Multi-region deployment: Prerequisites storage: capacity: 500Gi resources: requests: cpu: 7 memory: 15Gi maxHeapSize: 8192M heapNewSize: 1200M # Minimum storage requirements for a production environment. # See Configure Cassandra for production. virtualhosts: - name: ENVIRONMENT_GROUP_NAME selector: app: apigee-ingressgateway ingress_name: INGRESS_NAME sslCertPath: ./certs/CERT_NAME.pem sslKeyPath: ./certs/KEY_NAME.key ao: args: # This configuration is introduced in hybrid v1.8 disableIstioConfigInAPIServer: true # This configuration is introduced in hybrid v1.8 ingressGateways: - name: INGRESS_NAME # maximum 17 characters. replicaCountMin: 2 replicaCountMax: 10 svcAnnotations: # optional. If you are on AKS, see Known issue #260772383. SVC_ANNOTATIONS_KEY: SVC_ANNOTATIONS_VALUE envs: - name: ENVIRONMENT_NAME serviceAccountPaths: synchronizer: SYNCHRONIZER_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-synchronizer.json" udca: UDCA_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-udca.json" runtime: RUNTIME_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-runtime.json" mart: serviceAccountPath: MART_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-mart.json" connectAgent: serviceAccountPath: MART_SERVICE_ACCOUNT_FILEPATH # Use the same service account for mart and connectAgent metrics: serviceAccountPath: METRICS_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-metrics.json" udca: serviceAccountPath: UDCA_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-udca.json" watcher: serviceAccountPath: WATCHER_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-watcher.json" logger: enabled: false # Set to false to disable logger for GKE installations. # Set to true for all platforms other than GKE. # See apigee-logger in Service accounts and roles used by hybrid components. serviceAccountPath: LOGGER_SERVICE_ACCOUNT_FILEPATH # For example: "./service-accounts/GCP_PROJECT_ID-apigee-logger.json"
範例
以下範例顯示已完成的覆寫檔案,其中加入了屬性值範例:
gcp: region: us-central1 projectID: hybrid-example k8sCluster: name: apigee-hybrid region: us-central1 org: hybrid-example instanceID: "my_hybrid_example" cassandra: hostNetwork: false virtualhosts: - name: example-env-group selector: app: apigee-ingressgateway ingress_name: my-ingress-1 sslCertPath: ./certs/keystore.pem sslKeyPath: ./certs/keystore.key ao: args: disableIstioConfigInAPIServer: true ingressGateways: - name: my-ingress-1 replicaCountMin: 2 replicaCountMax: 10 envs: - name: test serviceAccountPaths: synchronizer: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-synchronizer.json udca: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-udca.json runtime: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-runtime.json mart: serviceAccountPath: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-mart.json connectAgent: serviceAccountPath: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, example-hybrid-apigee-mart.json metrics: serviceAccountPath: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-metrics.json udca: serviceAccountPath: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-udca.json watcher: serviceAccountPath: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, my-hybrid-project-apigee-watcher.json logger: enabled: false # Set to "false" for GKE. Set to "true" for all other Kubernetes platforms. serviceAccountPath: ./service-accounts/my-hybrid-project-apigee-non-prod.json # for production environments, LOGGER_SERVICE_ACCOUNT_NAME.json
- 完成後,請儲存檔案。
下表說明您必須在覆寫檔案中提供的每個屬性值。詳情請參閱「設定屬性參考資料」。
變數 | 說明 |
---|---|
ANALYTICS_REGION | 在 GKE 中,您必須將這個值設為叢集執行所在的區域。在所有其他平台中,請選取與叢集最接近的 Analytics 支援區域 (請參閱第 1 部分,步驟 2:建立機構中的表格)。 這是您先前指派給環境變數 |
GCP_PROJECT_ID | 指出 apigee-logger 和 apigee-metrics 推送資料的 Google Cloud 專案。這是指派給環境變數 PROJECT_ID 的值。 |
CLUSTER_NAME | Kubernetes 叢集名稱。這是指派給環境變數 CLUSTER_NAME 的值。 |
CLUSTER_LOCATION | 叢集執行的地區。這是您在
步驟 1:建立叢集中建立叢集的地區。 這是您先前指派給環境變數 |
ORG_NAME | Apigee Hybrid 機構的 ID。這是指派給環境變數 ORG_NAME 的值。 |
UNIQUE_INSTANCE_IDENTIFIER | 用於識別這個執行個體的專屬字串。可以是任意英文字母和數字的組合,長度上限為 63 個半形字元。 您可以在同一個叢集中建立多個機構,但同一個 Kubernetes 叢集中的所有機構的 |
ENVIRONMENT_GROUP_NAME | 環境所屬環境群組的名稱。這是您在
「專案和組織設定」- 步驟 3:建立環境群組中建立的群組。這是指派給環境變數 ENV_GROUP 的值。
|
CERT_NAME KEY_NAME |
輸入您先前在
步驟 5:建立 TLS 憑證中產生的自行簽署 TLS 金鑰和憑證檔案名稱。這些檔案必須位於 base_directory/hybrid-files/certs 目錄中。例如:sslCertPath: ./certs/keystore.pem sslKeyPath: ./certs/keystore.key |
INGRESS_NAME | 部署作業的 Apigee 入口閘道名稱。這個名稱可以是符合下列規定的任何名稱:
請參閱設定屬性參考資料中的 |
SVC_ANNOTATIONS_KEY:SVC_ANNOTATIONS_VALUE | (選用) 這是一個鍵/值組合,可為預設入口服務提供註解。雲端平台會使用註解來協助設定混合式安裝作業,例如將負載平衡器類型設為內部或外部。 註解會因平台而異。請參閱平台說明文件,瞭解必要和建議的註解。 |
SVC_LOAD_BALANCER_IP | (選用) 在支援指定負載平衡器 IP 位址的平台上,負載平衡器會使用這個 IP 位址建立。如果平台不允許您指定負載平衡器 IP,系統會忽略這項屬性。 |
ENVIRONMENT_NAME | 請使用您在 UI 中建立環境時使用的名稱,如「 專案和機構設定 - 步驟 3:建立環境群組」一文所述。 |
*_SERVICE_ACCOUNT_FILEPATH | service-accounts/ 目錄中服務帳戶 JSON 檔案的路徑和檔案名稱。名稱必須包含服務帳戶檔案的路徑。這可以是完整路徑,或相對於 hybrid-files/ 目錄的路徑。如果您加入相對路徑,則必須從 hybrid-files/ 目錄呼叫 apigeectl 指令,才能套用這項設定。在非正式環境中,單一服務帳戶的名稱預設為 對於實際環境,請輸入您在混合式執行階段設定 - 步驟 4:建立服務帳戶和憑證中,使用 您可以在 實際工作環境服務帳戶的預設名稱如下:
|
摘要
設定檔會告訴 Kubernetes 如何將混合式元件部署至叢集。接著,您將啟用同步器存取權,讓 Apigee 執行階段和管理計畫能夠進行通訊。
1 2 3 4 5 6 (NEXT) 步驟 7:啟用 Synchronizer 存取權 8 9 5 4 5 10