[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: wiring microservices together



One amazing aspect of templates on openshift is that you can process it without depending on the web gui:

$ oc process -f template.yml -v PARM1=value1,PARM2=43 -o json > processed-template.json

Then create all objects at once:

$ oc create -f processed-template.json

Or, you you prefer, in a single shot:

$ oc process -f template.yml -v PARM1=value1,PARM2=43 -o json | oc create -f -



Mateus Caruccio
Master of Puppets
+55 (51) 8298.0026
gtalk: mateus caruccio getupcloud com
twitter: @MateusCaruccio

This message and any attachment are solely for the intended
recipient and may contain confidential or privileged information
and it can not be forwarded or shared without permission.
Thank you!

On Wed, Jan 27, 2016 at 2:36 PM, Candide Kemmler <candide intrinsic world> wrote:
I didn't realize that. That's awesome. Loving OpenShift a little more everyday.

Templates indeed look like the way to go for me and being able to look at the source of working templates is fantastic.

Best,

Candide

On 26 Jan 2016, at 19:24, Mateus Caruccio <mateus caruccio getupcloud com> wrote:

Hi Candice.

What you need is already there. All services may be referenced by it's name. There is an internal DNS service for that.
Suppose you've created 2 microservices: ms1 and ms2. In order to ms1 connect to ms2, just use the hostname as the same name for the service, i.e. "ms2".

Regarding deployments, "templates" are exactly what you are looking for. Templates have "parameters", where one can input data. Those values can be used inside other objects of the templates (a templates is basically a list of objects to be built, plus optional parameters). Those parameters can be referenced like shell variables.
For example, see how this[1] parameter is being used here[2].

You may what to start from an existing template from your own installation. Just "oc get templates -n openshift", then "oc export templates/<name> -n openshift".



Mateus Caruccio
Master of Puppets
+55 (51) 8298.0026
gtalk: mateus caruccio getupcloud com
twitter: @MateusCaruccio

This message and any attachment are solely for the intended
recipient and may contain confidential or privileged information
and it can not be forwarded or shared without permission.
Thank you!

On Tue, Jan 26, 2016 at 3:57 PM, Candide Kemmler <candide intrinsic world> wrote:
I understand how it is possible, using OpenShift to create a few pods as microservices and to wire them together to create a composite application. Each pod/microservice gets its own build and deployment lifecycle, which is great. With my current knowledge the way I would gradually build this application is less than optimal:

I would start by deploying service 1, note its IP address then,
I would deploy service 2 and wire service 1's IP address as it depends on it
...and so on

So I'm wondering if there is a way that I can discover services at runtime, possibly by name. I know about fabric8's api but at first glance it seems a bit cumbersome to use.

Ideally I would like to deploy the entire app made of multiple services in one step, as a template, for instance. Again what I don't understand is how the wiring of service is accomplished in a generic way.

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]