Does juju support 'named' interfaces?

James Westby james.westby at canonical.com
Tue Jun 26 03:40:38 UTC 2012


On Mon, 25 Jun 2012 22:05:30 -0300, Sidnei da Silva <sidnei.da.silva at canonical.com> wrote:
> So to be more specific, when I do:
> 
>   juju add-relation my-app my-deployed-shard0
> 
> ...where 'my-app' requires multiple pgsql backends (shard[0-N]) and
> 'my-deployed-shard0' would *have* to be used as 'shard0' by 'my-app',
> how does one structure this?

I haven't tried this, so it may be all lies, but:

your app could declare

requires:
    shard0:
       interface: postgres
    shard1:
       interface: postgres

and then it would have multiple named interfaces, which would be
handled by shardN-relation-* hooks (which could be symlinks to run the
same code and examine the interface to do the right thing in each case.)

When there are multiple interfaces on which two join two services can be
joined you can disambiguate, so it would be something like

  juju deploy myservice
  juju deploy postgresql shard0
  juju add-relation myservice:shard0 shard0

As I said, this is all speculation and it may be that disambiguation
doesn't work on differently named interfaces of the same type, but
different interface types.

Thanks,

James



More information about the Juju mailing list