Kubernetes auto-scaling

43 views
Skip to first unread message

Montassar Dridi

unread,
Jan 25, 2017, 7:02:45 PM1/25/17
to Kubernetes user discussion and Q&A
Hello!!
I'm using Kubernetes Deployment for my java application and set-up the Horizontal pod autoscaling too, but when I stress test my application, I see the increase of the number of the pods and nodes but at the same there is a downtime, the website doesn't load sometimes when I refresh the page, how can i avoid that, and the application keeps running smoothly with no downtime when the auto-scaling happens to meet the high demand of traffic?

Timo Reimann

unread,
Jan 26, 2017, 5:31:02 AM1/26/17
to Kubernetes user discussion and Q&A
Wild guess: Does your application possibly not have liveness / readiness probes configured? In that case, the container might technically already be up and running from kubelet's perspective and receive traffic while the Java application might not be ready yet. (JVM applications tend to take a bit of time to become truly available.) The solution would then be to install a readiness probe. (See also Ian's Lewis excellent blog post on the subject.)

Note that you might also want to have a graceful termination handler to smoothly shut down, e.g., when the autoscaler decides to reduce the number of containers. The termination process is described here.

HTH
Timo

Montassar Dridi

unread,
Jan 26, 2017, 10:49:18 AM1/26/17
to Kubernetes user discussion and Q&A
you are right there is a delay between when the pod is ready and when the tomcat starts running for my application to come up, I'm experiencing with  readinessprobe right now, but when I update it, my first deployment doesn't happen and my first pod keep restarting the server or won't start when i try this
livenessProbe:
  # an http probe
  httpGet:
    path: /healthz
    port: 8080
  initialDelaySeconds: 15
  timeoutSeconds: 1
readinessProbe:
  # an http probe
  httpGet:
    path: /readiness
    port: 8080
  initialDelaySeconds: 20
  timeoutSeconds: 5
Can you provide me with any other tutorial I can follow, please.

Timo Reimann

unread,
Jan 26, 2017, 11:08:02 AM1/26/17
to kubernet...@googlegroups.com
I responded to the other thread you started on the dev mailing list: https://groups.google.com/topic/kubernetes-dev/wiaSTzrI28A/discussion

Please try to avoid cross posting in the future. :-)

--
You received this message because you are subscribed to a topic in the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kubernetes-users/xxXUNM2BOo4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Montassar Dridi

unread,
Jan 26, 2017, 5:36:13 PM1/26/17
to Kubernetes user discussion and Q&A
Thank you so much, sorry but sometimes I don't get a response from the dev mailing list
To unsubscribe from this group and all its topics, send an email to kubernetes-use...@googlegroups.com.
To post to this group, send email to kubernet...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages