Menu

We set command in our Deployment to add one JVM flag and our pods stopped trusting our partner's certificate
📰

We set command in our Deployment to add one JVM flag and our pods stopped trusting our partner's certificate

DEV Community: java·Sergey Shinder·14 days ago
#eiXBZXmP
#devtojava#devto#dev#entrypoint#partner
Long article (396 words) — no AI summary yet.
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.