無論是哪種情況,我們強烈建議您使用信任的 TLS 憑證和存取憑證,保護 Service Broker 的 API。
當 API 可供存取時,請 kubectl applyClusterServiceBroker 和 Kubernetes Secret,其中包含與 Service Broker 授權的憑證。
apiVersion:servicecatalog.k8s.io/v1beta1kind:ClusterServiceBrokermetadata:name:aws-sbspec:# For all configuration options, look at the service catalog's# type definitions:# https://github.com/kubernetes-sigs/service-catalog/blob/master/pkg/apis/servicecatalog/v1beta1/types.go#L185url:https://replace.with.url.to.service.brokerinsecureSkipTLSVerify:false# use a trusted TLS certificateauthInfo:bearer:# or basicsecretRef:namespace:some-namespacename:some-secret-name
[[["容易理解","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,["# AWS Service Broker\n\n| **Note:** The AWS service broker is not an officially supported part of Kf.\n\nThe [AWS Service Broker](https://aws.amazon.com/partners/servicebroker/) exposes AWS Services through the [Open Service Broker (OSB)](https://github.com/openservicebrokerapi/servicebroker/blob/v2.15/spec.md) protocol.\nThese docs are based on the [AWS Service Broker Documentation](https://github.com/awslabs/aws-servicebroker/tree/master/docs).\nThis doc covers two possible installations:\n\n1. Install the AWS Service Broker in the Kf Kubernetes Cluster (recommended)\n2. Install the AWS Service Broker in AWS and exposing the API via a VPC bridge\n\nPrerequisites\n-------------\n\nIn addition to a Kubernetes cluster with Kf and Service Catalog installed (see\n[these instructions](/docs/getting-started/install)), the following tools must be installed on the\nworkstation where you will be using the `kf` CLI:\n\n1. **`helm`** : Follow [these instructions](https://helm.sh/docs/using_helm/) to install the `helm` CLI.\n\nMethod 1: Install in GKE\n------------------------\n\nThe AWS Service Broker is deployed using the Helm chart from the\n[AWS Service Broker's getting started guide for Kubernetes](https://github.com/awslabs/aws-servicebroker/blob/master/docs/getting-started-k8s.md).\n\n### Infrastructure\n\nThe AWS Service Broker requires a DynamoDB table and an IAM user to access the\ntable. The easiest method is to deploy the [provided CloudFormation\ntemplate](https://github.com/awslabs/aws-servicebroker/blob/master/setup/prerequisites.yaml). For manual installation, see the\n[prerequisite docs](https://github.com/awslabs/aws-servicebroker/blob/master/docs/install_prereqs.md).\n\n### Helm\n\nFirst, add the Helm repository to your machine: \n\n $ helm repo add aws-sb https://awsservicebroker.s3.amazonaws.com/charts\n\nThen deploy the Helm chart, setting the correct AWS `accesskeyid` and `secretkey`: \n\n $ helm install aws-sb/aws-servicebroker \\\n --name aws-servicebroker \\\n --namespace aws-sb \\\n --set aws.secretkey=REPLACEME \\\n --set aws.accesskeyid=REPLACEME\n\nIf you don't want the broker installed cluster-wide set the flag\n`--set deployNamespacedServiceBroker=true` which will register the broker into\nthe deployed Namespace.\n\nA full list of configuration parameters can be found in [the Helm template's\nvalues.yaml definition](https://github.com/awslabs/aws-servicebroker/blob/master/packaging/helm/aws-servicebroker/values.yaml).\n\n### Verification\n\nAfter the Helm chart is deployed, a `ClusterServiceBroker` resource should have\nbeen created. You can check for it with `kubectl`: \n\n $ kubectl get ClusterServiceBroker aws-servicebroker\n\n NAME URL STATUS AGE\n aws-servicebroker https://aws-servicebroker-aws-servicebroker.aws-sb.svc.cluster.local Ready 3d\n\nIf the `STATUS` is not ready, there was an issue. Some things to check while troubleshooting are:\n\n- The DynamoDB infrastructure is up\n- The AWS User has access to the DynamoDB table via Policy or Group\n- The Helm chart values were set correctly\n\nIt may take several minutes for your broker to come up and register itself with\nService Catalog. Once the broker is registed, you can view the provided services\nwith the `kf marketplace` command.\n\nMethod 2: Install in AWS\n------------------------\n\nThe downside to installing the AWS Service Broker in a GKE cluster is the\nrequired use of AWS User credentials instead of an AWS Role.\nHowever, the only required Kubernetes resource for the AWS Service Broker to\nwork with Kf is the ClusterServiceBroker, assuming the AWS Service Broker's API\nis reachable from the GKE cluster.\n\nThere are two methods the API can be exposed to the GKE cluster:\n\n1. The API is accessible via a [VPN bridge between Google Cloud and\n AWS](https://medium.com/google-cloud/vpn-between-two-clouds-e2e3578be773)\n2. The API is publicly accessible (not recommended)\n\nIn either case, it is *strongly recommended* to secure the Service Broker's API\nwith a trusted TLS certificate and access credentials.\n\nOnce the API is accessible, `kubectl apply` a `ClusterServiceBroker` and a\nKubernetes `Secret` which contains the credentials for authorizing with the\nService Broker. \n\n apiVersion: servicecatalog.k8s.io/v1beta1\n kind: ClusterServiceBroker\n metadata:\n name: aws-sb\n spec:\n # For all configuration options, look at the service catalog's\n # type definitions:\n # https://github.com/kubernetes-sigs/service-catalog/blob/master/pkg/apis/servicecatalog/v1beta1/types.go#L185\n url: https://replace.with.url.to.service.broker\n insecureSkipTLSVerify: false # use a trusted TLS certificate\n authInfo:\n bearer: # or basic\n secretRef:\n namespace: some-namespace\n name: some-secret-name"]]