Bug 1383804 - Deployment Config has wrong configuration when using Pipelines Tech Preview
Summary: Deployment Config has wrong configuration when using Pipelines Tech Preview
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-controller-manager
Version: 3.3.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Samuel Padgett
QA Contact: zhou ying
URL:
Whiteboard:
: 1396970 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-11 19:47 UTC by Christian Hernandez
Modified: 2017-03-08 18:43 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When "Autodeploy when: New image is available" was unchecked in the web console "add to project" page, the web console would not create an image change trigger on the new deployment config. This meant that users had to manually set an image using `oc set image` before deployments. Otherwise all deployments would fail with image pull back-off errors. The web console was updated to add an image change trigger with "automatic: false". This prevents deployments from happening automatically when the image stream tag is updated, but lets users run `oc rollout` commands -- or using the "Deploy" action in the web console -- without any additional configuration.
Clone Of:
Environment:
Last Closed: 2017-01-18 12:42:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Disable autobuild (23.59 KB, image/png)
2016-10-11 19:47 UTC, Christian Hernandez
no flags Details
Disable Autodeploy (24.68 KB, image/png)
2016-10-11 19:48 UTC, Christian Hernandez
no flags Details
Wrong Deployment config is configured (46.85 KB, image/png)
2016-10-11 19:48 UTC, Christian Hernandez
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 17:23:26 UTC

Description Christian Hernandez 2016-10-11 19:47:41 UTC
Created attachment 1209313 [details]
Disable autobuild

Description of problem:

I am using the following for build pipelines https://paste.fedoraproject.org/448758/

This spawns a new jenkins stack in my project as expected.

The issue comes when I create a new app. I use the "add to project" button and disable automatic build and deploy triggers (see screenshots)

This gives an error when I fire off a pipeline build in the "deploy" step. It give an "image pull backoff" error because it cannot find `image:tag` image (see screenshot).

It only works when I edit the deploymentConfig of the application and change the image to..

172.30.198.59:5000/welcome-pipeline/welcome-php:latest

Note; I tried doing `namespace/image:tag` but it doesn't work. You have to specify `router-svc-ip:5000/namespace/image:tag`

[root@ose3-master ~]# oc version
oc v3.3.0.34
kubernetes v1.3.0+52492b4
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ose3-master.example.com:8443
openshift v3.3.0.34
kubernetes v1.3.0+52492b4


How reproducible:

Always


