Reputation: 767
Is it possible to bind a service (i.e. MariaDB) to apps in different spaces? How can I achieve it if I want to use the same database for two different spaces?
Upvotes: 2
Views: 1743
Reputation: 3
you can same service instance in two different spaces/orgs follow:
1) https://docs.pivotal.io/pivotalcf/2-3/services/enable-sharing.html
2) https://docs.pivotal.io/pivotalcf/2-3/devguide/services/sharing-instances.html
Upvotes: 0
Reputation: 767
I tried the solution from https://docs-cloudfoundry-staging.cfapps.io/devguide/services/sharing-instances.html. If I run the first command I get the following error:
$ cf enable-feature-flag service_instance_sharing
Server error, status code: 403, error code: 10003, message: You are not authorized to perform the requested action
The second command works and now I can see the service in the space B on the dashboard.
$ cf share-service SERVICE-INSTANCE -s OTHER-SPACE [-o OTHER-ORG]
Note: if I click on the service on the dashboard it says: This is a shared service. It is accessible only in the space it was shared from. The service is also shown greyed out.
Upvotes: 0
Reputation: 2592
Currently we don't support service instance sharing. We made the necessary code changes already and tested it (Service Broker), but don't roll it out on prd because the feature is at the moment beta.
Sharing a service instance between spaces allows apps in different spaces to share databases, messaging queues, and other types of services. This eliminates the need for development teams to use service keys and user-provided services to bind their apps to the same service instance that was provisioned using the
cf create-service
command. Sharing service instances improves security, auditing, and provides a more intuitive user experience.
See this discussion for more info when this feature will be generally available from upstream.
Upvotes: 3