<p>What is the default behaviour on GCP Kubernetes for Spring Boot applications when </p>

<blockquote>
  <p>System.exit(1)</p>
</blockquote>

<p>is called? Will kubernetes recreate the container?
If no - how can i force recreation if my application crashes?</p>

<p>-Alex</p>

Alex Tbk
<p>On exit code for application kubernetes will restart the container inside the POD and pod state will change to in <code>Ready</code> column.</p>

<p>if you want to terminate pod gracefully you can have a look at this : <code>https://dzone.com/articles/gracefully-shutting-down-java-in-containers</code></p>

<pre><code>Terminated: Indicates that the container completed its execution and has stopped running. A container enters into this when it has successfully completed execution or when it has failed for some reason. Regardless, a reason and exit code is displayed, as well as the container’s start and finish time. Before a container enters into Terminated, preStop hook (if any) is executed.

...
      State:          Terminated
        Reason:       Completed
        Exit Code:    0
        Started:      Wed, 30 Jan 2019 11:45:26 +0530
        Finished:     Wed, 30 Jan 2019 11:45:26 +0530
    ...
</code></pre>

<p>Please have a look at kubernetes official doc : <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/</a></p>
