<p>I'm using janusgraph docker image - <a href="https://hub.docker.com/r/janusgraph/janusgraph" rel="nofollow noreferrer">https://hub.docker.com/r/janusgraph/janusgraph</a>
In my kubernetes deployment to initialise the remote graph using groovy script mounted to <code>docker-entrypoint-initdb.d</code></p>
<p>This works as expected but in case if the remote host is not ready the janusgraph container throws exception and is still in the running mode.</p>
<p>Because of this kubernetes will not attempt to restart the container again. Is there any way so that I can configure this janusgraph container to terminate in case of any exception</p>

<p>A <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes" rel="nofollow noreferrer">readinessProbe</a> could be employed here with a command like <code>janusgraph show-config</code> or something similar which will exit with code -1</p>
<pre><code>spec:
  containers:
  - name: liveness
    image: janusgraph/janusgraph:latest
    readinessProbe:
      exec:
        command:
        - janusgraph 
        - show-config
</code></pre>
<p>Kubernetes will terminate the pod if the <code>readinessProbe</code> fails. A <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command" rel="nofollow noreferrer">livenessProbe</a> could also be used here too, in case this pod needs to be terminated if the remote host ever becomes unavailable.</p>
<p>Consider <a href="https://docs.janusgraph.org/advanced-topics/monitoring/#configuring-metrics-reporting" rel="nofollow noreferrer">enabling</a> JanusGraph server metrics, which could then be used with Prometheus for additional monitoring or even with the <code>livenessProbe</code> itself.</p>
