An app linking to a DB container service

Issue #2 resolved
Jimmy Chu created an issue

Portal UI:

  • A link to create a DB(external) service
  • [opt] When there are multiple services, a dialog box to choose which service to create
  • For db service, we ask for admin password
  • Confirm and create

Command Wrapper:

  • Upon confirmation, possible services offered are from our dockerfile repository. We check & download the dockerfile project if not exist
  • deis create the dockerfile project, and then set the env of password for that deis container
  • During the whole creation process, user get a "loading..." visual cue.
  • Run etcdctl watch for change on the service exposed host and port
  • When it is done, callback to update the UI

Portal UI:

  • Upon successful creation of the service, the portal get a few additional env var set, DB_SERVICE_HOST, DB_SERVICE_PORT, DB_SERVICE_USER, DB_SERVICE_PASSWORD, DB_SERVICE_NAME.
  • The envVar actual values are retrieved from etcdctl
  • User could choose to disconnect from the service

Comments (5)

  1. Jimmy Chu reporter

    Realized that nginx tcp proxy module couldn't redirect requests based on name virtualhost. So to support dynamically adding backing services:

    • add a field in etcd of a port that is used in nginx template
      • where should I add the code of generating a new pair of etcd kv?
      • how to generate the port #? (you also need to export those ports in Dockerfile and link those ports out when running the container.)
    • Have it redirect to the backing services

    Note:

    • The # of backing services are limited by available ports on the server
  2. Jimmy Chu reporter

    Only one mysql service!

    • Start and stop the mysql service at the portal rake cmd
    • Everytimes when user create connect to a DB service, it is basically create a user acct (unique username and password), and a unique table name. All the env var related to these services are stored in portal DB for connection.
  3. Log in to comment