Skip to content

Commit e9bbeb2

Browse files
authored
Merge pull request #47660 from rolfedh/RHDEVDOCS-3972
RHDEVDOCS-3972 Add content from "JNKS-289: Relocation of OpenShift Jenkins Images and what it means for you" into our docs
2 parents 4882241 + ad5ee82 commit e9bbeb2

File tree

4 files changed

+115
-0
lines changed

4 files changed

+115
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,8 @@ Topics:
16681668
Topics:
16691669
- Name: Migrating from Jenkins to OpenShift Pipelines
16701670
File: migrating-from-jenkins-to-openshift-pipelines
1671+
- Name: OpenShift Jenkins
1672+
File: openshift-jenkins
16711673
---
16721674
Name: Images
16731675
Dir: openshift_images

cicd/jenkins/openshift-jenkins.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
:_content-type: ASSEMBLY
2+
[id="openshift-jenkins_{context}"]
3+
= {product-title} Jenkins
4+
include::_attributes/common-attributes.adoc[]
5+
:context: openshift-jenkins
6+
7+
toc::[]
8+
9+
{product-title} 4.11 moves the `OpenShift Jenkins` and `OpenShift Agent Base` images to the `ocp-tools-4` repository at `registry.redhat.io` so that Red Hat can produce and update the images outside the {product-title} lifecycle. Previously, these images were in the {product-title} install payload and the `openshift4` repository at `registry.redhat.io`.
10+
11+
{product-title} 4.10 deprecated the `OpenShift Jenkins Maven` and `NodeJS Agent` images. {product-title} 4.11 removes these images from its payload. Red Hat no longer produces these images, and they are not available from the `ocp-tools-4` repository at `registry.redhat.io`. Red Hat maintains the 4.10 and earlier versions of these images for any bug fixes or security CVEs of note, in accordance the link::https://access.redhat.com/support/policy/updates/openshift[{product-title} lifecycle policy].
12+
13+
These changes support the {product-title} 4.10 recommendation to use xref:../../openshift_images/using_images/images-other-jenkins.adoc#images-other-jenkins-config-kubernetes_images-other-jenkins[multiple container Pod Templates with the Jenkins Kubernetes Plug-in].
14+
15+
include::modules/relocation-of-openshift-jenkins-images.adoc[leveloffset=+1]
16+
17+
include::modules/customizing-the-jenkins-image-stream-tag.adoc[leveloffset=+1]
18+
19+
[role="_additional-resources"]
20+
.Additional resources
21+
22+
* xref:../../openshift_images/managing_images/tagging-images.adoc#images-add-tags-to-imagestreams_tagging-images[Adding tags to image streams]
23+
* xref:../../openshift_images/image-streams-manage.html#images-imagestream-import_image-streams-managing[Configuring periodic importing of image stream tags]
24+
* xref:../../openshift_images/using_images/images-other-jenkins-agent.adoc[Jenkins agent]
25+
* link:https://catalog.redhat.com/software/containers/search?q=Jenkins%202&p=1[Certified `jenkins` images]
26+
* link:https://catalog.redhat.com/software/containers/search?q=Jenkins%20Agent%20Base&p=1[Certified `jenkins-agent-base` images]
27+
* link:https://catalog.redhat.com/software/containers/search?q=jenkins-agent-maven&p=1[Certified `jenkins-agent-maven` images]
28+
* link:https://catalog.redhat.com/software/containers/search?q=jenkins-agent-nodejs&p=1[Certified `jenkins-agent-nodejs` images]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
:_content-type: PROCEDURE
2+
3+
[id="customizing-the-jenkins-image-stream-tag_{context}"]
4+
= Customizing the Jenkins image stream tag
5+
6+
To override the default upgrade behavior and control how the Jenkins image is upgraded, you set the image stream tag value that your Jenkins deployment configurations use.
7+
8+
The default upgrade behavior is the behavior that existed when the Jenkins image was part of the install payload. The image stream tag names, `2` and `ocp-upgrade-redeploy`, in the `jenkins-rhel.json` image stream file use SHA-specific image references. Therefore, when those tags are updated with a new SHA, the {product-title} image change controller automatically redeploys the Jenkins deployment configuration from the associated templates, such as `jenkins-ephemeral.json` or `jenkins-persistent.json`.
9+
10+
For new deployments, to override that default value, you change the value of the `JENKINS_IMAGE_STREAM_TAG` in the `jenkins-ephemeral.json` Jenkins template. For example, replace the `2` in `"value": "jenkins:2"` with one of the following image stream tags:
11+
12+
* `ocp-upgrade-redeploy` the default value, updates your Jenkins image when you upgrade {product-title}.
13+
* `user-maintained-upgrade-redeploy` requires you to manually redeploy Jenkins by running `$ oc import-image jenkins:user-maintained-upgrade-redeploy -n openshift` after upgrading {product-title}.
14+
* `scheduled-upgrade-redeploy` periodically checks the given `<image>:<tag>` combination for changes and upgrades the image when it changes. The image change controller pulls the changed image and redeploys the Jenkins deployment configuration provisioned by the templates. For more information about this scheduled import policy, see the "Adding tags to image streams" in the following "Additional resources."
15+
16+
[NOTE]
17+
====
18+
For existing deployments, to override the current upgrade value, change the values of the environment variables that correspond to those template parameters.
19+
====
20+
21+
.Prerequisites
22+
23+
* You are running OpenShift Jenkins on {product-title} 4.11.
24+
* You know the namespace where OpenShift Jenkins is deployed.
25+
26+
.Procedure
27+
28+
* Set the image stream tag value, replacing `<namespace>` with namespace where OpenShift Jenkins is deployed and `<image_stream_tag>` with an image stream tag:
29+
+
30+
.Example
31+
[source,terminal]
32+
----
33+
$ oc patch dc jenkins -p '{"spec":{"triggers":[{"type":"ImageChange","imageChangeParams":{"automatic":true,"containerNames":["jenkins"],"from":{"kind":"ImageStreamTag","namespace":"<namespace>","name":"jenkins:<image_stream_tag>"}}}]}}'
34+
----
35+
+
36+
[TIP]
37+
====
38+
Alternatively, to edit the Jenkins deployment configuration YAML, enter `$ oc edit dc/jenkins -n <namespace>` and update the `value: 'jenkins:<image_stream_tag>'` line.
39+
====
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
:_content-type: CONCEPT
2+
3+
[id="relocation-of-openshift-jenkins-images_{context}"]
4+
= Relocation of OpenShift Jenkins images
5+
6+
.What stays the same with the OpenShift Jenkins images?
7+
8+
* The Cluster Samples Operator manages the `ImageStream` and `Template` objects for operating the OpenShift Jenkins images.
9+
* By default, the Jenkins `DeploymentConfig` object from the Jenkins pod template triggers a redeployment when the Jenkins image changes. By default, this image is referenced by the `jenkins:2` image stream tag of Jenkins image stream in the `openshift` namespace in the `ImageStream` YAML file in the Samples Operator payload.
10+
* If you upgrade from {product-title} 4.10 and earlier to 4.11, the deprecated `maven` and `nodejs` pod templates are still in the default image configuration.
11+
* If you upgrade from {product-title} 4.10 and earlier to 4.11, the `jenkins-agent-maven` and `jenkins-agent-nodejs` image streams still exist in your cluster. To maintain these image streams, see the following section, "What happens with the `jenkins-agent-maven` and `jenkins-agent-nodejs` image streams in the `openshift` namespace?"
12+
13+
.What changes in the support matrix of the OpenShift Jenkins image?
14+
15+
Each new image in the `ocp-tools-4` repository in the `registry.redhat.io` registry supports multiple versions of {product-title}. When Red Hat updates one of these new images, it is simultaneously available for all versions. This availability is ideal when Red Hat updates an image in response to a security advisory. Initially, this change applies to {product-title} 4.11 and later. It is planned that this change will eventually apply to {product-title} 4.9 and later.
16+
17+
Previously, each Jenkins image supported only one version of {product-title} and Red Hat might update those images sequentially over time.
18+
19+
.What additions are there with the OpenShift Jenkins and Jenkins Agent Base ImageStream and ImageStreamTag objects?
20+
21+
By moving from an "in-payload" image stream to an image stream that references non-payload images, {product-title} can define as additional image stream tags. Red Hat has created a series of new image stream tags to go along with the existing `"value": "jenkins:2"` and `"value": "image-registry.openshift-image-registry.svc:5000/openshift/jenkins-agent-base:latest"` image stream tags present in {product-title} 4.10 and earlier. These new image stream tags address some requests to improve how the Jenkins-related image streams are maintained.
22+
23+
About the new image stream tags:
24+
25+
`ocp-upgrade-redeploy`:: To update your Jenkins image when you upgrade {product-title}, use this image stream tag in your Jenkins deployment configuration. This image stream tag corresponds to the existing `2` image stream tag of the `jenkins` image stream and the `latest` image stream tag of the `jenkins-agent-base` image stream. It employs an image tag specific to only one SHA or image digest. When the `ocp-tools-4` image changes, such as for Jenkins security advisories, Red Hat Engineering updates the Cluster Samples Operator payload.
26+
27+
`user-maintained-upgrade-redeploy`:: To manually redeploy Jenkins after you upgrade {product-title}, use this image stream tag in your Jenkins deployment configuration. This image stream tag uses the least specific image version indicator available. When you redeploy Jenkins, run the following command: `$ oc import-image jenkins:user-maintained-upgrade-redeploy -n openshift`. When you issue this command, the {product-title} `ImageStream` controller accesses the `registry.redhat.io` image registry and stores any updated images in the {product-title} internal image registry's slot for that Jenkins `ImageStreamTag` object. Otherwise, if you do not run this command, your Jenkins deployment configuration does not trigger a redeployment.
28+
29+
`scheduled-upgrade-redeploy`:: To automatically redeploy the latest version of the Jenkins image when it is released, use this image stream tag in your Jenkins deployment configuration. This image stream tag uses the periodic importing of image stream tags feature of the {product-title} image stream controller, which checks for changes in the backing image. If the image changes, for example, due to a recent Jenkins security advisory, {product-title} triggers a redeployment of your Jenkins deployment configuration. See "Configuring periodic importing of image stream tags" in the following "Additional resources."
30+
31+
32+
.What happens with the `jenkins-agent-maven` and `jenkins-agent-nodejs` image streams in the `openshift` namespace?
33+
34+
The `OpenShift Jenkins Maven` and `NodeJS Agent` images for {product-title} were deprecated in 4.10, and are removed from the {product-title} install payload in 4.11. They do not have alternatives defined in the `ocp-tools-4` repository. However, you can work around this by using the sidecar pattern described in the "Jenkins agent" topic mentioned in the following "Additional resources" section.
35+
36+
However, the Cluster Samples Operator does not delete the `jenkins-agent-maven` and `jenkins-agent-nodejs` image streams created by prior releases, which point to the tags of the respective {product-title} payload images on `registry.redhat.io`. Therefore, you can pull updates to these images by running the following commands:
37+
38+
[source,terminal]
39+
----
40+
$ oc import-image jenkins-agent-nodejs -n openshift
41+
----
42+
43+
[source,terminal]
44+
----
45+
$ oc import-image jenkins-agent-maven -n openshift
46+
----

0 commit comments

Comments
 (0)