Steps to Reproduce:
1. Create a new project
2. In the WebUI - import pipeline builder yaml https://paste.fedoraproject.org/448758/
3. Add app to project naming it to what the pipeline builder would be looking for (in the above example it's `welcome-php`)
4. Click "start-pipeline"

Actual results:

Build Succeeds
Deployment Fails (ImagePull Backoff)


Expected results:

Build Succeeds
Deployment Succeeds 

Additional info:

Working DeploymentConfig (after I modify it): http://paste.fedoraproject.org/448760/15157147/

DeploymentConfig that isn't working (the one setup by OCP by default): https://paste.fedoraproject.org/448762/76215201/

Comment 1 Christian Hernandez 2016-10-11 19:48:13 UTC
Created attachment 1209314 [details]
Disable Autodeploy

Comment 2 Christian Hernandez 2016-10-11 19:48:37 UTC
Created attachment 1209315 [details]
Wrong Deployment config is configured

Comment 3 Christian Hernandez 2016-10-11 19:50:06 UTC
I tested using this simple php script

https://github.com/christianh814/welcome-php

Comment 4 Michal Fojtik 2016-10-12 08:33:48 UTC
This is an expected behavior since you don't have the ICT defined. In this case you have to do "manual" deployment, so you have to set the image manually (you can use the "oc set image" for this (or call that command from Jenkins).

Another option is to define the image change trigger and set "automatic=false". In this case when the deployment config is instantiated, it will resolve the image define inside image change trigger.

Comment 14 Gabe Montero 2016-10-31 14:27:36 UTC
@zhou ying - ok thanks ... 1 more follow up, when you bring up the jenkins image, can you go to Manage Jenkins -> Manage Plugins page, then go to the installed tab, and confirm the plugin version.

Otherwise, Michal - we'll need some help.  What was the expected behavior when the plugin started using the instantiate endpoint?  And if what Zhou Ying sees does not match that expected behavior, how should we go about diagnosing?

thanks

Comment 15 Gabe Montero 2016-10-31 18:32:39 UTC
@zhou ying - I just remembered that I saw in a github issue somewhere that the instantiate endpoint for deployment may only be available in 1.4.

@Michal - is that correct?

Comment 16 Michal Fojtik 2016-10-31 18:35:02 UTC
(In reply to Gabe Montero from comment #15)
> @zhou ying - I just remembered that I saw in a github issue somewhere that
> the instantiate endpoint for deployment may only be available in 1.4.
> 
> @Michal - is that correct?

That is correct. The plugin should fallback to legacy code if the instantiate endpoint return 404 (which means the plugin is talking to older version). You might review the code Michalis did in "oc rollout latest".

Comment 17 Gabe Montero 2016-10-31 19:11:35 UTC
Thanks for the confirm Michal.  And yes, the plugin falls back if talking to the older version

So Zhou Ying, if you are willing to test against the latest jenkins-1-centos7 image, you cannot run against 3.3.1.3.  You need to run against a pre-release 3.4 install.

Comment 18 Gabe Montero 2016-11-01 13:56:36 UTC
Moving to on qa for a retry against 1.4 / 3.4 and the latest jenkins image.

Comment 19 zhou ying 2016-11-02 10:01:10 UTC
Thanks. Today, I can reproduce the issue  with the latest OCP :
openshift v3.4.0.18+ada983f
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0

If only with 'ConfigChange' in triggers, use "oc rollout latest" still met error:
failed to
"StartContainer" for "nodejs-mongodb-example" with ImagePullBackOff: "Back-off pulling image.

I must edit the dc with 172.30.187.114:5000/zhouy2/nodejs-mongodb-example:latest.

Comment 20 Gabe Montero 2016-11-02 14:30:33 UTC
OK, QE is having issues with `oc rollout`, where jenkins and the pipeline plugin is not even being used.

Sending over the Michal to have his team sort out the logisitcs with that.  Once we are in sync with `oc rollout`, we can then revisit translating the scenario to Jenkins and use of the deploy instantiate endpoint.

Comment 21 Michail Kargakis 2016-11-02 14:48:42 UTC
@zhou in order to resolve the image in the DC you have to use an ICT, otherwise `oc rollout latest` will not resolve the image automagically for you. Automatic can be set to false if you want manual deployments, the ICT has to exist though. Not sure what can be done on our end apart from docs.

Comment 22 Michail Kargakis 2016-11-02 20:49:36 UTC
I have also opened https://github.com/openshift/origin-web-console/issues/808 in the web console repo to have the UI not remove the ICT when a user doesn't want automatic deployments on image updates but just set automatic to false.

Comment 23 Samuel Padgett 2016-11-02 22:07:47 UTC
(In reply to Michail Kargakis from comment #22)
> I have also opened
> https://github.com/openshift/origin-web-console/issues/808 in the web
> console repo to have the UI not remove the ICT when a user doesn't want
> automatic deployments on image updates but just set automatic to false.

Web console change:

https://github.com/openshift/origin-web-console/pull/810

Comment 24 Michal Fojtik 2016-11-04 08:04:41 UTC
The web console change was merged and the QA was guided how to use this, moving this ON_QA.

Comment 25 zhou ying 2016-11-10 05:12:49 UTC
Has confirmed with latest OCP,the issue has fixed:
 openshift version
openshift v3.4.0.24+52fd77b
kubernetes v1.4.0+776c994
etcd 3.1.0-rc.0


When create app without 'New image is available ' on web console, check the DC, not remove the ICT and set the automatic to false.  After 'start-pipeline' , when the build completed, could auto deploy with the latest images succeed.

Comment 26 Samuel Padgett 2016-12-02 18:40:10 UTC
*** Bug 1396970 has been marked as a duplicate of this bug. ***

Comment 28 errata-xmlrpc 2017-01-18 12:42:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0066


Note You need to log in before you can comment on or make changes to this bug.