Hi.

After doing some research and test on the puppet modules and dockerfiles
with WSO2 API Management, I have some thoughts to share on this list.

The initial idea for using puppet for configuring the dockerfiles seems
great. It provides a lot of flexibility, and the ruby templates are easy
enough to extend it or customize it.

However, we have some experience building docker containers for Openshift
(kubernetes is the base for it), and there are some inherent problems with
a build-time configuration.

Some particular information, for example the DNS domain name for the
cluster, the namespace, etc, is a runtime configuration. That is, if we
want, for example, to deploy an instance of api management per project (aka
namespace), with the current approach it will require to build a set of
docker containers per project. Currently, we have 10 teams working in their
own projects, so you can figure out the maintainability of 10 different
sets.

Apart from it, there are some configuration information that can be
obtained from the kubernetes master instead of hardcoding it in the
container. Even the kubernetes master information is injected in the
containers in environment variables (
http://kubernetes.io/docs/user-guide/environment-guide/, see
KUBERNETES_SERVICE_HOST, KUBERNETES_SERVICE_PORT).

With those considerations, I propose to use puppet also at runtime when
starting the container, for configuring it using template environment
variables (which are instanced at runtime), and getting as much information
as we could automatically instead of forcing the user to provide it.

Other than that, I also propose to have one script at startup per PaaS
solution. It will customize the peculiarities of this PaaS, and adapt it to
the agnostic configuration. For example, in kubernetes, some environment
variables are injected by default in the container, but in CloudFoundry,
for example, other variables with other structure is used. With this
approach, the container can be used for both of them (even with standalone
docker-compose for example) just having a simple and reusable script for
any PaaS solution.

What do you think?

Thanks.

Regards.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to