-->

bluemix container cannot add user-defined service

2019-09-13 10:25发布

问题:

I have created a user-defined service (Compose Mongo DB) and Watson Dialog Service. I want to bind both services to my app deployed in IBM Container, however, I am not able to do.

I tried these, but none works:

  1. I tried using BIND_TO, but I can only bind 1 service (e.g. Use comma separated using UI - BIND_TO : MongoBridge, WatsonBridge)
  2. When I create bridge CF with 2 services bind, it doesn't work either (e.g. Using UI - BIND_TO : MongoWatsonBridge where MongoWatsonBridge has user-defined Mongo service - just URL - & Watson Dialog service bind)
  3. When I tried to BIND_TO user-defined, + Watson service with --env CCS_BIND_SRV, it doesn't work either (e.g. BIND_TO : MongoWatsonBridge, also --env CCS_BIND_SRV=Watson-Dialog-Service)

Of course, user-defined doesn't work with --env CCS_BIND_SRV=MongoBridge - Bluemix throws error

I can individually bind each service though (using BIND_TO for MongoBridge, using --env CCS_BIND_SRV=Watson-Dialog-Service)

Please let me know if it is supported, or it is a bug that it suppose to work, but not working, or there is other way to bind both services.

回答1:

the user-defined service does not support service key generation so it cannot be bound using the "CCS_BIND_SRV" parameter. The only way you can bind both these services to the container is by using a CF bridge app. Create a CF bridge app and bind both these services (user-defined and Watson) to this app. Then bind this app to the container using the "CCS_BIND_APP=" environment variable in the command line.