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

Re: Deployment Strategy: lifecycle hooks how to inject configuration



Hi Dan,

As you learned, lifecycle hooks were not made to change anything inside a container image. Remember that container images are, by design, immutable. It looks you want to build a custom container image that includes your customizations to the wildfly configs plus your application. There are two ways to accomplish that with OpenShift:

1. Create a Dockerfile that uses the standard wildfly container image as the parent, and adds your customization.

2. Use the OpenShift source-to-image (s2i) process to add configurations and your application. See the OpenShift docs about the wildfly s2i builder image for details, this is easier than using a Dockerfile. The standard s2i processes builds the application from sources, but it also supports feeding an application war/ear.


[]s, Fernando Lozano


On Wed, Feb 21, 2018 at 9:43 AM, Dan Pungă <dan punga gmail com> wrote:
Hello all!

Trying to build an OShift configuration for running a Java app with a Wildfly server.
I've setup this with ChainBuilds where the app's artifacts are combined with a runtime image of Wildfly.

For this particular app, however, I need to do some configuration on the Wildfly environment, so that the app is properly deployed and works.
- update a server module (grabbing the contents from the web and copying them in the right location inside Wildfly)
- add system properties and some other configuration to Wildfly's standalone.xml configuration file
- create some directory structure

I've tried to run all this with the Recreate deployment starategy and as a mid-hook procedure (so the previous deployment pod is scaled down), but all these changes aren't reflected in the actual(new) deployment pod.

Taking a closer look at the docs, I've found this line "
Pod-based lifecycle hooks execute hook code in a new pod derived from the template in a deployment configuration."
So whatever I'm doing in my hook, is actually done in a different pod, the hook pod, and not in the actual deployment pod. Did I understand this correctly?
If so, how does the injection work here? Does it have to do with the fact that the deployment has to have persistent volumes? So the hooks actually do changes inside a volume that will be mounted with the deployment pod too...

Thank you!


_______________________________________________
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]