You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Christian Schneider <ch...@die-schneider.net> on 2016/06/03 08:33:58 UTC

Config admin for apps deployed using docker

I am currently looking into making OSGi projects deployable as docker 
images.

For the plain deployment I already found some good solutions:
- bndtools allows to package an application as a self contained jar. 
This can then be put into a docker image
- A karaf custom distro can also be packaged as a docker image nicely. 
The static profile allows to even omit the feature service

In both solutions though configuration is not nicely supported in a 
style suitable for docker.

It is of course easy to supply config for karaf by putting configs into 
the etc dir when doing the custom distro. The problem is only how to 
allow overrides from the docker side.
Bndtools or more precisely enroute allows to define default configs as 
magic property files in a bundle and can use an extender to apply these.

The typical approach in docker and docker compose seems to be to use env 
variables and system properties.
I wonder if we could support that better by allowing to override any 
config admin config.

For an env var or system property something like this might do:
cm:<pid>:<key>=value

So the files could contain the defaults and env and system properties 
could override them. Does that make sense? Do we already have other 
options that I am missing?

Christian

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Extender for default configs as felix project?

Posted by Carsten Ziegeler <cz...@apache.org>.
Christian Schneider wrote
> Hi Carsten,
> 
> Peter also told me your are working on the spec. Sounds great. I am willing
> to help with it.
> In the mean time Peter releases the enroute bundles to maven central so I
> can use these for the time being.
> 
> Btw. Peter and I had the idea to have a small meeting on the 28th of june
> while the expert groups are in Darmstadt. I will try to organize this.
> 
Sounds great!

Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: Extender for default configs as felix project?

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Carsten,

Peter also told me your are working on the spec. Sounds great. I am willing
to help with it.
In the mean time Peter releases the enroute bundles to maven central so I
can use these for the time being.

Btw. Peter and I had the idea to have a small meeting on the 28th of june
while the expert groups are in Darmstadt. I will try to organize this.

Christian


2016-06-03 13:17 GMT+02:00 Carsten Ziegeler <cz...@apache.org>:

> Jean-baptiste Onofré wrote
> > Hi Carsten,
> >
> > thanks for the update. Maybe Christian and I can help there ?
> >
>
> Thanks! Sure, any help is welcome. We have an expert group F2F meeting
> by the end of the month. I plan to add my code soon after that, does
> that work for you?
>
> Regards
> Carsten
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: Extender for default configs as felix project?

Posted by Carsten Ziegeler <cz...@apache.org>.
Jean-baptiste Onofr� wrote
> Hi Carsten,
> 
> thanks for the update. Maybe Christian and I can help there ?
> 

Thanks! Sure, any help is welcome. We have an expert group F2F meeting
by the end of the month. I plan to add my code soon after that, does
that work for you?

Regards
Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: Extender for default configs as felix project?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Carsten,

thanks for the update. Maybe Christian and I can help there ?

Regards
JB

