Our stock feed service is a Java application that sends updates to a marketplace partner over TLS. The partner's endpoint uses a certificate from their own private CA, so the image our platform team builds has a small entrypoint script. The Dockerfile sets ENTRYPOINT to that script and CMD to java -jar /app/feed.jar. The script copies the JVM's default truststore, imports the partner CA from a mounted Secret with keytool, exports JAVA_TOOL_OPTIONS pointing the JVM at the new truststore, and then runs exec "$@", which starts whatever CMD says.
In October the service ran out of memory once and we had no heap dump. I added a command to the container in our Deployment: java with -XX:+HeapDumpOnOutOfMemoryError, a dump path on a volume, and -jar /app/feed.jar. It was the same command as before with two flags added.
The rollout completed and every pod went ready, because the readiness probe asks the service about itself.…