1

I have a Deployment with 3 replicas of a pod running the image 172.20.20.20:5000/my_app, that is located in my private registry.

I want do a rolling-update in the deployment when I push a new latest version of that image to my registry.

I push the new image this way (tag v3.0 to latest):

$ docker tag 172.20.20.20:5000/my_app:3.0 172.20.20.20:5000/my_app
$ docker push 172.20.20.20:5000/my_app

But nothing happens. Pods' images are not upgraded. This is my deployment definition:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: myapp-deployment
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: app
        image: 172.20.20.20:5000/my_app:latest
        ports:
        - containerPort: 8080

Is there a way to do that automatically? Should I run a command like rolling-update like in ReplicaControllers?

1
  • using latest tag is bad practice in kubernetes
    – c4f4t0r
    Mar 21, 2020 at 7:35

1 Answer 1

1

There is no reason to pull latest image from Kubernetes point of view - it's already available on the system and pods are in the declared state. Use proper image tagging and you will be OK.

There are some workarounds based on imagePullPolicy: Always, but IMO I don't like them: https://stackoverflow.com/questions/33112789/how-do-i-force-kubernetes-to-re-pull-and-image

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .