Pushing configuration to a node after installation
Kairos configuration mechanism is based on the cloud-config
file given during installation, however, it’s possible to extend the configuration by providing additional cloud-configs in either /oem
or /usr/local/cloud-config
.
By default, kairos
reads in lexicographic order YAML cloud-config files in the directories above, indeed, after installation you should be able to see the configuration generated by the interactive-installer as /oem/99_custom.yaml
in the system.
This mechanism can be used to set and enable persistent configuration on boot after node deployment.
We are going to see how to do that manually or with Kubernetes by using the
Manually
SSH into the node and copy the config file you want to add into /oem
. For instance, to add zram on boot we can copy the following file in /oem/100_zram.yaml
or /usr/local/cloud-config/100_zram.yaml
and reboot:
With Kubernetes
To push configurations to a node, it is necessary system-upgrade-controller to be deployed in the target cluster which executes plan to the cluster nodes. In the example below, we use a plan to push a swapfile of 3gb enabled during boot, and restart the node afterward.
To install system-upgrade-controller, use kubectl:
Note
Several roll-out strategies can be used withsystem-upgrade-controller
which are not illustrated here in this example. For instance, it can be specified in the number of hosts which are running the upgrades, filtering by labels, and more. Refer to the project documentation on how to create efficient strategies to roll plans on the nodes. In the example above, the plans are applied to every host of the cluster, one-by-one in sequence.
The following pushes a new cloud config over the /oem
directory and reboots the node:
Feedback
Was this page helpful?
Awesome! Glad to hear it! Please tell us how we can improve.
Oh snap! Sorry to hear that. Please tell us how we can improve.