The CoreOS documentation lists various places to look for your cloud-config file, depending on how and where the CoreOS instance is provisioned. Since I'm working through this problem myself, I added a cloud-config file to one of the locations, /var/lib/coreos-install/user_data
, with the following:
#cloud-config
coreos:
locksmith:
window-start: Fri 10:00
window-length: 2h
When I rebooted the instance I looked at systemctl status locksmithd
and it looks like my config took hold
ip-172-23-109-250 core # systemctl status locksmithd
● locksmithd.service - Cluster reboot manager
Loaded: loaded (/usr/lib/systemd/system/locksmithd.service; disabled; vendor preset: disabled)
Drop-In: /run/systemd/system/locksmithd.service.d
└─20-cloudinit.conf
Active: active (running) since Fri 2018-03-02 00:36:48 UTC; 1min 37s ago
Main PID: 878 (locksmithd)
Tasks: 4 (limit: 32768)
CGroup: /system.slice/locksmithd.service
└─878 /usr/lib/locksmith/locksmithd
Mar 02 00:36:48 ip-172-23-109-250.us-west-2.compute.internal systemd[1]: Started Cluster reboot manager.
Mar 02 00:36:49 ip-172-23-109-250.us-west-2.compute.internal locksmithd[878]: Reboot window start is "Fri 10:00" and length is "2h"
Mar 02 00:36:49 ip-172-23-109-250.us-west-2.compute.internal locksmithd[878]: Next window begins at 2018-03-02 10:00:00 +0000 UTC and ends at 2018-03-02 12:00:00 +0000 UTC
Mar 02 00:36:49 ip-172-23-109-250.us-west-2.compute.internal locksmithd[878]: locksmithd starting currentOperation="UPDATE_STATUS_IDLE" strategy="reboot"
Since I'm provisioning my CoreOS instance with kops, which reserves the Ec2 metadata cloud-config file location for its own shell script, I had to add this additional space for my own cloud-config. It appears that CoreOS is able to pull both configs in.
Alternatively, you can declare your own cloud-config path with sudo coreos-cloudinit --from-file=/home/core/cloud-config.yaml