When using Container-Optimized OS images, I understand they Autoupdate, but require an instance reboot.
(as per https://cloud.google.com/container-optimized-os/docs/concepts/auto-update )
Is there a way to determine if there has been an update and an instance reboot is needed? a pending reboot or something?
Via the Console and/or some gcloud command?
Also, if a new instance is built from a COS Image that is behind a few build versions, how soon would the updates be applied to that instance? minutes, hours?
ex: instance is built and booted from cos-109-17800-218-44 image. The latest in that milestone is cos-109-17800-218-52.
What would be the expected time frame for that to be applied, and a reboot needed to run on cos-109-17800-218-52.?
Thanks
Hi @techsmokejumper,
You can try:
gcloud compute instances describe INSTANCE_NAME --zone ZONE --format="get(osConfig.needRestart)"
This should return True if a reboot is needed, and False otherwise.
As for the timing of updates being applied to a new instance built from a COS image that is behind a few build versions, the exact timing can vary depending on your specific instance setup, how well it's connected to the network, and Google's update schedule.
In your example, if an instance is built and booted from the cos-109-17800-218-44 image, and the latest image in that milestone is cos-109-17800-218-52, the update would likely be applied within a few hours. Once the update is applied, a reboot would be required to run on the new image.