If you need to force a redeploy of a deployment in Kubernetes, then you can use the rollout feature.

You may have an image that has been updated, but without changing the tag/version.

Step 1 – Optionally update the imagePullPolicy

If you have not changed the image version, then check your imagePullPolicy.

In your deployment.yaml file:

1
2
3
4
containers:
  - name: backend
    image: aoms/mock_backend_python:latest
    imagePullPolicy: Always

Step 2 – Get the deployment name

1
kubectl get deploy

Step 3 – Force the Redeployment

1
kubectl rollout restart deploy backend