Skip to content

Latest commit

 

History

History
264 lines (177 loc) · 12 KB

jws31-tomcat8-mysql-persistent-s2i.adoc

File metadata and controls

264 lines (177 loc) · 12 KB

jws31-tomcat8-mysql-persistent-s2i

Parameters

Templates allow you to define parameters which take on a value. That value is then substituted wherever the parameter is referenced. References can be defined in any text field in the objects list field. Refer to the OKD documentation for more information.

Variable name Image Environment Variable Description Example value Required

APPLICATION_NAME

 — 

The name for the application.

jws-app

True

HOSTNAME_HTTP

 — 

Custom hostname for http service route. Leave blank for default hostname, e.g.: <application-name>-<project>.<default-domain-suffix>

 — 

False

HOSTNAME_HTTPS

 — 

Custom hostname for https service route. Leave blank for default hostname, e.g.: secure-<application-name>-<project>.<default-domain-suffix>

 — 

False

SOURCE_REPOSITORY_URL

 — 

Git source URI for application

https://github.com/jboss-openshift/openshift-quickstarts

True

SOURCE_REPOSITORY_REF

 — 

Git branch/tag reference

1.2

False

CONTEXT_DIR

 — 

Path within Git project to build; empty for root project directory.

todolist/todolist-jdbc

False

DB_JNDI

DB_JNDI

Database JNDI name used by application to resolve the datasource, e.g. jboss/datasources/mysqlDS

jboss/datasources/defaultDS

False

DB_DATABASE

DB_DATABASE

Database name

root

True

VOLUME_CAPACITY

 — 

Size of persistent storage for database volume.

1Gi

True

JWS_HTTPS_SECRET

 — 

The name of the secret containing the certificate files

jws-app-secret

True

JWS_HTTPS_CERTIFICATE

JWS_HTTPS_CERTIFICATE_DIR

The name of the certificate file within the secret

server.crt

False

JWS_HTTPS_CERTIFICATE_KEY

JWS_HTTPS_CERTIFICATE

The name of the certificate key file within the secret

server.key

False

JWS_HTTPS_CERTIFICATE_PASSWORD

JWS_HTTPS_CERTIFICATE

The certificate password

${JWS_HTTPS_CERTIFICATE}

False

DB_MIN_POOL_SIZE

DB_MIN_POOL_SIZE

Sets xa-pool/min-pool-size for the configured datasource.

${DB_MIN_POOL_SIZE}

False

DB_MAX_POOL_SIZE

DB_MAX_POOL_SIZE

Sets xa-pool/max-pool-size for the configured datasource.

${DB_MAX_POOL_SIZE}

False

DB_TX_ISOLATION

DB_TX_ISOLATION

Sets transaction-isolation for the configured datasource.

${DB_TX_ISOLATION}

False

MYSQL_LOWER_CASE_TABLE_NAMES

MYSQL_LOWER_CASE_TABLE_NAMES

Sets how the table names are stored and compared.

${MYSQL_LOWER_CASE_TABLE_NAMES}

False

MYSQL_MAX_CONNECTIONS

MYSQL_MAX_CONNECTIONS

The maximum permitted number of simultaneous client connections.

${MYSQL_MAX_CONNECTIONS}

False

MYSQL_FT_MIN_WORD_LEN

MYSQL_FT_MIN_WORD_LEN

The minimum length of the word to be included in a FULLTEXT index.

${MYSQL_FT_MIN_WORD_LEN}

False

MYSQL_FT_MAX_WORD_LEN

MYSQL_FT_MAX_WORD_LEN

The maximum length of the word to be included in a FULLTEXT index.

${MYSQL_FT_MAX_WORD_LEN}

False

MYSQL_AIO

MYSQL_AIO

Controls the innodb_use_native_aio setting value if the native AIO is broken.

${MYSQL_AIO}

False

DB_USERNAME

DB_USERNAME

Database user name

${DB_USERNAME}

True

DB_PASSWORD

DB_PASSWORD

Database user password

${DB_PASSWORD}

True

JWS_ADMIN_USERNAME

JWS_ADMIN_USERNAME

JWS Admin User

${JWS_ADMIN_USERNAME}

True

JWS_ADMIN_PASSWORD

JWS_ADMIN_PASSWORD

JWS Admin Password

${JWS_ADMIN_PASSWORD}

True

GITHUB_WEBHOOK_SECRET

 — 

GitHub trigger secret

secret101

True

GENERIC_WEBHOOK_SECRET

 — 

Generic build trigger secret

secret101

True

IMAGE_STREAM_NAMESPACE

 — 

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.

openshift

True

MAVEN_MIRROR_URL

 — 

Maven mirror to use for S2I builds

 — 

False

ARTIFACT_DIR

 — 

List of directories from which archives will be copied into the deployment folder. If unspecified, all archives in /target will be copied.

 — 

False

MYSQL_IMAGE_STREAM_TAG

 — 

The tag to use for the "mysql" image stream. Typically, this aligns with the major.minor version of MySQL.

5.7

True

Objects

The CLI supports various object types. A list of these object types as well as their abbreviations can be found in the OKD documentation.

Services

A service is an abstraction which defines a logical set of pods and a policy by which to access them. Refer to the OKD documentation for more information.

Service Port Name Description

${APPLICATION_NAME}

8080

 — 

The web server’s http port.

secure-${APPLICATION_NAME}

8443

 — 

The web server’s https port.

${APPLICATION_NAME}-mysql

3306

 — 

The database server’s port.

Routes

A route is a way to expose a service by giving it an externally-reachable hostname such as www.example.com. A defined route and the endpoints identified by its service can be consumed by a router to provide named connectivity from external clients to your applications. Each route consists of a route name, service selector, and (optionally) security configuration. Refer to the OKD documentation for more information.

