How do you update a container in a container-vm after its image changed in Google Container Engine?

1/27/2015

I run a service in a container on a container-vm on Google Container Engine. I followed https://cloud.google.com/compute/docs/containers/container_vms#creating_containers_at_time_of_instance_creation with first creating the containers.yaml conf:

version: v1beta2
containers:
  - name: example-image
    image: gcr.io/your_project_name/example-image

And then creating the instance:

gcloud compute instances create containervm-example \
    --image container-vm \
    --metadata-from-file google-container-manifest=containers.yaml \
    --zone us-central1-a \
    --machine-type f1-micro

If my image changes to gcr.io/your_project_name/example-image:new-tag how do I update the running container?

Do I necessarily have to delete the instance and create another one with the same name but with an updated conf file with the name of my new image? It seems a bit radical to me. If I try to stop the running container from the vm, it restarts automatically. If possible I don't want to do any manual operations on the vm, I just want to run my container on it.

In this video I saw that to update the running containers he uses a command that looks like:

cloudcfg.sh -u 15s rollingupdate dataController

But I don't find the documentation and it's for running containers in a cluster with Kubernetes. If I'm running a container-vm what is the advised way to maintain my containers in it? Containers still have the kublet service but I can't find how to use it to update the containers when their image changes.

-- eloone
google-cloud-platform
google-container-registry
google-kubernetes-engine

1 Answer

1/28/2015

The container VM is only part of the full Kubernetes/Container Engine infrastructure. Container VM doesn't support the complete Kubernetes API, the kubecfg.sh example that I did in the I/O demo uses the full Kubernetes API.

There's more information about using full container engine here: https://cloud.google.com/container-engine/

And a rolling update example from the OSS Kubernetes project here: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl.md#rollingupdate

-- brendan
Source: StackOverflow