How to Force a Redeploy in Kubernetes

0 min read 86 words

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
Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags