CoreOS installation to bare metal

Container talk

Christopher Colmain22 Oct 2017 at 6:15 PM

There comes a time in every IT guy's life (and gal's? well I've never heard of it but maybe it happens) where he rolls up his sleeves and does his own bare metal install of a very cool operating system on a spare server that just happens to be lying around the office.

It's the modern day equivalent of pulling up the hood of your car and replacing the 'carby', giving it a service or otherwise tinkering with the 'hardware'.

An operating system I have been eyeing off since 2014 has been CoreOS. Up until now our servers have always been the 'de facto' enterprise standard - CentOS.

Moving from something known and trusted to something new and unknown has been a bit of a challenge, not just to me but to our main operations guy. CentOS is like an old friend and always been faithful and reliable so there's was a feeling of 'turning my back' on it to try CoreOS.

CoreOS is a relative new kid on the block that 100% designed to run containers (Docker, rkt etc.,) and to that aim it is very lightweight and 'agile' (dare I use that word?).

CoreOS is referred to as 'Container Linux' by many. It's backed by a very big player: google. It also is designed to work with the fastest growing cloud orchestration technology: kubernetes - a technology google derived from its internal 'Borg' software and opened source to the world.

So I decided to take the plunge...

I downloaded the stable release as an ISO from here:

https://coreos.com/os/docs/latest/booting-with-iso.html

Christopher Colmain22 Oct 2017 at 6:27 PM

I downloaded Win32DiskImager and 'burnt' the ISO onto a USB drive.

I inserted the USB drive into a HP DL 360 and fired it up.

Unlike most ISO/USB installs this CoreOS one does not actually automatically prompt you to install the image to the hard disk.

This is because when CoreOS installs it does not provide an account with a password but instead it requires an SSH key - which mandates a couple of things:- Your server has a working NIC connected to a LAN which has internet access.- Every time you log on, you must log on remotely via SSHIn case you are wondering how you will access your server in case the NIC dies or you don't have network access for some other reason rest assured that it's standard Linux at its core so you can create a special admin user a password (make it very strong) with 'sudo' access.

So basically you must run a script (which has your SSH public key embedded in it - use puttyGen to create a public/private key if you don't already have one).

This is all explained in the CoreOS 'Intallation to disk' page:

https://coreos.com/os/docs/latest/installing-to-disk.html

One thing that is not mentioned on this page is that after you boot from USB you will not be able to proceed to either create your ignition.json script nor run the installation script!

This is because the 'core' user that the USB boots up in does not have root access. I was a little stumped at first - trying to find the root password but then I discovered a site that explained that 'core' is in the sudo'ers list so all that is needed is to type:

# sudo bash

and then you have a shell running as root and you can do all the things the installation notes tell you to do!