Kf 雲端服務代理程式是包含開放原始碼 Cloud Service Broker 和 GCP Brokerpak 的服務代理程式組合。這項服務會以公開 Docker 映像檔的形式提供,並可在 Kf 叢集中部署為 Kubernetes 服務。在叢集中部署 Kf Cloud Service Broker 服務後,開發人員可以透過 Kf Cloud Service Broker 服務佈建 Google Cloud 後援服務,並將後援服務繫結至 Kf Apps。
需求條件
Kf Cloud Service Broker 需要 Cloud SQL for MySQL 執行個體和服務帳戶,才能存取 Cloud SQL for MySQL 執行個體和 Google Cloud 要佈建的後端服務。從 Kf Cloud Service Broker 到 MySQL 適用的 Cloud SQL 執行個體的連線會透過 Cloud SQL Auth Proxy 進行。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Kf Cloud Service Broker\n\n| **Note:** Kf Cloud Service Broker for Google Cloud is a supported component of Kf.\n\nKf Cloud Service Broker is a Service Broker bundle that includes the open source [Cloud Service Broker](https://github.com/cloudfoundry-incubator/cloud-service-broker) and [GCP Brokerpak](https://github.com/cloudfoundry-incubator/csb-brokerpak-gcp). It is made available as a public Docker image and ready to deploy as a Kubernetes service in Kf clusters. Once the Kf Cloud Service Broker service is deployed in a cluster, developers can provision Google Cloud backing services through the Kf Cloud Service Broker service, and bind the backing services to Kf Apps.\n| **Note:** Kf Cloud Service Broker is not currently customizable, and the default [GCP Brokerpak](https://github.com/cloudfoundry-incubator/csb-brokerpak-gcp) is included. If you would like to use an unsupported custom Brokerpak, you can follow the steps in the [open source Cloud Service Broker Google Cloud installation guide](https://github.com/cloudfoundry/csb-brokerpak-gcp/blob/main/docs/installation.md).\n\nRequirements\n------------\n\n- Kf Cloud Service Broker requires a [Cloud SQL for MySQL](/sql) instance and a service account for accessing the Cloud SQL for MySQL instance and Google Cloud backing services to be provisioned. Connection from the Kf Cloud Service Broker to the Cloud SQL for MySQL instance goes through the [Cloud SQL Auth Proxy](/sql/docs/mysql/sql-proxy).\n- Requests to access Google Cloud services (for example: [Cloud SQL for MySQL](/sql) or [Memorystore](/memorystore)) are authenticated via [Workload Identity](/kubernetes-engine/docs/how-to/workload-identity).\n\nOverriding Brokerpak defaults\n-----------------------------\n\nBrokerpaks are essentially a Terraform plan and related dependencies in a Docker file. You can inspect the Terraform plans to see what the defaults are, and then you can tell Kf Cloud Service Broker to override them when creating new services.\n\nFor example, the [Terraform configuration for Cloud SQL for MySQL](https://github.com/cloudfoundry/csb-brokerpak-gcp/blob/main/terraform/cloudsql/mysql/provision/data.tf) includes a variable called `authorized_network`. If not overridden, the `default` VPC will be used. If you'd like to override the default, you can pass that during service creation. Here are some examples:\n\n1. Override the compute `region`.\n\n kf create-service csb-google-postgres small spring-music-postgres-db -c '{\"region\":\"\u003cvar translate=\"no\"\u003eYOUR_COMPUTE_REGION\u003c/var\u003e\"}'\n\n2. Override the `authorized_network` and compute `region`.\n\n kf create-service csb-google-postgres small spring-music-postgres-db -c '{\"region\":\"\u003cvar translate=\"no\"\u003eYOUR_COMPUTE_REGION\u003c/var\u003e\",\"authorized_network\":\"\u003cvar translate=\"no\"\u003eYOUR_CUSTOM_VPC_NAME\u003c/var\u003e\"}'\n\nArchitecture\n------------\n\nThe Kf Cloud Service Broker arechitecture below shows how instances are created.\n[](/static/migrate/kf/docs/images/kf-csb-architecture.svg)\n\n- The Kf Kf Cloud Service Broker (CSB) is installed in its own namespace.\n- On installation, a Cloud SQL for MySQL instance must be provided to persist business logic used by Kf Kf Cloud Service Broker. Requests are sent securely from the Kf Kf Cloud Service Broker pod to the Cloud SQL for MySQL instance via the Cloud SQL for MySQL Auth Proxy.\n- On service provisioning, a Kf Service custom resource is created. The reconciler of the Kf Service provisions Google Cloud backing services using the Open Service Broker API.\n- When a request to provision/deprovision backing resources is received, Kf Kf Cloud Service Broker sends resource creation/deletion requests to the correspoinding Google Cloud service, and these requests are authenticated with Workload Identity. It also persists the business logics (e.g. mapping of Kf services to backing services, service bindings) to the Cloud SQL for MySQL instance.\n- On backing service creation success, the backing service is bound to an App via [VCAP_SERVICES](/migrate/kf/docs/2.5/how-to/app-runtime#vcapservices).\n\nWhat's next?\n------------\n\n- [Deploy Kf Cloud Service Broker](/migrate/kf/docs/2.5/how-to/deploying-cloud-sb)."]]