Google container engine - update replication controller multi-container pods

2/29/2016

Trying to update a multi-container pods with

kubectl rolling-update my_rc --image=eu.gcr.io/project_id/myimage

I got:

error: Image update is not supported for multi-container pods

What is the way to update a single container or I must delete and recreate the pod ?

-- Ali SAID OMAR
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

2/29/2016

For now, your best option is to update the yaml file defining the replication controller to use the new image and run:

kubectl rolling-update my_rc -f my_file.yaml

If you don't have a yaml file defining your replication controller, you can get one by running:

kubectl get rc my_rc --output=yaml > my_file.yaml

You should then be able to update the image specified in that file and run the rolling-update.


In the next release of Kubernetes (targeted for March), you'll be able to just pass the --container flag to tell kubectl which of the containers in the pod should use the new image:

kubectl rolling-update my_rc --container=my_container --image=eu.gcr.io/project_id/myimage

This feature was added by a community member after version 1.1 was cut.

-- Alex Robinson
Source: StackOverflow