Configuring a node after install

kairos configuration mechanism is all based on cloud-config file.

By default, kairos reads in lexicographic order YAML cloud-config files in the /usr/local/cloud-config and /oem directories.

For instance, after installation you should be able to see the configuration generated by the interactive-installer in the /oem/99_custom.yaml config file.

This mechanism can be used to set and enable persistent configuration on boot, also after deployment

Examples

Below you will find some examples on how to use the cloud-config mechanism to enable/disable specific features.

Enabling ZRAM on boot

Copy the following file in /oem/100_zram.yaml or /usr/local/cloud-config/100_zram.yaml:

stages:
  boot:
       -  name: "zram setup"
          commands: 
          - modprobe zram
          - echo lzo > /sys/block/zram0/comp_algorithm
          - echo 1G > /sys/block/zram0/disksize
          - mkswap --label zram0 /dev/zram0
          - swapon --priority 100 /dev/zram0
name: "zfs setup"

This YAML will run the commands on boot enabling zram as swap.