Skip to content

Commit 5af22fd

Browse files
committed
Convert to DeploymentConfig, cleanup
1 parent 587d1f3 commit 5af22fd

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

templates/jlink/jlinked-app.yaml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ parameters:
2929
generate: expression
3030
from: "[a-zA-Z0-9]{16}"
3131
required: true
32+
- description: Target port for the created Route
33+
name: TARGET_PORT
34+
required: true
3235
message: "... The GitHub webhook secret is ${GITHUB_WEBHOOK_SECRET} ..."
3336
##############################################################################
3437
# Following are the objects(imagestream and buildconfigs) for all the 3-stages
@@ -217,27 +220,32 @@ objects:
217220
kind: ImageStreamTag
218221
name: ${APPNAME}-ubimicro:latest # ImageStreamTag for registry.access.redhat.com/ubi9/ubi-micro
219222
##############################################################################
220-
# Deployment and Route object specs
221-
- apiVersion: apps/v1
222-
kind: Deployment
223+
# DeploymentConfig and Route object specs
224+
# DeploymentConfigs are discouraged, however the documentation sugggests to still
225+
# use them if features are missing from Deployments, which in our case they are.
226+
- apiVersion: apps.openshift.io/v1
227+
kind: DeploymentConfig
223228
metadata:
224-
name: ${APPNAME}-jlinked-app
229+
name: ${APPNAME}-jlinked-app-deployment
230+
annotations:
231+
template.alpha.openshift.io/wait-for-ready: "true"
225232
spec:
226233
replicas: 1
227234
selector:
228235
matchLabels:
229236
app: ${APPNAME}-jlinked-app
230-
template:
231-
metadata:
232-
labels:
233-
app: ${APPNAME}-jlinked-app
234-
spec:
235-
containers:
236-
- name: ${APPNAME}-jlinked-app-container
237-
image: ${APPNAME}-lightweight-image:latest
238-
imagePullPolicy: IfNotPresent
239-
ports:
240-
- containerPort: 8080
237+
triggers:
238+
- type: ConfigChange
239+
- imageChangeParams:
240+
automatic: true
241+
containerNames:
242+
- ${APPNAME}-jlinked-app-container
243+
from:
244+
kind: ImageStreamTag
245+
name: ${APPNAME}-lightweight-image:latest
246+
type: ImageChange
247+
strategy:
248+
type: Rolling
241249
- apiVersion: v1
242250
kind: Service
243251
metadata:
@@ -257,3 +265,5 @@ objects:
257265
to:
258266
kind: Service
259267
name: ${APPNAME}-jlinked-app-service
268+
port:
269+
targetPort: ${TARGET_PORT}

0 commit comments

Comments
 (0)