Skip to content

Commit 2ea2426

Browse files
committed
Switch Jenkins image tracking to registry tag due to Samples Operator deprecation
Starting with OpenShift 4.13, the Cluster Samples Operator has been downsized and no longer provides updates for non-S2I images like Jenkins. The `latest` tracked tag was pointing to an image that hadn't been updated in over two years. This commit updates the image reference to follow the specific registry tag directly (registry.redhat.io/ocp-tools-4/jenkins-rhel9:v4.17.0), ensuring we get the latest maintained version going forward. To archive this we need to create our own ImageStreams for both the Jenkins base image and the Jenkins agent image, replacing the deprecated Samples Operator content. Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
1 parent 4f828f2 commit 2ea2426

File tree

3 files changed

+38
-34
lines changed

3 files changed

+38
-34
lines changed

manifests/jenkins-s2i.yaml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@ parameters:
1212
- description: Git branch/tag reference for Jenkins S2I
1313
name: JENKINS_S2I_REF
1414
value: main
15-
- description: Source imagestream
16-
name: JENKINS_S2I_SRC_IMAGESTREAM_NAME
17-
value: jenkins:scheduled-upgrade-redeploy
18-
- description: Namespace of source imagestream
19-
name: JENKINS_S2I_SRC_IMAGESTREAM_NAMESPACE
20-
value: openshift
15+
- description: Pull spec for Jenkins image
16+
name: JENKINS_S2I_PULL_SPEC
17+
value: registry.redhat.io/ocp-tools-4/jenkins-rhel9:v4.17.0
18+
- description: Pull spec for Jenkins image base
19+
name: JENKINS_AGENT_PULL_SPEC
20+
value: registry.redhat.io/ocp-tools-4/jenkins-agent-base-rhel9:v4.17.0
2121

2222
# Here's what the flow looks like when no cert is required:
2323
#
24-
# ┌──────────────────────────────────────────────┐ ┌─────────────┐ ┌─────────────┐
25-
#imagestream │ │ buildconfig │ │ imagestream │
26-
#openshift/jenkins:scheduled-upgrade-redeploy ├──►│ jenkins-s2i ├──►│ jenkins:2 │
27-
# └──────────────────────────────────────────────┘ └─────────────┘ └─────────────┘
24+
# ┌──────────────────────────────────────────────────────┐ ┌─────────────┐ ┌─────────────┐
25+
#Pull spec │ │ buildconfig │ │ imagestream │
26+
#registry.redhat.io/ocp-tools-4/jenkins-rhel9:v4.17.0 ├──►│ jenkins-s2i ├──►│ jenkins:2 │
27+
# └──────────────────────────────────────────────────────┘ └─────────────┘ └─────────────┘
2828
#
29-
# ┌────────────────────────────────────────────────┐
30-
#imagestream
31-
#openshift/jenkins-agent-base:scheduled-upgrade
32-
# └────────────────────────────────────────────────┘
29+
# ┌─────────────────────────────────────────────────────────────────┐ ┌───────────────────────────
30+
#Pull spec │ │ imagestream
31+
#registry.redhat.io/ocp-tools-4/jenkins-agent-base-rhel9:v4.17.0 │──►│ jenkins-agent-base:latest
32+
# └─────────────────────────────────────────────────────────────────┘ └───────────────────────────
3333
#
3434
# And with cert required (see `jenkins-with-cert.yaml`):
3535
#
36-
# ┌──────────────────────────────────────────────┐ ┌───────────────────┐ ┌────────────────┐ ┌─────────────┐ ┌─────────────┐
37-
#imagestream │ │ buildconfig │ │ imagestream │ │ buildconfig │ │ imagestream │
38-
#openshift/jenkins:scheduled-upgrade-redeploy ├──►│ jenkins-with-cert ├──►│ jenkins:latest ├──►│ jenkins-s2i ├──►│ jenkins:2 │
39-
# └──────────────────────────────────────────────┘ └───────────────────┘ └────────────────┘ └─────────────┘ └─────────────┘
36+
# ┌───────────────────────────────────────────────────────┐ ┌───────────────────┐ ┌────────────────┐ ┌─────────────┐ ┌─────────────┐
37+
#Pull spec │ │ buildconfig │ │ imagestream │ │ buildconfig │ │ imagestream │
38+
#registry.redhat.io/ocp-tools-4/jenkins--rhel9:v4.17.0 ├──►│ jenkins-with-cert ├──►│ jenkins:latest ├──►│ jenkins-s2i ├──►│ jenkins:2 │
39+
# └───────────────────────────────────────────────────────┘ └───────────────────┘ └────────────────┘ └─────────────┘ └─────────────┘
4040
#
41-
# ┌────────────────────────────────────────────────┐ ┌──────────────────────────────┐ ┌───────────────────────────┐
42-
#imagestream │ │ buildconfig │ │ imagestream │
43-
#openshift/jenkins-agent-base:scheduled-upgrade ├──►│ jenkins-agent-base-with-cert ├──►│ jenkins-agent-base:latest │
44-
# └────────────────────────────────────────────────┘ └──────────────────────────────┘ └───────────────────────────┘
41+
# ┌─────────────────────────────────────────────────────────────────┐ ┌──────────────────────────────┐ ┌───────────────────────────┐
42+
#Pull spec │ │ buildconfig │ │ imagestream │
43+
#registry.redhat.io/ocp-tools-4/jenkins-agent-base-rhel9:v4.17.0 ├──►│ jenkins-agent-base-with-cert ├──►│ jenkins-agent-base:latest │
44+
# └─────────────────────────────────────────────────────────────────┘ └──────────────────────────────┘ └───────────────────────────┘
4545

