Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPENJDK-2992] Create DeploymentConfig and Route for jlink apps #514

Open
wants to merge 11 commits into
base: jlink-dev
Choose a base branch
from
63 changes: 63 additions & 0 deletions templates/jlink/jlinked-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ parameters:
generate: expression
from: "[a-zA-Z0-9]{16}"
required: true
- description: Target port for the created Route
name: TARGET_PORT
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 +219,63 @@ 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
port: 80
targetPort: 8080
- 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