On 06/03/2016 12:59 PM, Carsten Ziegeler wrote:
> Christian Schneider wrote
>> I would also like to propose a way to provide default configs.
>>
>> Like described below enroute provides a way to define default configs as
>> files in a bundle. This is implemented using an extender.
>> See
>> https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.configurer.simple.provider
>>
>>
>> I think such an extender would also make sense as a felix project. If
>> there generally is interest in it I will provide a prototype.
>> We could also implement the override behaviour in this extender.
>>
>> I will also contact Peter if he is interested to move the enroute code
>> for the extender into a felix project. I think it could make sense to
>> have helper bundles like this
>> maintained by a community.
>>
>
> We have picked up Peter's idee and are working on an official spec for
> this (I think it's RFC 218, named Configurator). I'm currently working
> on an implementation and as soon as the RFC is stable (which it should
> be in some weeks), I plan to contribute my implementation to Apache Felix.
>
> Regards
> Carsten
>
>

-- 
Jean-Baptiste Onofr�
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Extender for default configs as felix project?

Posted by Carsten Ziegeler <cz...@apache.org>.
Christian Schneider wrote
> I would also like to propose a way to provide default configs.
> 
> Like described below enroute provides a way to define default configs as
> files in a bundle. This is implemented using an extender.
> See
> https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.configurer.simple.provider
> 
> 
> I think such an extender would also make sense as a felix project. If
> there generally is interest in it I will provide a prototype.
> We could also implement the override behaviour in this extender.
> 
> I will also contact Peter if he is interested to move the enroute code
> for the extender into a felix project. I think it could make sense to
> have helper bundles like this
> maintained by a community.
> 

We have picked up Peter's idee and are working on an official spec for
this (I think it's RFC 218, named Configurator). I'm currently working
on an implementation and as soon as the RFC is stable (which it should
be in some weeks), I plan to contribute my implementation to Apache Felix.

Regards
Carsten
 
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Extender for default configs as felix project?

Posted by Christian Schneider <ch...@die-schneider.net>.
I would also like to propose a way to provide default configs.

Like described below enroute provides a way to define default configs as 
files in a bundle. This is implemented using an extender.
See 
https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.configurer.simple.provider

I think such an extender would also make sense as a felix project. If 
there generally is interest in it I will provide a prototype.
We could also implement the override behaviour in this extender.

I will also contact Peter if he is interested to move the enroute code 
for the extender into a felix project. I think it could make sense to 
have helper bundles like this
maintained by a community.

Christian

On 03.06.2016 10:33, Christian Schneider wrote:
> I am currently looking into making OSGi projects deployable as docker 
> images.
>
> For the plain deployment I already found some good solutions:
> - bndtools allows to package an application as a self contained jar. 
> This can then be put into a docker image
> - A karaf custom distro can also be packaged as a docker image nicely. 
> The static profile allows to even omit the feature service
>
> In both solutions though configuration is not nicely supported in a 
> style suitable for docker.
>
> It is of course easy to supply config for karaf by putting configs 
> into the etc dir when doing the custom distro. The problem is only how 
> to allow overrides from the docker side.
> Bndtools or more precisely enroute allows to define default configs as 
> magic property files in a bundle and can use an extender to apply these.
>
> The typical approach in docker and docker compose seems to be to use 
> env variables and system properties.
> I wonder if we could support that better by allowing to override any 
> config admin config.
>
> For an env var or system property something like this might do:
> cm:<pid>:<key>=value
>
> So the files could contain the defaults and env and system properties 
> could override them. Does that make sense? Do we already have other 
> options that I am missing?
>
> Christian
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Config admin for apps deployed using docker

Posted by Paul Bakker <pa...@gmail.com>.
Hi Christian,

Environment variables are indeed the way to go. Using for example Amdatu Configurator (http://amdatu.org/components/configurator.html <http://amdatu.org/components/configurator.html>) you can create property files (or metatype xml) that contain variables. For example:

mykey=${some_env_var}

Variables are replaced by environment variables. So with the example above you could pass in an override "docker run -e some_env_var=somevalue ..." 

Cheers,

Paul


> On 03 Jun 2016, at 10:33, Christian Schneider <ch...@die-schneider.net> wrote:
> 
> I am currently looking into making OSGi projects deployable as docker images.
> 
> For the plain deployment I already found some good solutions:
> - bndtools allows to package an application as a self contained jar. This can then be put into a docker image
> - A karaf custom distro can also be packaged as a docker image nicely. The static profile allows to even omit the feature service
> 
> In both solutions though configuration is not nicely supported in a style suitable for docker.
> 
> It is of course easy to supply config for karaf by putting configs into the etc dir when doing the custom distro. The problem is only how to allow overrides from the docker side.
> Bndtools or more precisely enroute allows to define default configs as magic property files in a bundle and can use an extender to apply these.
> 
> The typical approach in docker and docker compose seems to be to use env variables and system properties.
> I wonder if we could support that better by allowing to override any config admin config.
> 
> For an env var or system property something like this might do:
> cm:<pid>:<key>=value
> 
> So the files could contain the defaults and env and system properties could override them. Does that make sense? Do we already have other options that I am missing?
> 
> Christian
> 
> -- 
> Christian Schneider
> http://www.liquid-reality.de
> 
> Open Source Architect
> http://www.talend.com
>