{ "kind": "Template", "apiVersion": "template.openshift.io/v1", "metadata": { "annotations": { "openshift.io/display-name": "Red Hat Fuse 7.5 Camel JPA + MySQL (Ephemeral) with EAP", "openshift.io/provider-display-name": "Red Hat, Inc.", "description": "Red Hat Fuse on EAP Camel JPA quickstart. This example demonstrates how to connect a Camel application with Red Hat Fuse on EAP to a MySQL database and expose a REST API. This example creates two containers, one container to run as a MySQL server, and another running the Camel application which acts as as a client to the database.", "tags": "quickstart,javaee,java,jboss-fuse,fis", "iconClass": "icon-rh-integration", "version": "1.5" }, "name": "s2i-fuse75-eap-camel-jpa" }, "labels": { "template": "s2i-fuse75-eap-camel-jpa" }, "parameters": [ { "displayName": "Application Name", "description": "The name for the application.", "name": "APP_NAME", "value": "s2i-fuse75-eap-camel-jpa", "required": true }, { "displayName": "Application Version", "description": "The application version.", "name": "APP_VERSION", "value": "5.3.0.fuse-750028-redhat-00002", "required": true }, { "displayName": "Custom http Route Hostname.", "description": "Custom hostname for http service route. Leave blank for default hostname, e.g.: -.", "name": "HOSTNAME_HTTP", "value": "", "required": false }, { "displayName": "Git Repository URL", "description": "Git source URI for application.", "name": "GIT_REPO", "value": "https://github.com/jboss-fuse/wildfly-camel-examples.git", "required": true }, { "displayName": "Git Reference", "description": "Git branch/tag reference", "name": "GIT_REF", "value": "wildfly-camel-examples-5.3.0.fuse-750028-redhat-00002", "required": false }, { "displayName": "Context Directory", "description": "Path within Git project to build; empty for root project directory.", "name": "CONTEXT_DIR", "value": "", "required": false }, { "displayName": "Builder version", "description": "The version of the FIS S2I builder image to use.", "name": "BUILDER_VERSION", "value": "1.5" }, { "displayName": "Database JNDI Name", "description": "Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/OrdersDS", "name": "DB_JNDI", "value": "java:jboss/datasources/OrdersDS", "required": false }, { "displayName": "Database Name", "description": "Database name", "name": "DB_DATABASE", "value": "orders_db", "required": true }, { "displayName": "Database Username", "description": "Database user name", "name": "DB_USERNAME", "from": "user[a-zA-Z0-9]{3}", "generate": "expression", "required": true }, { "displayName": "Database Password", "description": "Database user password", "name": "DB_PASSWORD", "from": "[a-zA-Z0-9]{8}", "generate": "expression", "required": true }, { "displayName": "Datasource Minimum Pool Size", "description": "Sets xa-pool/min-pool-size for the configured datasource.", "name": "DB_MIN_POOL_SIZE", "required": false }, { "displayName": "Datasource Maximum Pool Size", "description": "Sets xa-pool/max-pool-size for the configured datasource.", "name": "DB_MAX_POOL_SIZE", "required": false }, { "displayName": "Datasource Transaction Isolation", "description": "Sets transaction-isolation for the configured datasource.", "name": "DB_TX_ISOLATION", "required": false }, { "displayName": "MySQL Lower Case Table Names", "description": "Sets how the table names are stored and compared.", "name": "MYSQL_LOWER_CASE_TABLE_NAMES", "required": false }, { "displayName": "MySQL Maximum number of connections", "description": "The maximum permitted number of simultaneous client connections.", "name": "MYSQL_MAX_CONNECTIONS", "required": false }, { "displayName": "MySQL FullText Minimum Word Length", "description": "The minimum length of the word to be included in a FULLTEXT index.", "name": "MYSQL_FT_MIN_WORD_LEN", "required": false }, { "displayName": "MySQL FullText Maximum Word Length", "description": "The maximum length of the word to be included in a FULLTEXT index.", "name": "MYSQL_FT_MAX_WORD_LEN", "required": false }, { "displayName": "MySQL AIO", "description": "Controls the innodb_use_native_aio setting value if the native AIO is broken.", "name": "MYSQL_AIO", "required": false }, { "displayName": "MySQL Image Stream Tag", "description": "The tag to use for the \"mysql\" image stream. Typically, this aligns with the major.minor version of MySQL.", "name": "MYSQL_IMAGE_STREAM_TAG", "value": "5.7", "required": true }, { "displayName": "Queues", "description": "Queue names.", "name": "MQ_QUEUES", "value": "", "required": false }, { "displayName": "Topics", "description": "Topic names.", "name": "MQ_TOPICS", "value": "", "required": false }, { "displayName": "A-MQ cluster password", "description": "A-MQ 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 Fuse ImageStreams 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 Arguments To Append", "description": "Additional arguments passed to mvn, e.g. for multi-module builds.", "name": "MAVEN_ARGS_APPEND", "value": "-pl camel-jpa -am", "required": false }, { "displayName": "Maven mirror URL", "description": "Maven mirror to use for S2I builds.", "name": "MAVEN_MIRROR_URL", "value": "", "required": false }, { "displayName": "Artifact Directories", "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": "camel-jpa/target", "required": false }, { "displayName": "CPU request", "description": "The amount of CPU to request.", "name": "CPU_REQUEST", "value": "0.2", "required": true }, { "displayName": "CPU limit", "description": "The amount of CPU the container is limited to use.", "name": "CPU_LIMIT", "value": "1.0", "required": true }, { "name": "MEMORY_REQUEST", "displayName": "Memory request", "value": "256Mi", "required": true, "description": "The amount of memory required for the container to run." }, { "name": "MEMORY_LIMIT", "displayName": "Memory limit", "value": "1Gi", "required": true, "description": "The amount of memory the container is limited to use." }, { "name": "BUILD_MEMORY_REQUEST", "displayName": "Build Memory request", "value": "0.7G", "required": true, "description": "The amount of memory to request for builds." }, { "name": "BUILD_MEMORY_LIMIT", "displayName": "Build Memory limit", "value": "0.8G", "required": true, "description": "The amount of memory the build container is limited to use." } ], "objects": [ { "kind": "Service", "apiVersion": "v1", "spec": { "ports": [ { "port": 8080, "targetPort": 8080 } ], "selector": { "deploymentConfig": "${APP_NAME}" } }, "metadata": { "name": "${APP_NAME}", "labels": { "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" }, "annotations": { "description": "The web server's http port." } } }, { "kind": "Service", "apiVersion": "v1", "spec": { "clusterIP": "None", "ports": [ { "name": "ping", "port": 8888 } ], "selector": { "deploymentConfig": "${APP_NAME}" } }, "metadata": { "name": "${APP_NAME}-ping", "labels": { "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" }, "annotations": { "service.alpha.kubernetes.io/tolerate-unready-endpoints": "true", "description": "The JGroups ping port for clustering." } } }, { "kind": "Service", "apiVersion": "v1", "spec": { "ports": [ { "port": 3306, "targetPort": 3306 } ], "selector": { "deploymentConfig": "${APP_NAME}-mysql" } }, "metadata": { "name": "${APP_NAME}-mysql", "labels": { "app": "${APP_NAME}", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" }, "annotations": { "description": "The database server's port." } } }, { "kind": "Route", "apiVersion": "v1", "id": "${APP_NAME}-http", "metadata": { "name": "${APP_NAME}", "labels": { "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" }, "annotations": { "description": "Route for application's http service." } }, "spec": { "host": "${HOSTNAME_HTTP}", "to": { "name": "${APP_NAME}" } } }, { "kind": "ImageStream", "apiVersion": "v1", "metadata": { "name": "${APP_NAME}", "labels": { "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" } } }, { "kind": "BuildConfig", "apiVersion": "v1", "metadata": { "name": "${APP_NAME}", "labels": { "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" } }, "spec": { "source": { "type": "Git", "git": { "uri": "${GIT_REPO}", "ref": "${GIT_REF}" }, "contextDir": "${CONTEXT_DIR}" }, "strategy": { "type": "Source", "sourceStrategy": { "env": [ { "name": "MAVEN_ARGS_APPEND", "value": "${MAVEN_ARGS_APPEND}" }, { "name": "MAVEN_MIRROR_URL", "value": "${MAVEN_MIRROR_URL}" }, { "name": "ARTIFACT_DIR", "value": "${ARTIFACT_DIR}" }, { "name": "DB_JNDI", "value": "${DB_JNDI}" } ], "forcePull": true, "incremental": true, "from": { "kind": "ImageStreamTag", "namespace": "${IMAGE_STREAM_NAMESPACE}", "name": "fuse7-eap-openshift:${BUILDER_VERSION}" } } }, "output": { "to": { "kind": "ImageStreamTag", "name": "${APP_NAME}:latest" } }, "resources": { "requests": { "memory": "${BUILD_MEMORY_REQUEST}" }, "limits": { "memory": "${BUILD_MEMORY_LIMIT}" } }, "triggers": [ { "type": "GitHub", "github": { "secret": "${GITHUB_WEBHOOK_SECRET}" } }, { "type": "Generic", "generic": { "secret": "${GENERIC_WEBHOOK_SECRET}" } }, { "type": "ImageChange", "imageChange": {} }, { "type": "ConfigChange" } ] } }, { "kind": "DeploymentConfig", "apiVersion": "v1", "metadata": { "name": "${APP_NAME}", "labels": { "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" } }, "spec": { "strategy": { "type": "Recreate" }, "triggers": [ { "type": "ImageChange", "imageChangeParams": { "automatic": true, "containerNames": [ "${APP_NAME}" ], "from": { "kind": "ImageStreamTag", "name": "${APP_NAME}:latest" } } }, { "type": "ConfigChange" } ], "replicas": 1, "selector": { "deploymentConfig": "${APP_NAME}" }, "template": { "metadata": { "name": "${APP_NAME}", "labels": { "deploymentConfig": "${APP_NAME}", "app": "${APP_NAME}", "container": "eap", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" } }, "spec": { "terminationGracePeriodSeconds": 75, "containers": [ { "name": "${APP_NAME}", "image": "${APP_NAME}", "imagePullPolicy": "Always", "livenessProbe": { "exec": { "command": [ "/bin/bash", "-c", "/opt/eap/bin/livenessProbe.sh" ] }, "initialDelaySeconds": 60 }, "readinessProbe": { "exec": { "command": [ "/bin/bash", "-c", "/opt/eap/bin/readinessProbe.sh" ] } }, "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": "openshift.DNS_PING" }, { "name": "OPENSHIFT_DNS_PING_SERVICE_NAME", "value": "${APP_NAME}-ping" }, { "name": "OPENSHIFT_DNS_PING_SERVICE_PORT", "value": "8888" }, { "name": "DB_SERVICE_PREFIX_MAPPING", "value": "${APP_NAME}-mysql=DB" }, { "name": "DB_JNDI", "value": "${DB_JNDI}" }, { "name": "DB_DATABASE", "value": "${DB_DATABASE}" }, { "name": "DB_USERNAME", "value": "${DB_USERNAME}" }, { "name": "DB_PASSWORD", "value": "${DB_PASSWORD}" }, { "name": "DB_MIN_POOL_SIZE", "value": "${DB_MIN_POOL_SIZE}" }, { "name": "DB_MAX_POOL_SIZE", "value": "${DB_MAX_POOL_SIZE}" }, { "name": "DB_TX_ISOLATION", "value": "${DB_TX_ISOLATION}" }, { "name": "TX_DATABASE_PREFIX_MAPPING", "value": "${APP_NAME}-mysql=DB" }, { "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}" } ], "resources": { "requests": { "cpu": "${CPU_REQUEST}", "memory": "${MEMORY_REQUEST}" }, "limits": { "cpu": "${CPU_LIMIT}", "memory": "${MEMORY_LIMIT}" } } } ] } } } }, { "kind": "DeploymentConfig", "apiVersion": "v1", "metadata": { "name": "${APP_NAME}-mysql", "labels": { "app": "${APP_NAME}", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" } }, "spec": { "strategy": { "type": "Recreate" }, "triggers": [ { "type": "ImageChange", "imageChangeParams": { "automatic": true, "containerNames": [ "${APP_NAME}-mysql" ], "from": { "kind": "ImageStreamTag", "namespace": "${IMAGE_STREAM_NAMESPACE}", "name": "mysql:${MYSQL_IMAGE_STREAM_TAG}" } } }, { "type": "ConfigChange" } ], "replicas": 1, "selector": { "deploymentConfig": "${APP_NAME}-mysql" }, "template": { "metadata": { "name": "${APP_NAME}-mysql", "labels": { "deploymentConfig": "${APP_NAME}-mysql", "app": "${APP_NAME}", "component": "${APP_NAME}", "provider": "s2i", "version": "${APP_VERSION}", "group": "quickstarts" } }, "spec": { "terminationGracePeriodSeconds": 60, "containers": [ { "name": "${APP_NAME}-mysql", "image": "mysql", "imagePullPolicy": "Always", "ports": [ { "containerPort": 3306, "protocol": "TCP" } ], "readinessProbe": { "timeoutSeconds": 1, "initialDelaySeconds": 5, "exec": { "command": [ "/bin/sh", "-i", "-c", "MYSQL_PWD=\"$MYSQL_PASSWORD\" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'"] } }, "livenessProbe": { "timeoutSeconds": 1, "initialDelaySeconds": 30, "tcpSocket": { "port": 3306 } }, "env": [ { "name": "MYSQL_USER", "value": "${DB_USERNAME}" }, { "name": "MYSQL_PASSWORD", "value": "${DB_PASSWORD}" }, { "name": "MYSQL_DATABASE", "value": "${DB_DATABASE}" }, { "name": "MYSQL_LOWER_CASE_TABLE_NAMES", "value": "${MYSQL_LOWER_CASE_TABLE_NAMES}" }, { "name": "MYSQL_MAX_CONNECTIONS", "value": "${MYSQL_MAX_CONNECTIONS}" }, { "name": "MYSQL_FT_MIN_WORD_LEN", "value": "${MYSQL_FT_MIN_WORD_LEN}" }, { "name": "MYSQL_FT_MAX_WORD_LEN", "value": "${MYSQL_FT_MAX_WORD_LEN}" }, { "name": "MYSQL_AIO", "value": "${MYSQL_AIO}" } ] } ] } } } } ] }