{ "kind": "Template", "apiVersion": "template.openshift.io/v1", "metadata": { "annotations": { "iconClass": "icon-eap", "tags": "eap,eap-xp,javaee,java,jboss", "version": "1.0", "openshift.io/display-name": "JBoss EAP XP 4.0 basic template", "openshift.io/provider-display-name": "Red Hat, Inc.", "description": "Example of an application based on JBoss EAP XP. For more information about using this template, see https://github.com/jboss-container-images/jboss-eap-openshift-templates/blob/eap-xp4/README.adoc", "template.openshift.io/long-description": "This template defines resources needed to develop a JBoss Enterprise Application Platform XP based application, including a build configuration, application deployment configuration and secure communication using edge TLS.", "template.openshift.io/documentation-url": "https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/", "template.openshift.io/support-url": "https://access.redhat.com" }, "name": "eap-xp4-basic-s2i" }, "labels": { "template": "eap-xp4-basic-s2i", "xpaas": "1.0" }, "message": "A new JBoss EAP XP based application has been created in your project.", "parameters": [ { "displayName": "Application Name", "description": "The name for the application.", "name": "APPLICATION_NAME", "value": "eap-xp4-basic-app", "required": true }, { "displayName": "EAP XP Image Name", "description": "EAP XP imagestream tag to be used, example: jboss-eap-xp4-openjdk11-openshift:latest", "name": "EAP_IMAGE_NAME", "value": "jboss-eap-xp4-openjdk11-openshift:latest", "required": true }, { "displayName": "EAP XP Runtime Image Name", "description": "EAP XP Runtime imagestream tag to be used, example: jboss-eap-xp4-openjdk11-runtime-openshift:latest", "name": "EAP_RUNTIME_IMAGE_NAME", "value": "jboss-eap-xp4-openjdk11-runtime-openshift:latest", "required": true }, { "displayName": "Git Repository URL", "description": "Git source URI for application", "name": "SOURCE_REPOSITORY_URL", "value": "https://github.com/jboss-developer/jboss-eap-quickstarts.git", "required": true }, { "displayName": "Git Reference", "description": "Git branch/tag reference", "name": "SOURCE_REPOSITORY_REF", "value": "xp-4.0.x", "required": false }, { "displayName": "Context Directory", "description": "Path within Git project to build; empty for root project directory.", "name": "CONTEXT_DIR", "value": "microprofile-config", "required": false }, { "displayName": "Galleon layers", "description": "Comma separated list of Galleon layers to provision a server.", "name": "GALLEON_PROVISION_LAYERS", "required": false }, { "displayName": "Enable ExampleDS datasource", "description": "Enable ExampleDS datasource.", "name": "ENABLE_GENERATE_DEFAULT_DATASOURCE", "value": "false", "required": false }, { "displayName": "Queues", "description": "Queue names, separated by commas. These queues will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all queues used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.", "name": "MQ_QUEUES", "value": "", "required": false }, { "displayName": "Topics", "description": "Topic names, separated by commas. These topics will be automatically created when the broker starts. Also, they will be made accessible as JNDI resources in EAP. Note that all topics used by the application *must* be specified here in order to be created automatically on the remote AMQ broker.", "name": "MQ_TOPICS", "value": "", "required": false }, { "displayName": "AMQ cluster password", "description": "AMQ cluster admin password", "name": "MQ_CLUSTER_PASSWORD", "from": "[a-zA-Z0-9]{8}", "generate": "expression", "required": true }, { "displayName": "Github Webhook Secret", "description": "GitHub trigger secret", "name": "GITHUB_WEBHOOK_SECRET", "from": "[a-zA-Z0-9]{8}", "generate": "expression", "required": true }, { "displayName": "Generic Webhook Secret", "description": "Generic build trigger secret", "name": "GENERIC_WEBHOOK_SECRET", "from": "[a-zA-Z0-9]{8}", "generate": "expression", "required": true }, { "displayName": "ImageStream Namespace", "description": "Namespace in which the ImageStreams for Red Hat Middleware images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you've installed the ImageStreams in a different namespace/project.", "name": "IMAGE_STREAM_NAMESPACE", "value": "openshift", "required": true }, { "displayName": "JGroups Cluster Password", "description": "JGroups cluster password", "name": "JGROUPS_CLUSTER_PASSWORD", "from": "[a-zA-Z0-9]{8}", "generate": "expression", "required": true }, { "displayName": "Deploy Exploded Archives", "description": "Controls whether exploded deployment content should be automatically deployed", "name": "AUTO_DEPLOY_EXPLODED", "value": "false", "required": false }, { "displayName": "Maven mirror URL", "description": "Maven mirror to use for S2I builds", "name": "MAVEN_MIRROR_URL", "value": "", "required": false }, { "displayName": "Maven Additional Arguments", "description": "Maven additional arguments to use for S2I builds", "name": "MAVEN_ARGS_APPEND", "value": "-Dcom.redhat.xpaas.repo.jbossorg", "required": false }, { "description": "List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.", "name": "ARTIFACT_DIR", "value": "", "required": false }, { "description": "Container memory limit", "name": "MEMORY_LIMIT", "value": "1Gi", "required": false } ], "objects": [ { "kind": "Service", "apiVersion": "v1", "spec": { "ports": [ { "port": 8080, "targetPort": 8080 } ], "selector": { "deploymentConfig": "${APPLICATION_NAME}" } }, "metadata": { "name": "${APPLICATION_NAME}", "labels": { "application": "${APPLICATION_NAME}" }, "annotations": { "description": "The web server's http port." } } }, { "kind": "Service", "apiVersion": "v1", "spec": { "publishNotReadyAddresses": true, "clusterIP": "None", "ports": [ { "name": "ping", "port": 8888 } ], "selector": { "deploymentConfig": "${APPLICATION_NAME}" } }, "metadata": { "name": "${APPLICATION_NAME}-ping", "labels": { "application": "${APPLICATION_NAME}" }, "annotations": { "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true", "description": "The JGroups ping port for clustering." } } }, { "kind": "Route", "apiVersion": "route.openshift.io/v1", "id": "${APPLICATION_NAME}-https", "metadata": { "name": "${APPLICATION_NAME}", "labels": { "application": "${APPLICATION_NAME}" }, "annotations": { "description": "Route for application's https service." } }, "spec": { "to": { "name": "${APPLICATION_NAME}" }, "tls": { "insecureEdgeTerminationPolicy": "Redirect", "termination": "edge" } } }, { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "${APPLICATION_NAME}", "labels": { "application": "${APPLICATION_NAME}" } } }, { "kind": "ImageStream", "apiVersion": "image.openshift.io/v1", "metadata": { "name": "${APPLICATION_NAME}-build-artifacts", "labels": { "application": "${APPLICATION_NAME}" } } }, { "kind": "BuildConfig", "apiVersion": "build.openshift.io/v1", "metadata": { "name": "${APPLICATION_NAME}-build-artifacts", "labels": { "application": "${APPLICATION_NAME}" } }, "spec": { "source": { "type": "Git", "git": { "uri": "${SOURCE_REPOSITORY_URL}", "ref": "${SOURCE_REPOSITORY_REF}" }, "contextDir": "${CONTEXT_DIR}" }, "strategy": { "type": "Source", "sourceStrategy": { "env": [ { "name": "MAVEN_MIRROR_URL", "value": "${MAVEN_MIRROR_URL}" }, { "name": "MAVEN_ARGS_APPEND", "value": "${MAVEN_ARGS_APPEND}" }, { "name": "GALLEON_PROVISION_LAYERS", "value": "${GALLEON_PROVISION_LAYERS}" }, { "name": "GALLEON_PROVISION_DEFAULT_FAT_SERVER", "value": "true" }, { "name": "ARTIFACT_DIR", "value": "${ARTIFACT_DIR}" } ], "forcePull": true, "incremental": true, "from": { "kind": "ImageStreamTag", "namespace": "${IMAGE_STREAM_NAMESPACE}", "name": "${EAP_IMAGE_NAME}" } } }, "output": { "to": { "kind": "ImageStreamTag", "name": "${APPLICATION_NAME}-build-artifacts:latest" } }, "triggers": [ { "type": "GitHub", "github": { "secret": "${GITHUB_WEBHOOK_SECRET}" } }, { "type": "Generic", "generic": { "secret": "${GENERIC_WEBHOOK_SECRET}" } }, { "type": "ImageChange", "imageChange": {} }, { "type": "ConfigChange" } ] } }, { "apiVersion": "build.openshift.io/v1", "kind": "BuildConfig", "metadata": { "labels": { "application": "${APPLICATION_NAME}" }, "name": "${APPLICATION_NAME}" }, "spec": { "output": { "to": { "kind": "ImageStreamTag", "name": "${APPLICATION_NAME}:latest" } }, "source": { "dockerfile": "FROM ${EAP_RUNTIME_IMAGE_NAME}\nCOPY /server $JBOSS_HOME\nUSER root\nRUN chown -R jboss:root $JBOSS_HOME && chmod -R ug+rwX $JBOSS_HOME\nUSER jboss\nCMD $JBOSS_HOME/bin/openshift-launch.sh", "images": [ { "from": { "kind": "ImageStreamTag", "name": "${APPLICATION_NAME}-build-artifacts:latest" }, "paths": [ { "sourcePath": "/s2i-output/server/", "destinationDir": "." } ] } ] }, "strategy": { "dockerStrategy": { "imageOptimizationPolicy": "SkipLayers", "from": { "kind": "ImageStreamTag", "name": "${EAP_RUNTIME_IMAGE_NAME}", "namespace": "${IMAGE_STREAM_NAMESPACE}" } }, "type": "Docker" }, "triggers": [ { "type": "ImageChange", "imageChange": { "from": { "kind": "ImageStreamTag", "name": "${APPLICATION_NAME}-build-artifacts:latest" } } }, { "type": "ConfigChange" } ] } }, { "kind": "DeploymentConfig", "apiVersion": "apps.openshift.io/v1", "metadata": { "name": "${APPLICATION_NAME}", "labels": { "application": "${APPLICATION_NAME}" } }, "spec": { "strategy": { "type": "Recreate" }, "triggers": [ { "type": "ImageChange", "imageChangeParams": { "automatic": true, "containerNames": [ "${APPLICATION_NAME}" ], "from": { "kind": "ImageStreamTag", "name": "${APPLICATION_NAME}:latest" } } }, { "type": "ConfigChange" } ], "replicas": 1, "selector": { "deploymentConfig": "${APPLICATION_NAME}" }, "template": { "metadata": { "name": "${APPLICATION_NAME}", "labels": { "deploymentConfig": "${APPLICATION_NAME}", "application": "${APPLICATION_NAME}", "com.company": "Red_Hat", "rht.prod_name": "Red_Hat_Runtimes", "rht.prod_ver": "2022-Q1", "rht.comp": "EAP_XP", "rht.comp_ver": "4.0", "rht.subcomp_t": "application" } }, "spec": { "terminationGracePeriodSeconds": 75, "containers": [ { "name": "${APPLICATION_NAME}", "image": "${APPLICATION_NAME}", "imagePullPolicy": "Always", "resources": { "limits": { "memory": "${MEMORY_LIMIT}" } }, "livenessProbe": { "exec": { "command": [ "/bin/bash", "-c", "/opt/eap/bin/livenessProbe.sh" ] }, "initialDelaySeconds": 60 }, "readinessProbe": { "exec": { "command": [ "/bin/bash", "-c", "/opt/eap/bin/readinessProbe.sh" ] }, "initialDelaySeconds": 10 }, "ports": [ { "name": "jolokia", "containerPort": 8778, "protocol": "TCP" }, { "name": "http", "containerPort": 8080, "protocol": "TCP" }, { "name": "ping", "containerPort": 8888, "protocol": "TCP" } ], "env": [ { "name": "JGROUPS_PING_PROTOCOL", "value": "dns.DNS_PING" }, { "name": "OPENSHIFT_DNS_PING_SERVICE_NAME", "value": "${APPLICATION_NAME}-ping" }, { "name": "OPENSHIFT_DNS_PING_SERVICE_PORT", "value": "8888" }, { "name": "MQ_CLUSTER_PASSWORD", "value": "${MQ_CLUSTER_PASSWORD}" }, { "name": "MQ_QUEUES", "value": "${MQ_QUEUES}" }, { "name": "MQ_TOPICS", "value": "${MQ_TOPICS}" }, { "name": "JGROUPS_CLUSTER_PASSWORD", "value": "${JGROUPS_CLUSTER_PASSWORD}" }, { "name": "AUTO_DEPLOY_EXPLODED", "value": "${AUTO_DEPLOY_EXPLODED}" }, { "name": "ENABLE_GENERATE_DEFAULT_DATASOURCE", "value": "${ENABLE_GENERATE_DEFAULT_DATASOURCE}" } ] } ] } } } } ] }