<p>As per my experience, it is not a good idea because the availability of a pod is not directly related to how fast the container is up, a lot of other things affects the time the pod is ready and the time kubernetes sends traffic to that new pod.</p>

<p>You need to think about how your scalability strategy is trying to adapt to your actual traffic and the different health checks change that readiness time.</p>

<p>In Kubernete you have the livenessProbe and radynessProbe used to check two different thinks on the lifecycle of the pod, because of that you need to review the lifecycle of a pod in kubernetes and if your app can adapt to it.</p>

<p><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>

<p>In case you are worried about the number of requests you can handle per second my advice is to have a pool of pods ready to response a good amount of it and take metrics to know better how your app responds to a high demanding traffic context and understand how the loadbalancing of kubenetes work and can affect your app, with that try to scale in a more smart way.</p>

CC BY-SA 4.0
2019-06-10T11:03:46.217Z
2019-06-10T11:03:46.217Z
wolmi
<p>Is it possible to deploy 1 pod per each REST request?  My process starts up in .004s and is about 1GB in size.   After the REST request completes the pod will terminate.</p>

<p>Given that I'd like to deploy the pod/container for this on each REST request. Is it possible to do this in &lt; 200ms?  A sort of serverless architecture using kubernetes. </p>

<p>How would you do this in a reliable / resilient way?</p>

<kubernetes>
Deploying a pod per REST request?
blaze
# Deploying a pod per REST request?

(Asked by: username_0 on 2019-06-10)

Is it possible to deploy 1 pod per each REST request? My process starts up in .004s and is about 1GB in size. After the REST request completes the pod will terminate.

Given that I'd like to deploy the pod/container for this on each REST request. Is it possible to do this in < 200ms? A sort of serverless architecture using kubernetes.

How would you do this in a reliable / resilient way?

**Tags:** kubernetes


---

## 1 answers

### Answer by username_1 on 2019-06-10. Score: 0 | Accepted answer

As per my experience, it is not a good idea because the availability of a pod is not directly related to how fast the container is up, a lot of other things affects the time the pod is ready and the time kubernetes sends traffic to that new pod.

You need to think about how your scalability strategy is trying to adapt to your actual traffic and the different health checks change that readiness time.

In Kubernete you have the livenessProbe and radynessProbe used to check two different thinks on the lifecycle of the pod, because of that you need to review the lifecycle of a pod in kubernetes and if your app can adapt to it.

<https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/>

In case you are worried about the number of requests you can handle per second my advice is to have a pool of pods ready to response a good amount of it and take metrics to know better how your app responds to a high demanding traffic context and understand how the loadbalancing of kubenetes work and can affect your app, with that try to scale in a more smart way.


---

