OpenShift Template to Setup Codebeamer
1. Login in into your OpenShift application.
2. Create a new project.
3. Click on the Add to Project and select the Import YAML / JSON.
4. Copy&Paste the template into the textarea and click Create.
5. Check adjust volume sizes, it can be change later, but it requires downtime.
6. Click Create.
Template
---
kind: Template
apiVersion: v1
metadata:
name: codebeamer-app
annotations:
openshift.io/display-name: codebeamer
description: Intland Software's codebeamer ALM is an Application Lifecycle Management solution that offers powerful capabilities from requirements management all the way to release & operations. It helps ensure traceability, transparency, process visibility and accountability across the lifecycle. codebeamer ALM offers specific features and preconfigured templates to support compliance with safety-critical (medical, automotive, aviation) industry standards and regulations. Its widespread integrations allow enterprises to connect data and processes across multi-layered product lifecycles, ensuring integrity and data consistency. Intland Software's codebeamer ALM was named one of the top 4 market leading Application Lifecycle Management platforms by Ovum in 2016. Find out more about codebeamer at intland.com.
tags: "ALM, codebeamer, Application Lifecycle Management"
labels:
template: codebeamer-template
objects:
- kind: Secret
apiVersion: v1
metadata:
name: "database-secret"
annotations:
template.openshift.io/expose-username: "{.data['database-user']}"
template.openshift.io/expose-password: "{.data['database-password']}"
template.openshift.io/expose-root_password: "{.data['database-root-password']}"
template.openshift.io/expose-database_name: "{.data['database-name']}"
stringData:
database-user: "${MYSQL_USER}"
database-password: "${MYSQL_PASSWORD}"
database-root-password: "${MYSQL_ROOT_PASSWORD}"
database-name: "${MYSQL_DATABASE}"
# **** codebeamer Application ****
# Service for application
- kind: Service
apiVersion: v1
metadata:
name: codebeamer
spec:
ports:
- name: web
protocol: TCP
port: 8080
targetPort: 8080
nodePort: 0
selector:
name: codebeamer
type: ClusterIP
sessionAffinity: None
status:
loadBalancer: {}
# Volumes for application
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "codebeamer-logs-data"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${APPLICATION_LOGS_VOLUME_CAPACITY}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "codebeamer-search-data"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${APPLICATION_SEARCH_VOLUME_CAPACITY}"
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "codebeamer-docs-data"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${APPLICATION_DOCUMENT_VOLUME_CAPACITY}"
# Route for applcation
- kind: Route
apiVersion: v1
metadata:
name: codebeamer-route-edge
annotations:
template.openshift.io/expose-uri: http://{.spec.host}{.spec.path}
spec:
host: ${APPLICATION_DOMAIN}
to:
kind: Service
name: codebeamer
tls:
termination: edge
status: {}
# Deployment for applcation
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: codebeamer
annotations:
template.alpha.openshift.io/wait-for-ready: 'true'
spec:
strategy:
type: Recreate
triggers:
- type: ConfigChange
replicas: 1
selector:
name: codebeamer
template:
metadata:
labels:
name: codebeamer
spec:
containers:
- name: codebeamer-app
image: intland/codebeamer93:latest
ports:
- containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
path: /hc/ping.spr
port: 8080
initialDelaySeconds: 120
periodSeconds: 5
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
livenessProbe:
httpGet:
path: /hc/ping.spr
port: 8080
initialDelaySeconds: 120
periodSeconds: 5
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
env:
- name: TZ
value: "${APPLICATION_TIMEZONE}"
- name: CB_DATABASE_SERVICE_NAME
value: "database"
- name: WAIT_HOSTS
value: "${DATABASE_HOST}:3306"
- name: WAIT_HOSTS_TIMEOUT
value: "120"
- name: CB_database_JDBC_Username
valueFrom:
secretKeyRef:
name: database-secret
key: database-user
- name: CB_database_JDBC_Password
valueFrom:
secretKeyRef:
name: database-secret
key: database-password
- name: CB_database_JDBC_Driver
value: "com.mysql.jdbc.Driver"
- name: CB_database_JDBC_Timeout
value: "120"
- name: CB_database_JDBC_ConnectionURL
value: "jdbc:mysql://${DATABASE_HOST}:3306/${MYSQL_DATABASE}?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false"
imagePullPolicy: IfNotPresent
securityContext:
capabilities: {}
privileged: false
resources:
requests:
memory: "${APPLICATION_MEMORY_REQUEST}"
limits:
memory: "${APPLICATION_MEMORY_LIMIT}"
terminationMessagePath: "/dev/termination-log"
volumeMounts:
- name: "codebeamer-logs-data"
mountPath: "/home/appuser/codebeamer/logs"
- name: "codebeamer-search-data"
mountPath: "/home/appuser/codebeamer/repository/search"
- name: "codebeamer-docs-data"
mountPath: "/home/appuser/codebeamer/repository/docs"
volumes:
- name: "codebeamer-logs-data"
persistentVolumeClaim:
claimName: "codebeamer-logs-data"
- name: "codebeamer-search-data"
persistentVolumeClaim:
claimName: "codebeamer-search-data"
- name: "codebeamer-docs-data"
persistentVolumeClaim:
claimName: "codebeamer-docs-data"
restartPolicy: Always
dnsPolicy: ClusterFirst
status: {}
# **** MySql database ****
- kind: Service
apiVersion: v1
metadata:
name: "database"
annotations:
template.openshift.io/expose-uri: mysql://{.spec.clusterIP}:{.spec.ports[?(.name=="mysql")].port}
spec:
ports:
- name: mysql
port: 3306
selector:
name: "database"
# Volumes for database
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "database-data"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${DATABASE_VOLUME_CAPACITY}"
# Deployment for database
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: "database"
annotations:
template.alpha.openshift.io/wait-for-ready: 'true'
spec:
strategy:
type: Recreate
triggers:
- type: ConfigChange
replicas: 1
selector:
name: "database"
template:
metadata:
labels:
name: "database"
spec:
containers:
- name: mysql
image: intland/mysql:latest
ports:
- containerPort: 3306
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
valueFrom:
secretKeyRef:
name: "database-secret"
key: database-user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: "database-secret"
key: database-password
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: "database-secret"
key: database-root-password
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: "database-secret"
key: database-name
resources:
requests:
memory: "${DATABASE_MEMORY_REQUEST}"
limits:
memory: "${DATABASE_MEMORY_LIMIT}"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: "database-data"
mountPath: "/var/lib/mysql/data"
volumes:
- name: "database-data"
persistentVolumeClaim:
claimName: "database-data"
parameters:
- name: DATABASE_MEMORY_REQUEST
displayName: Memory Request of application
description: Minimum amount of memory the container will use.
value: 4Gi
- name: DATABASE_MEMORY_LIMIT
displayName: Memory Limit of database
description: Maximum amount of memory the container can use.
value: 7Gi
required: true
- name: DATABASE_VOLUME_CAPACITY
displayName: Volume Capacity of database
description: Volume space available for data, e.g. 512Mi, 2Gi.
value: 10Gi
required: true
- name: MYSQL_USER
displayName: MySQL Connection Username
description: Username for MySQL user that will be used for accessing the database.
generate: expression
from: user[A-Z0-9]{3}
required: true
- name: MYSQL_PASSWORD
displayName: MySQL Connection Password
description: Password for the MySQL connection user.
generate: expression
from: "[a-zA-Z0-9]{16}"
required: true
- name: MYSQL_ROOT_PASSWORD
displayName: MySQL root user Password
description: Password for the MySQL root user.
generate: expression
from: "[a-zA-Z0-9]{16}"
required: true
- name: MYSQL_DATABASE
displayName: MySQL Database Name
description: Name of the MySQL database accessed.
value: codebeamer
required: true
- name: APPLICATION_MEMORY_REQUEST
displayName: Memory Request of application
description: Minimum amount of memory the container will use.
value: 4Gi
- name: APPLICATION_MEMORY_LIMIT
displayName: Memory Limit of application
description: Maximum amount of memory the container can use.
value: 7Gi
required: true
- name: APPLICATION_LOGS_VOLUME_CAPACITY
displayName: Volume Capacity of log directory
description: Volume space available for data, e.g. 512Mi, 2Gi.
value: 10Gi
required: true
- name: APPLICATION_SEARCH_VOLUME_CAPACITY
displayName: Volume Capacity of search directory
description: Volume space available for data, e.g. 512Mi, 2Gi.
value: 10Gi
required: true
- name: APPLICATION_DOCUMENT_VOLUME_CAPACITY
displayName: Volume Capacity of document directory
description: Volume space available for data, e.g. 512Mi, 2Gi.
value: 10Gi
required: true
- name: APPLICATION_INITIAL_CONFIGURATION
displayName: Initial configuration
description: Initial configuration of the applicaiton, it is represented as a json string
required: false
- name: APPLICATION_TIMEZONE
displayName: Time zone of the application
description: Default timezone is UTC, please check the https://codebeamer.com/cb/wiki/5562876 page for more details
value: UTC
required: true
- name: APPLICATION_DOMAIN
displayName: Domain of the application
value: test.app-openshift.codebeamer.com
required: true