Closed tomaszkiewicz closed 1 year ago
Thank you for your contribution, I like it. I wonder if it would make more sense to do it in pre, instead of post, as there might be dependencies that n8n would need to start.
Current K8S version has only postStart and preStop lifecycle hooks (https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/), so the only way to run it before n8n is to change entrypoint or command which I think can break some stuff when base container changes.
Lifecycle hook is not perfect, but relatively safe to make cases like package addition into the container.
Ok, didn't know that.
Since what K8s version is it supported? If it's older then 1.21 we might need to do a check for api version
Or a comment in the values yaml file
It's available as long as I remember, so a couple years at least :)
Hello,
Sometimes it doesn't make sense to build new docker image just to add some stuff to the main container. In K8S we can use lifecycle parameter for container to inject some kind of actions.
This PR adds a configuration parameter "lifecycle" to the template to accomplish that.
Sample usage (values.yaml):