Kf Cloud Service Broker 是一个 Service Broker 软件包,其中包含开源 Cloud Service Broker 和 Google Cloud Brokerpak。它作为公共 Docker 映像提供,可直接在 Kubernetes 集群中部署为 Kubernetes 服务。在集群中部署 Kf Cloud Service Broker 服务后,开发者可以通过 Kf Cloud Service Broker 服务预配Google Cloud 支持性服务,并将支持性服务绑定到 Kf 应用。
要求
Kf Cloud Service Broker 需要 Cloud SQL for MySQL 实例和服务账号,以访问 Cloud SQL for MySQL 实例和要预配的 Google Cloud 支持性服务。从 Kf Cloud Service Broker 到 Cloud SQL for MySQL 实例的连接通过 Cloud SQL Auth 代理。
安装时,必须提供 Cloud SQL for MySQL 实例,以保存 Kf Cloud Service Broker 使用的业务逻辑。请求通过 Cloud SQL for MySQL Auth 代理从 Kf Cloud Service Broker pod 安全地发送到 Cloud SQL for MySQL 实例。
预配服务时会创建一个 Kf Service 自定义资源。Kf Service 的协调器使用 Open Service Broker API 来预配 Google Cloud 支持性服务。
收到预配/取消预配支持性资源的请求时,Kf Cloud Service Broker 向相应的 Google Cloud 服务发送资源创建/删除请求,这些请求通过 Workload Identity 进行身份验证。它还会将业务逻辑(例如 Kf 服务到支持性服务、服务绑定的映射)保存到 Cloud SQL for MySQL 实例中。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):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\n[Cloud Service Broker](https://github.com/cloudfoundry-incubator/cloud-service-broker)\nand [Google Cloud Brokerpak](https://github.com/cloudfoundry-incubator/csb-brokerpak-gcp).\nIt is made available as a public Docker image and ready to deploy as a\nKubernetes service in Kf clusters. Once the\nKf Cloud Service Broker service is deployed in a cluster, developers can provision\nGoogle Cloud backing services through the Kf Cloud Service Broker service, and\nbind the backing services to Kf Apps.\n| **Note:** Kf Cloud Service Broker is not currently customizable, and the default Google Cloud Brokerpak 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\nOverride Brokerpak defaults\n---------------------------\n\nBrokerpaks are essentially a Terraform plan and related dependencies in a tar\nfile. You can inspect the Terraform plans to see what the defaults are, and then\nyou 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 `config`.\n\n kf create-service csb-google-postgres small spring-music-postgres-db -c '{\"config\":\"\u003cvar translate=\"no\"\u003eYOUR_COMPUTE_REGION\u003c/var\u003e\"}'\n\n2. Override the `authorized_network` and compute region `config`.\n\n kf create-service csb-google-postgres small spring-music-postgres-db -c '{\"config\":\"\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 following Kf Cloud Service Broker architecture shows how instances are created.\n[](/static/migrate/kf/docs/images/kf-csb-architecture.svg)\n\n- The 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 Cloud Service Broker. Requests are sent securely from the 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 Cloud Service Broker sends resource creation/deletion requests to the corresponding 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.11/how-to/app-runtime#vcapservices).\n\nWhat's next?\n------------\n\n- [Deploy Kf Cloud Service Broker](/migrate/kf/docs/2.11/how-to/deploying-cloud-sb).\n- [Learn how to list and provision services](/migrate/kf/docs/2.11/how-to/managed-services)."]]