deploymentopenshiftopenshift-client-toolsrollout

Openshift deploy same tag from image stream


I have in openshift a deployment-config that will poll changes in the image stream & starts a new deployment whenever a new image is available. I have a requirement where I need to restart/redeploy same tag from the imagestream. I can achieve this by the deploy tab in the deployments section of the project in the openshift web console. Was checking for the cli version of the same. I am new to openshift & I couldn't find it out. I checked out the oc rollout option but it basically deploys the latest tag, but I need the existing tag itself to be redeployed.


Solution

  • Actually, you had the right answer from the start. The correct way to do this is oc rollout latest dc/dcname. This is equivalent to hitting the 'deploy' button in the UI. You don't need to modify the deployment to 'trick' it into redeploying.

    When it says 'latest', it means the latest version of your deploy config, and not the latest version of whatever image is being deployed.

    From the man page for oc rollout latest: "Start a new rollout for a deployment config with the latest state from its triggers"