Service Security Hostname

${APPLICATION_NAME}-http

none

${HOSTNAME_HTTP}

${APPLICATION_NAME}-https

TLS passthrough

${HOSTNAME_HTTPS}

Build Configurations

A buildConfig describes a single build definition and a set of triggers for when a new build should be created. A buildConfig is a REST object, which can be used in a POST to the API server to create a new instance. Refer to the OKD documentation for more information.

S2I image link Build output BuildTriggers and Settings

jboss-webserver31-tomcat8-openshift:1.3

jboss-webserver-3/webserver31-tomcat8-openshift

${APPLICATION_NAME}:latest

GitHub, Generic, ImageChange, ConfigChange

Deployment Configurations

A deployment in OpenShift is a replication controller based on a user defined template called a deployment configuration. Deployments are created manually or in response to triggered events. Refer to the OKD documentation for more information.

Triggers

A trigger drives the creation of new deployments in response to events, both inside and outside OpenShift. Refer to the OKD documentation for more information.

Deployment Triggers

${APPLICATION_NAME}

ImageChange

${APPLICATION_NAME}-mysql

ImageChange

Replicas

A replication controller ensures that a specified number of pod "replicas" are running at any one time. If there are too many, the replication controller kills some pods. If there are too few, it starts more. Refer to the OKD documentation for more information.

Deployment Replicas

${APPLICATION_NAME}

1

${APPLICATION_NAME}-mysql

1

Pod Template

Image
Deployment Image

${APPLICATION_NAME}

${APPLICATION_NAME}

${APPLICATION_NAME}-mysql

mysql

Readiness Probe
${APPLICATION_NAME}
/bin/bash -c curl --noproxy '*' -s -u ${JWS_ADMIN_USERNAME}:${JWS_ADMIN_PASSWORD} 'http://localhost:8080/manager/jmxproxy/?get=Catalina%3Atype%3DServer&att=stateName' |grep -iq 'stateName *= *STARTED'
${APPLICATION_NAME}-mysql
/bin/sh -i -c MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1'
Exposed Ports
Deployments Name Port Protocol

${APPLICATION_NAME}

jolokia

8778

TCP

http

8080

TCP

https

8443

TCP

${APPLICATION_NAME}-mysql

 — 

3306

TCP

Image Environment Variables
Deployment Variable name Description Example value

${APPLICATION_NAME}

DB_SERVICE_PREFIX_MAPPING

 — 

${APPLICATION_NAME}-mysql=DB

DB_JNDI

Database JNDI name used by application to resolve the datasource, e.g. jboss/datasources/mysqlDS

${DB_JNDI}

DB_USERNAME

Database user name

${DB_USERNAME}

DB_PASSWORD

Database user password

${DB_PASSWORD}

DB_DATABASE

Database name

${DB_DATABASE}

DB_MIN_POOL_SIZE

Sets xa-pool/min-pool-size for the configured datasource.

${DB_MIN_POOL_SIZE}

DB_MAX_POOL_SIZE

Sets xa-pool/max-pool-size for the configured datasource.

${DB_MAX_POOL_SIZE}

DB_TX_ISOLATION

Sets transaction-isolation for the configured datasource.

${DB_TX_ISOLATION}

JWS_HTTPS_CERTIFICATE_DIR

The name of the certificate file within the secret

/etc/jws-secret-volume

JWS_HTTPS_CERTIFICATE

The name of the certificate file within the secret

${JWS_HTTPS_CERTIFICATE}

JWS_HTTPS_CERTIFICATE_KEY

The name of the certificate file within the secret

${JWS_HTTPS_CERTIFICATE_KEY}

JWS_HTTPS_CERTIFICATE_PASSWORD

The name of the certificate file within the secret

${JWS_HTTPS_CERTIFICATE_PASSWORD}

JWS_ADMIN_USERNAME

JWS Admin User

${JWS_ADMIN_USERNAME}

JWS_ADMIN_PASSWORD

JWS Admin Password

${JWS_ADMIN_PASSWORD}

${APPLICATION_NAME}-mysql

MYSQL_USER

 — 

${DB_USERNAME}

MYSQL_PASSWORD

 — 

${DB_PASSWORD}

MYSQL_DATABASE

 — 

${DB_DATABASE}

MYSQL_LOWER_CASE_TABLE_NAMES

Sets how the table names are stored and compared.

${MYSQL_LOWER_CASE_TABLE_NAMES}

MYSQL_MAX_CONNECTIONS

The maximum permitted number of simultaneous client connections.

${MYSQL_MAX_CONNECTIONS}

MYSQL_FT_MIN_WORD_LEN

The minimum length of the word to be included in a FULLTEXT index.

${MYSQL_FT_MIN_WORD_LEN}

MYSQL_FT_MAX_WORD_LEN

The maximum length of the word to be included in a FULLTEXT index.

${MYSQL_FT_MAX_WORD_LEN}

MYSQL_AIO

Controls the innodb_use_native_aio setting value if the native AIO is broken.

${MYSQL_AIO}

Volumes
Deployment Name mountPath Purpose readOnly

${APPLICATION_NAME}

jws-certificate-volume

/etc/jws-secret-volume

ssl certs

True

${APPLICATION_NAME}-mysql

${APPLICATION_NAME}-mysql-pvol

/var/lib/mysql/data

mysql

false

External Dependencies

Volume Claims

A PersistentVolume object is a storage resource in an OpenShift cluster. Storage is provisioned by an administrator by creating PersistentVolume objects from sources such as GCE Persistent Disks, AWS Elastic Block Stores (EBS), and NFS mounts. Refer to the OKD documentation for more information.

Name Access Mode

${APPLICATION_NAME}-mysql-claim

ReadWriteOnce