Reputation: 422
I was running a container on GCP VM, and it ran the latest image without an issue.
However recently I found the container it ran was not the latest anymore, even the only image in the registry is the latest version I pushed there.
I tested it by deleting the image from the registry, and running VM without changing the container image name in the VM setting. Not surprisingly, the VM still runs the old container.
As I can't think of any reason for this, could someone give me a hint?
Thanks!
Upvotes: 4
Views: 655
Reputation: 4443
From your description I assume that you're running a single VM with Container Optimized OS (COS).
Container-Optimized OS images have the built-in capability to automatically upgrade to a newer version when released. This capability, when enabled, allows user instances to stay up-to-date with respect to security fixes and bug fixes.
So - when your image was in the Container registry it was the same version as the one running on your VM. When you deleted it the auto-update feature didn't have anything to compare to so it ran your old (but still tha latest) image.
If you push newer version to the registry your image should be updated automatically.
However this feature may be disabled, here's how:
gcloud compute instances add-metadata --metadata cos-update-strategy=update_disabled
So - you can check your VM's metadata to figure out the status of the feature.
There's also one exception when the auto-update will not work:
Users running standalone Container-Optimized OS with any of the affected versions, and having the auto-update feature enabled, will not see their instances being updated to newer versions. In these cases, users should manually choose newer OS versions by recreating their VM instances with the newer image. Automatic updates will continue to work on all supported milestones for new releases.
These images cannot be updated to latest versions:
- On Milestone 77: images prior to cos-77-12371-1000-0
- On Milestone 81: images prior to cos-81-12871-1000-0
- On Milestone 85: images prior to cos-85-13310-1000-0
- On Milestone 86: images prior to cos-dev-86-15053-0-0
These images will no longer receive any updates:
All milestones before 77, including any previously deprecated milestones.
Upvotes: 1