Golden image
Perform automatic bootstrap on first agent start upΒΆ
Use a simple automatic bootstrap feature for the agent by defining the bootstrap key in the qbee-agent.json.
sudo cat /etc/qbee/qbee-agent.json
{"bootstrap_key":"<bootstrap-key>"}
sudo systemctl start qbee-agent
From the system logs we can now see that on service start the qbee-agent detects the presence of a bootstrap key and starts itself
sudo journalctl -u qbee-agent
Sep 14 11:50:50 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:50 [INFO] Found bootstrap key, bootstrapping device.
Sep 14 11:50:50 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:50 [INFO] Preparing agent directories
Sep 14 11:50:50 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:50 [INFO] Generating new private key
Sep 14 11:50:50 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:50 [INFO] Gathering system information
Sep 14 11:50:50 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:50 [INFO] Sending bootstrap request to device.app.qbee.io:443
Sep 14 11:50:51 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:51 [INFO] Preparing agent directories
Sep 14 11:50:51 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:51 [INFO] Bootstrap successfully completed
Sep 14 11:50:51 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:51 [INFO] Please remember to start the qbee-agent service as administrative user
Sep 14 11:50:51 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:51 [INFO] Detected start command based on OS attributes is: $ systemctl start qbee-agent
Sep 14 11:50:51 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:51 [INFO] Preparing agent directories
Sep 14 11:50:51 qbeedemo qbee-agent[1483]: 2023/09/14 11:50:51 [INFO] starting agent scheduler
This feature makes it possible to create golden images containing only the agent itself along with a simple config file containing the bootstrap key.