Peterbarr
Peterbarr

Reputation: 33

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

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.

Upvotes: 2

Views: 1382

Answers (2)

Hasanul Murad
Hasanul Murad

Reputation: 127

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/

Upvotes: 0

Keilo
Keilo

Reputation: 986

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

Upvotes: 1

Related Questions