Simulating failure for a k8s Java deployment. Running as a subprocess in a k8s environment using "distroless" containers

I’m using the “distroless” debug image for a specific deployment in my k8s cluster. I wish to test specific failure scenarios by killing my process. Specifically I would like to kill -9 the subprocess, while allowing the container to continue running, to see what effect that would have. However ,the process seems to run as PID1. Therefore, I cannot send a kill -9 signal.

The “distroless” debug image keeps “/busybox/sh” in the container image. I’ve been able to execute the java application with something similar to below:

/busybox/sh -c /path/to/java -JavaParams …

However, the process still starts with PID 1. I have since tried appending & to above but then it appears the deployment / pod will not start. I have been unable to see specific logging related to the failure.

I have since tried setting the related parameter here hoping I could execute as a subprocess. Share Process Namespace between Containers in a Pod | Kubernetes

However, I was still unable to use & or similar to launch as a subprocess of the busybox shell.

Perhaps this is engineered into the “distroless” java image design. If this is the case would someone confirm?

Otherwise, if I am missing something, can someone suggest how I can run as a subprocess?