I'm working on the code for one service that is part of a larger project. Most of the apps are Java REST services, all running in containers in pods.
To debug what's happening in the JVM, it's convenient to add either or both of the typical JMX and Xdebug parameters, to allow introspecting the JVM's performance, or step through code in a debugger.
The image has a shell script that runs Java. It occurs to me that it might be convenient to have the JMX and Xdebug parameters not present by default, but to add them if a particular environment variable is set (one for each set). I could set or not set those environment variables in a deployment specification.
I'm wondering about how to optimize the developer workflow. Assuming the container is currently running without the JMX parameters, for instance, how can I make it easier for the developer to get to a state where the JVM is now running with those JMX parameters?
Our build/deploy process currently uses an Ansible process that I'm not familiar with, which results in the deployment being rolled out (I can see it using "kubectl rollout status" afterwards to check status).
Assuming we still use this strategy of env var enablement, the "official" process would require the developer pushing a git change to the deployment spec, which would rebuild and redeploy everything.
What are some steps I could take to optimize this process, to minimize the steps and time a developer has to take to toggle the JMX (or Xdebug) parameters?
Another thing I'm wondering about is whether I need to be at all concerned about having the JMX parameters present all the time. It's not using auth or ssl, but it's awkward (not impossible) to make the JMX connection to the port (normally requires a "port-forward" mechanism). Are we overly paranoid to have these off by default?