Skip to content

Commit

Permalink
Merge pull request #27 from bmozaffa/RHPAM-730
Browse files Browse the repository at this point in the history
[RHPAM-730] Switched from MySQL to persistent H2 in rhpam70-authoring template
  • Loading branch information
errantepiphany committed Apr 10, 2018
2 parents fa941c6 + 073e8b8 commit 70ee3b0
Showing 1 changed file with 41 additions and 178 deletions.
219 changes: 41 additions & 178 deletions templates/rhpam70-authoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ labels:
xpaas: 1.4.0
message: A new persistent Process Automation Manager application have been created in your project.
The username/password for accessing the KIE Server / Business Central interface is ${KIE_ADMIN_USER}/${KIE_ADMIN_PWD}.
For accessing the MySQL database "${DB_DATABASE}" use the credentials ${DB_USERNAME}/${DB_PASSWORD}.
Please be sure to create the secrets named "${BUSINESS_CENTRAL_HTTPS_SECRET}" and "${KIE_SERVER_HTTPS_SECRET}" containing the
${BUSINESS_CENTRAL_HTTPS_KEYSTORE} and ${KIE_SERVER_HTTPS_KEYSTORE}files used for serving secure content.
${BUSINESS_CENTRAL_HTTPS_KEYSTORE} and ${KIE_SERVER_HTTPS_KEYSTORE} files used for serving secure content.
parameters:
- displayName: Application Name
description: The name for the application.
Expand Down Expand Up @@ -77,20 +76,21 @@ parameters:
name: KIE_SERVER_BYPASS_AUTH_USER
value: 'false'
required: false
- displayName: KIE Server Persistence Dialect
description: KIE execution server persistence dialect (Sets the org.kie.server.persistence.dialect system property)
name: KIE_SERVER_PERSISTENCE_DIALECT
value: org.hibernate.dialect.MySQL5Dialect
required: false
- displayName: KIE Server Persistence DS
description: KIE execution server persistence datasource (Sets the org.kie.server.persistence.ds system property)
name: KIE_SERVER_PERSISTENCE_DS
value: java:/jboss/datasources/ExampleDS
value: java:/jboss/datasources/rhpam
required: false
- displayName: KIE Server H2 Database User
description: KIE execution server H2 database username
name: KIE_SERVER_H2_USER
value: sa
required: false
- displayName: KIE Server Persistence TM
description: KIE execution server persistence transaction manager (Sets the org.kie.server.persistence.tm system property)
name: KIE_SERVER_PERSISTENCE_TM
value: org.hibernate.engine.transaction.jta.platform.internal.JBossAppServerJtaPlatform
- displayName: KIE Server H2 Database Password
description: KIE execution server H2 database password
name: KIE_SERVER_H2_PWD
from: "[a-zA-Z]{6}[0-9]{1}!"
generate: expression
required: false
- displayName: KIE MBeans
description: KIE execution server mbeans enabled/disabled (Sets the kie.mbeans and kie.scanner.mbeans system properties)
Expand Down Expand Up @@ -126,16 +126,6 @@ parameters:
name: EXECUTION_SERVER_HOSTNAME_HTTPS
value: ''
required: false
- displayName: Database JNDI Name
description: Database JNDI name used by application to resolve the datasource, e.g. java:/jboss/datasources/ExampleDS
name: DB_JNDI
value: java:jboss/datasources/ExampleDS
required: false
- displayName: Database Name
description: Database name
name: DB_DATABASE
value: root
required: true
- displayName: Business Central Server Keystore Secret Name
description: The name of the secret containing the keystore file
name: BUSINESS_CENTRAL_HTTPS_SECRET
Expand Down Expand Up @@ -176,60 +166,11 @@ parameters:
name: KIE_SERVER_HTTPS_PASSWORD
value: mykeystorepass
required: false
- 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: Timer service data store refresh interval (in milliseconds)
description: Sets refresh-interval for the EJB timer service database-data-store.
name: TIMER_SERVICE_DATA_STORE_REFRESH_INTERVAL
value: '30000'
required: false
- displayName: Database Volume Capacity
description: Size of persistent storage for database volume.
name: DB_VOLUME_CAPACITY
value: 512Mi
required: true
- 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: ImageStream Namespace
description: Namespace in which the ImageStreams for Red Hat Middleware images are
installed. These ImageStreams are normally installed in the openshift namespace.
Expand All @@ -243,12 +184,6 @@ parameters:
name: IMAGE_STREAM_TAG
value: "1.0"
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: Maven repository URL
description: Fully qualified URL to a Maven repository. If unspecified, will fall back to Business Central service.
name: MAVEN_REPO_URL
Expand Down Expand Up @@ -337,20 +272,6 @@ objects:
application: "${APPLICATION_NAME}"
annotations:
description: The KIE server web server's https port.
- kind: Service
apiVersion: v1
spec:
ports:
- port: 3306
targetPort: 3306
selector:
deploymentConfig: "${APPLICATION_NAME}-mysql"
metadata:
name: "${APPLICATION_NAME}-mysql"
labels:
application: "${APPLICATION_NAME}"
annotations:
description: The database server's port.
- kind: Route
apiVersion: v1
id: "${APPLICATION_NAME}-rhpamcentr-http"
Expand Down Expand Up @@ -555,6 +476,8 @@ objects:
- name: kieserver-keystore-volume
mountPath: "/etc/kieserver-secret-volume"
readOnly: true
- name: "${APPLICATION_NAME}-h2-pvol"
mountPath: "/opt/eap/standalone/data"
livenessProbe:
exec:
command:
Expand All @@ -578,6 +501,29 @@ objects:
containerPort: 8443
protocol: TCP
env:
- name: DATASOURCES
value: "RHPAM"
- name: RHPAM_DATABASE
value: "rhpam7"
- name: RHPAM_JNDI
value: "${KIE_SERVER_PERSISTENCE_DS}"
- name: RHPAM_DRIVER
value: "h2"
- name: RHPAM_JTA
value: "true"
- name: RHPAM_NONXA
value: "true"
- name: RHPAM_USERNAME
value: "${KIE_SERVER_H2_USER}"
- name: RHPAM_PASSWORD
value: "${KIE_SERVER_H2_PWD}"
- name: RHPAM_URL
value: "jdbc:h2:/opt/eap/standalone/data/rhpam"
- name: RHPAM_SERVICE_HOST
value: "dummy_ignored"
- name: RHPAM_SERVICE_PORT
value: "12345"

