Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions templates/jlink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ Some suitable test values for the parameters are
* REF: master
* CONTEXT_DIR: quarkus-quickstarts/getting-started-3.9.2-uberjar
* APPNAME: quarkus-quickstart
* TARGET_PORT: 8080
* SERVICE_PORT: 8080

oc process \
-p JDK_VERSION=17 \
-p APP_URI=https://github.com/jboss-container-images/openjdk-test-applications \
-p REF=master \
-p CONTEXT_DIR=quarkus-quickstarts/getting-started-3.9.2-uberjar \
-p APPNAME=quarkus-quickstart \
-p TARGET_PORT=8080 \
-p SERVICE_PORT=8080 \
templates/jlink-app-template \
| oc create -f -

Expand Down
69 changes: 69 additions & 0 deletions templates/jlink/jlinked-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ parameters:
generate: expression
from: "[a-zA-Z0-9]{16}"
required: true
- description: Target port for the created Route
name: TARGET_PORT
value: "8080"
required: true
- description: Port for the created Service to listen on
name: SERVICE_PORT
value: "8181"
required: true
message: "... The GitHub webhook secret is ${GITHUB_WEBHOOK_SECRET} ..."
##############################################################################
# Following are the objects(imagestream and buildconfigs) for all the 3-stages
Expand Down Expand Up @@ -216,3 +224,64 @@ objects:
from:
kind: ImageStreamTag
name: ${APPNAME}-ubimicro:latest # ImageStreamTag for registry.access.redhat.com/ubi9/ubi-micro
##############################################################################
# DeploymentConfig and Route object specs
# DeploymentConfigs are discouraged, however the documentation sugggests to still
# use them if features are missing from Deployments, which in our case they are.
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: ${APPNAME}-jlinked-app-deployment
annotations:
template.alpha.openshift.io/wait-for-ready: "true"
spec:
replicas: 1
selector:
app: ${APPNAME}-jlinked-app
template:
metadata:
labels:
app: ${APPNAME}-jlinked-app
spec:
containers:
- name: ${APPNAME}-jlinked-app-container
image: >-
${APPNAME}-lightweight-image:latest
ports:
- containerPort: 8080
protocol: TCP
strategy:
type: Rolling
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- ${APPNAME}-jlinked-app-container
from:
kind: ImageStreamTag
name: '${APPNAME}-lightweight-image:latest'
namespace: default
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
name: ${APPNAME}-jlinked-app-service
spec:
selector:
app: ${APPNAME}-jlinked-app
ports:
- protocol: TCP
name: target-${TARGET_PORT}-tcp
port: ${{SERVICE_PORT}}
targetPort: ${{TARGET_PORT}}
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ${APPNAME}-jlinked-app-route
spec:
to:
kind: Service
name: ${APPNAME}-jlinked-app-service
port:
targetPort: ${TARGET_PORT}
Loading