Recently I have begun to play with Immutable Hosts, that is host operating systems that are built using a very minimal set of tools, and many times using a containerized method to do so. These hosts include the much loved CoreOS, Project Atomic from RedHat, and RacherOS. CoreOS comes up a lot in the Kubernetes world, so I decided to give it a try.
I’m installing CoreOS on my local hypervisor, so I needed to generate a
yaml that would be converted into the
ignition.json that is used to do the basic setup of the host. After a little bit of trial and error I came up with a working
ignition.json that did a few very basic things. First, it set up my user with an SSH key, password, and sudo rights. Second, it set the hostname of the provisioned machine.
passwd: users: - name: ronin password_hash: "" groups: - wheel ssh_authorized_keys: - <ssh pub key> storage: files: - path: /etc/hostname filesystem: root mode: 420 contents: inline: hostname
During installation I simply
wget this file from a temporary webserver to the installation machine and use it for the installation.
Pretty simple, but important so you can monitor and run reboots on the host machine (unless you let them auto-reboot for updates).
Oh, and Happy New Year!