Skip to content

Docker image for starting a simple web server in Go to test Kubernetes Horizontal Pod Autoscaler.

Notifications You must be signed in to change notification settings

manuelkasiske4idealo/hpa-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HorizontalPodAutoscaler Walkthrough

This example is based on horizontal pod autoscale example. https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/

Compared to the original example, this one is based on golang and it is using an unprivileged port 1025 to be compliant with pod security policies.

Install The Example Application

With the following command, the sample application will be installed.

❯ kubectl apply -f webserver.yaml

To start the load test use:

❯ kubectl run -it --rm load-generator --image=busybox /bin/sh --generator=run-pod/v1
while true; do wget -q -O- http://webserver-service; done

The scheduler will scale up, until the cpu usage is below the defined 20%.

❯ kubectl get hpa
NAME         REFERENCE               TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
webserver    Deployment/php-apache   19%/20%   1         100       7          17m

About

Docker image for starting a simple web server in Go to test Kubernetes Horizontal Pod Autoscaler.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 52.5%
  • Makefile 24.9%
  • Dockerfile 22.6%