4646
objects:
4747

@@ -69,9 +69,8 @@ objects:
6969
type: Source
7070
sourceStrategy:
7171
from:
72-
kind: ImageStreamTag
73-
name: ${JENKINS_S2I_SRC_IMAGESTREAM_NAME}
74-
namespace: ${JENKINS_S2I_SRC_IMAGESTREAM_NAMESPACE}
72+
kind: DockerImage
73+
name: ${JENKINS_S2I_PULL_SPEC}
7574
env:
7675
- name: JENKINS_UC_DOWNLOAD
7776
value: 'https://archives.jenkins.io'
@@ -89,3 +88,13 @@ objects:
8988
kind: ImageStream
9089
metadata:
9190
name: jenkins-agent-base
91+
spec:
92+
lookupPolicy:
93+
# this allows e.g. the pipeline to directly reference the imagestream
94+
local: true
95+
tags:
96+
- name: latest
97+
from:
98+
kind: DockerImage
99+
name: ${JENKINS_AGENT_PULL_SPEC}
100+
forcePull: true

manifests/jenkins-with-cert.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ objects:
3131
strategy:
3232
dockerStrategy:
3333
from:
34-
kind: ImageStreamTag
35-
name: jenkins:scheduled-upgrade-redeploy
36-
namespace: openshift
34+
kind: DockerImage
35+
name: registry.redhat.io/ocp-tools-4/jenkins-rhel9:v4.17.0
3736
forcePull: true
3837
output:
3938
to:
@@ -62,9 +61,8 @@ objects:
6261
strategy:
6362
dockerStrategy:
6463
from:
65-
kind: ImageStreamTag
66-
name: jenkins-agent-base:scheduled-upgrade
67-
namespace: openshift
64+
kind: DockerImage
65+
name: registry.redhat.io/ocp-tools-4/jenkins-agent-base-rhel9:v4.17.0
6866
forcePull: true
6967
output:
7068
to:

manifests/jenkins.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ objects:
8989
# - Increase heartbeat interval so durable-task-plugin waits a
9090
# bit longer for scripts to start before failing the build.
9191
# https://github.com/coreos/coreos-ci/issues/28
92-
# - Set the default JNLP image to our Jenkins agent imagestream.
93-
# https://docs.cloudbees.com/docs/cloudbees-ci-kb/latest/cloudbees-ci-on-modern-cloud-platforms/change-the-default-jnlp-image-for-kubernetes-agents-provisioning#_system_property_approach
9492
# - We hard set a memory limit so that we don't get the default for the
9593
# limitrange in this project we happen to be in, which is likely to be
9694
# too generous. The default upstream memory *request* is 256Mi, which
@@ -100,7 +98,6 @@ objects:
10098
-Dfile.encoding=UTF-8
10199
-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=900
102100
-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true
103-
-Dorg.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.defaultImage=image-registry.openshift-image-registry.svc:5000/${AGENT_NAMESPACE}/jenkins-agent-base:latest
104101
-Dorg.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.defaultContainer.defaultCpuRequest=1
105102
-Dorg.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.defaultContainer.defaultMemoryRequest=512Mi
106103
-Dorg.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.defaultContainer.defaultCpuLimit=1

0 commit comments

Comments
 (0)