CoreOS Playground With PXE – Introduction [1/5]

CoreOS Playground With PXE

CoreOS is an open-source lightweight operating system based on the Linux kernel and designed for providing infrastructure to clustered deployments and it supports Docker out of the box.

Would not be great to have a CoreOS playground to experiment all mighty stuffs this OS promises? Well, it would, at least for me, and here I’d like to share with you how it is possible to create such environment.

The main objective is to come up with a system running on a single PC that allows a developer to easily run experiments involving CoreOS. Here above there’s a list of things I would like to be able to accomplish with this CoreOS playground.

  • Quickly set up a properly configured CoreOS machine and run Docker containers on it.
  • Quickly bring up additional CoreOS machine to test what happens when a node is added to the cluster.
  • Easily discard an entire cluster to try a new configurations.

To do that, I’m going to set a virtual machine not powered by CoreOS. It will act as a router connecting a NAT network on one side, to provide Internet access, and a CoreOS network on the other.

coreos-playground-network

 

On top of that, this machine will provide DHCP and CoreOS via PXE. This way CoreOS will be installed automatically through PXE. I’ll also set up an empty virtual machine properly configured for lan boot. This way, adding a CoreOS node to the cluster will be just a matter of cloning and starting the template machine. As you probably know, a CoreOS installation can be configured providing a reference to a “cloud-config” file. I’ll set up apache on the router to provide such file to the starting CoreOS nodes through HTTP. The following schema depicts the boot process from a logical point of view.

coreos-playground-pxe

I’m going to use VirtualBox to run the machine and Lubuntu for the Playground Server, even though I’m trying to provide as much command line as I can, so it should be all reasonably adaptable to other environments too.

This is just the first installment of this series. If you are interested, stay tuned for the next posts. I’ll show you how to implement the idea presented here.