- name: DROOLS_SERVER_FILTER_CLASSES
value: "${DROOLS_SERVER_FILTER_CLASSES}"
- name: KIE_ADMIN_PWD
Expand All @@ -601,11 +547,9 @@ objects:
fieldRef:
fieldPath: status.podIP
- name: KIE_SERVER_PERSISTENCE_DIALECT
value: "${KIE_SERVER_PERSISTENCE_DIALECT}"
value: "org.hibernate.dialect.H2Dialect"
- name: KIE_SERVER_PERSISTENCE_DS
value: "${KIE_SERVER_PERSISTENCE_DS}"
- name: KIE_SERVER_PERSISTENCE_TM
value: "${KIE_SERVER_PERSISTENCE_TM}"
- name: KIE_SERVER_PWD
value: "${KIE_SERVER_PWD}"
- name: KIE_SERVER_USER
Expand All @@ -620,28 +564,6 @@ objects:
value: "${KIE_ADMIN_USER}"
- name: MAVEN_REPO_PASSWORD
value: "${KIE_ADMIN_PWD}"
- name: DB_SERVICE_PREFIX_MAPPING
value: "${APPLICATION_NAME}-mysql=DB"
- name: DB_JNDI
value: "${DB_JNDI}"
- name: DB_USERNAME
value: "${DB_USERNAME}"
- name: DB_PASSWORD
value: "${DB_PASSWORD}"
- name: DB_DATABASE
value: "${DB_DATABASE}"
- name: TX_DATABASE_PREFIX_MAPPING
value: "${APPLICATION_NAME}-mysql=DB"
- 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: TIMER_SERVICE_DATA_STORE
value: "${APPLICATION_NAME}-mysql"
- name: TIMER_SERVICE_DATA_STORE_REFRESH_INTERVAL
value: "${TIMER_SERVICE_DATA_STORE_REFRESH_INTERVAL}"
- name: HTTPS_KEYSTORE_DIR
value: "/etc/kieserver-secret-volume"
- name: HTTPS_KEYSTORE
Expand All @@ -654,68 +576,9 @@ objects:
- name: kieserver-keystore-volume
secret:
secretName: "${KIE_SERVER_HTTPS_SECRET}"
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: "${APPLICATION_NAME}-mysql"
labels:
application: "${APPLICATION_NAME}"
spec:
strategy:
type: Recreate
triggers:
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- "${APPLICATION_NAME}-mysql"
from:
kind: ImageStreamTag
namespace: "${IMAGE_STREAM_NAMESPACE}"
name: "mysql:${MYSQL_IMAGE_STREAM_TAG}"
- type: ConfigChange
replicas: 1
selector:
deploymentConfig: "${APPLICATION_NAME}-mysql"
template:
metadata:
name: "${APPLICATION_NAME}-mysql"
labels:
deploymentConfig: "${APPLICATION_NAME}-mysql"
application: "${APPLICATION_NAME}"
spec:
terminationGracePeriodSeconds: 60
containers:
- name: "${APPLICATION_NAME}-mysql"
image: mysql
imagePullPolicy: Always
ports:
- containerPort: 3306
protocol: TCP
volumeMounts:
- mountPath: "/var/lib/mysql/data"
name: "${APPLICATION_NAME}-mysql-pvol"
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}"
volumes:
- name: "${APPLICATION_NAME}-mysql-pvol"
- name: "${APPLICATION_NAME}-h2-pvol"
persistentVolumeClaim:
claimName: "${APPLICATION_NAME}-mysql-claim"
claimName: "${APPLICATION_NAME}-h2-claim"
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -731,7 +594,7 @@ objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "${APPLICATION_NAME}-mysql-claim"
name: "${APPLICATION_NAME}-h2-claim"
labels:
application: "${APPLICATION_NAME}"
spec:
Expand Down

0 comments on commit 70ee3b0

Please sign in to comment.