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:
containers:
- name: backend
image: aoms/mock_backend_python:latest
imagePullPolicy: Always
Step 2 – Get the deployment name
kubectl get deploy
Step 3 – Force the Redeployment
kubectl rollout restart deploy backend