CAAPIM / apim-charts

Helm Charts for Layer7 API Management components.
MIT License
11 stars 48 forks source link

Possibility to inject files into an existing directory with files already present in the gateway container #138

Closed spooki3 closed 1 year ago

spooki3 commented 2 years ago

Which chart: Gateway version 2.0.4 The name (and version) of the affected chart.

Is your feature request related to a problem? Please describe. We need to inject some jar files (com.ibm.mq.allclient.jar , com.ibm.mq.traceControl.jar , fscontext.jar , jms.jar , providerutil.jar )in the gateway pod for the MQ Native queues. These libraries need to be placed in /opt/SecureSpan/Gateway/runtime/lib/ext/ where jms-1-1.jar already resides and need to be present before the gateway starts.

We are trying to load these files using an initcontainer . However we run into multiple issues. The com.ibm.mq.allclient.jar is about 7MB. So we can't use configmaps since these are limited to 1MB. We also can't use secrets since 4MB is the limit there for a file.

The init container also only seems to support emptydir as volume (based on the deployment.yaml). Testing with the other smaller files using secrets or configmap does not work. The volume remains empty.

example initcontainer statement as we used for secrets :

initContainers:

Using the emptydir as volume we are able to get the files into the pod. However this is not viable since we need to place them inside and already existing directory with an existing file. The existing file then disappears. We would need to use subpath in the volumeMounts but since we start with emptyDir this is not possible. The files do not exist there yet when mounting so they end up as directories.

Describe the solution you'd like A way to inject files in any existing directory (or at least the /opt/SecureSpan/Gateway/runtime/lib/ext/ directory) which already contain files. A possible solution would be to support PersistantVolumeClaims and subPath in the volumeMounts in the initcontainer and gateway container. We could then load files from there and mount them using the subPath statement

Describe alternatives you've considered Currently I am out of options here. I see no way to get these files in the proper location before the gateway starts. This is preventing is from migrating our workloads from the virtual appliance gateways to containers gateways.

Gazza7205 commented 2 years ago

@spooki3 - thanks for raising this.

I will look into the volume configuration for initContainers and see if we can resolve this in the short term.

In the meantime, you can use this documented approach to load additional libraries.

Gazza7205 commented 1 year ago

This can now be achieved with initContainers - see here for examples.