openshift / pipelines-tutorial

A step-by-step tutorial showing OpenShift Pipelines
Apache License 2.0
298 stars 623 forks source link

Use DeploymentConfig instead of Deployment #70

Closed ppitonak closed 3 years ago

ppitonak commented 4 years ago

When the user starts the pipeline, the image is built and application is deployed. However, when the pipeline is started second time, the image is built but the old version continues to work.

The reason is that the tasks apply-manifests and update-deployment don't change anything (they replace the string with the same string) and therefore the deployment doesn't notice the change, see https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

Note: A Deployment’s rollout is triggered if and only if the Deployment’s Pod template (that is, .spec.template) is changed, for example if the labels or container images of the template are updated. Other updates, such as scaling the Deployment, do not trigger a rollout.

there are multiple ways how to solve it:

  1. add some kind of restart to the pipeline
  2. replace Deployment with DeploymentConfig which is able to trigger rollout on change in image stream
  3. start versioning/tagging the image, i.e. don't use latest tag but e.g. timestamp
  4. use sha digest instead of tag latest

@vdemeester suggested the following

in the future we should use result instead of image PipelineResource, and have a step in those build that know how to get the digest

The fastest and easiest change is to use DeploymentConfig instead of Deployment.

openshift-bot commented 3 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 3 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot commented 3 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci-robot commented 3 years ago

@openshift-bot: Closing this issue.

In response to [this](https://github.com/openshift/pipelines-tutorial/issues/70#issuecomment-737309209): >Rotten issues close after 30d of inactivity. > >Reopen the issue by commenting `/reopen`. >Mark the issue as fresh by commenting `/remove-lifecycle rotten`. >Exclude this issue from closing again by commenting `/lifecycle frozen`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
ppitonak commented 2 years ago

https://issues.redhat.com/browse/SRVKP-2387