AutoScaling Unikernels with Instance Groups

One of our customers reached out a week or so ago asking about the ability to add a unikernel to an instance group on Google Cloud. Instance Groups provide a number of features including:

  • AutoScaling
  • AutoHealing
  • MultiZone Deployment
  • Automatic Updating

All of this is fully managed freeing the end developer from having to stand up a reverse proxy and configure it themselves. Autoscaling has also been a common feature request from many users coming from a kubernetes environment. The cool thing about unikernels is that all of the kubernetes complexity gets abstracted away since Nanos unikernels are deployed as virtual machines and the underlying cloud network and volume primitives are utilized versus duplicated with frameworks such as k8s.

One of the things we've been pleasantly surprised at and didn't realize before was that unikernels running on public cloud platforms like AWS and Google Cloud remove a lot of kubernetes complexity that exist because they aren't duplicating these layers. This combined with the fact that they aren't running Linux allows the developer to treat the cloud as just one big computer that they don't have to manage. Using Google Cloud's instance group you can load balance up to 2,000 instances per regional group - that's a lot! I will say offhand that you might need to produce quite a bit of traffic or have quite a lot background jobs to actually utilize this feature. In general, for the same instance size, apples for apples, Nanos instances will run a lot faster than normal Debian/Ubuntu Linux instances. Go and Rust webservers for instance, routinely clock in with 200% more requests/second.

Ready to try it out? To get started ensure you have OPS version 0.1.26:

➜  ~ ops version
Ops version: 0.1.26
Nanos version: 0.1.36

Don't have OPS? Go download it here.

Your instance group should already be created. Here you can set things like the autoscaling policy, the min/max number of instances and such. When you use the new instance group flag on 'ops instance create' several tasks will happen. First, OPS will create a new instance template based upon the new image.

Keep in mind with unikernels every single time you hit the deploy button you create a new disk image. Then OPS assigns the instance template to the instance group. Finally it'll force re-create the instances with the new template, athough this could be optional. The instance template will track any firewall rule changes such as your ports.

The command is just like deploying a normal single instance but with the addition of the instance-group flag:

$ ops instance create my-webserver -t gcp -p prod-1000 -z us-west2-a --port 80 --port 443 --instance-group my-instance-group

Boom. You now have auto-scaling, auto-healing, multi-zone load balanced unikernels. It couldn't be simpler.

Deploy Your First Open Source Unikernel In Seconds

Get Started Now.