Today I’m really pleased to announce the Brightbox Kubernetes Autoscaler. With this enabled, your Kubernetes cluster can grow and shrink its own cloud server capacity in response to demand. It’s a simple as configuring the maximum number of servers you want to build and scaling up your Deployments:
$ kubectl -n example scale --replicas=4 deployment/hello-world
deployment.apps/hello-world scaled
$ kubectl -n example get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
hello-world-5f48c6bb68-drw4n 1/1 Running 0 10m 192.168.146.71 srv-hrgv1 <none> <none>
hello-world-5f48c6bb68-fxtnc 1/1 Running 0 2m10s 192.168.146.72 srv-hrgv1 <none> <none>
hello-world-5f48c6bb68-c2mjx 0/1 Pending 0 4s <none> <none> <none> <none>
hello-world-5f48c6bb68-qrv2h 0/1 Pending 0 4s <none> <none> <none> <none>
$ kubectl -n example get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
hello-world-5f48c6bb68-drw4n 1/1 Running 0 15m 192.168.146.71 srv-hrgv1 <none> <none>
hello-world-5f48c6bb68-fxtnc 1/1 Running 0 7m4s 192.168.146.72 srv-hrgv1 <none> <none>
hello-world-5f48c6bb68-c2mjx 1/1 Running 0 4m58s 192.168.102.1 srv-e4isv <none> <none>
hello-world-5f48c6bb68-qrv2h 1/1 Running 0 4m58s 192.168.102.2 srv-e4isv <none> <none>
When new pods need scheduling but there isn’t the capacity, they go into
Pending
state and the autoscaler builds new servers using our
API, adds them to the cluster, and the pods get deployed
to them. Magic!
When they’re done with and the deployment is scaled down, the autoscaler notices the empty servers and removes them from the cluster. So you just pay for the server time you need.
There is a full guide on how to set this up here, and we’ve also written a blog post diving into the technical details of how it all works behind the scenes.
If you want to play with Kubernetes autoscaling, you can sign up for Brightbox in just a couple of minutes and use your £50 free credit to give it a go.
If instead you want us to run Kubernetes for you, or anything else for that matter, we offer hands-on support and managed services too. Drop us a line.