<p>I have an image runing a node.js application.
Inside this application I have the method /kill that kill the process ("process.exit();").</p>

<p>I have a deployment with three replicas running the above image.
I expose the deployment through a service of type NodePort.</p>

<p>When I call the /kill against one replica it exists and the request fails then kubernetes retry the request against the other replicas and all of them exit.</p>

<p>This is my service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: hellokube-service
  labels:
    app: hellokube
spec:
  type: NodePort
  ports:
  - port: 8080
    targetPort: 8080
    nodePort: 31111
  selector:
    app: hellokube
</code></pre>

<p>Is it possible to avoid this retry?</p>

<p>It was not kubernetes who was retrying. It was the browser.</p>

<p>My node.js method implementation is:</p>

<pre><code>app.get("/kill", function(req, res, next){
    logger.info("Somebody kill me.");
    process.exit();
});
</code></pre>

<p>It is a get and it returns nothing. The browser detect an unexpected loose of connection with an idempotent operation and retry the operation.
<a href="https://mnot.github.io/I-D/httpbis-retry/" rel="nofollow noreferrer">https://mnot.github.io/I-D/httpbis-retry/</a></p>

<p>If I return something or I change the operation to a POST operation it does not happen.</p>

<p>I didn't know about this browser behavior.</p>

<p>If you make the invoke to the original operation using curl instead of a browser it does not retry. SOAPUI does retry.</p>
