How do I update a service in the cluster to use a new docker image

8/21/2019

I have created a new docker image that I want to use to replace the current docker image. The application is on the kubernetes engine on google cloud platform.

I believe I am supposed to use the gcloud container clusters update command. Although, I struggle to see how it works and how I'm supposed to replace the old docker image with the new one.

-- Peterbarr
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

8/22/2019

You can use Container Registry[1] as a single place to manage Docker images.

Google Container Registry provides secure, private Docker repository storage on Google Cloud Platform. You can use gcloud to push[2] images to your registry, then you can pull images using an HTTP endpoint from any machine.

You can also use Docker Hub repositories[3] allow you share container images with your team, customers, or the Docker community at large.

[1]https://cloud.google.com/container-registry/

[2]https://cloud.google.com/container-registry/docs/pushing-and-pulling

[3]https://docs.docker.com/docker-hub/repos/

-- Hasanul Murad
Source: StackOverflow

8/21/2019

You may want to use kubectl in order to interact with your GKE cluster. Method of image update depends on how the Pod / Container was created.

For some example commands, see https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources

For example, kubectl set image deployment/frontend www=image:v2 will do a rolling update "www" containers of "frontend" deployment, updating the image.

Getting up and running on GKE: https://cloud.google.com/kubernetes-engine/docs/quickstart

-- Keilo
Source: StackOverflow