Application Deployment
The following is a sample template for deploying a new TIBCO Offer and Price Engine application on OpenShift. Sample OpenShift configuration files for deploying all the OPE microservices are present at the following installation location: <OPE_HOME>/ocp/
Copy
ope_openshift.yaml
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Service
metadata:
name: ope
spec:
ports:
- port: 8090
targetPort: 8090
name: jolokia
selector:
deploymentconfig: ope
- apiVersion: v1
kind: DeploymentConfig
metadata:
name: ope
annotations:
hawkular-openshift-agent: ope-jolokia
spec:
replicas: 1
selector:
deploymentconfig: ope
strategy:
# We set the type of strategy to Recreate, which means that it will be scaled down prior to being scaled up
type: Recreate
template:
metadata:
labels:
deploymentconfig: ope
spec:
containers:
- image: tibco/ope:5.1.0
name: ope
ports:
- name: jolokia
containerPort: 8090
- name: http
containerPort: 8090
env:
- name: configuration.service.url
value: http://configuration.192.168.99.100.nip.io/
volumes:
- name: hawkular-openshift-agent
configMap:
name: ope-jolokia
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/ready
port: 8090
scheme: HTTP
periodSeconds: 300
successThreshold: 1
timeoutSeconds: 3
livenessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health
port: 8090
scheme: HTTP
periodSeconds: 300
successThreshold: 1
timeoutSeconds: 3
resources:
limits:
cpu: '2'
memory: 2Gi
requests:
cpu: '1'
memory: 1Gi
- apiVersion: v1
kind: ConfigMap
metadata:
name: ope-jolokia
labels:
name: ope-jolokia
data:
hawkular-openshift-agent: |
endpoints:
- type: jolokia
protocol: http
port: 9090
path: /actuator/jolokia/
collection_interval: 15s
metrics:
# int data value
- name: java.lang:type=Memory#ObjectPendingFinalizationCount
type: gauge
description: Object Pending Finalization Count
# long data value
- name: java.lang:type=OperatingSystem#OpenFileDescriptorCount
type: gauge
description: Open File Descriptor Count
# double data value
- name: java.lang:type=OperatingSystem#ProcessCpuLoad
type: gauge
description: Process CPU Load
# composite data value
- name: java.lang:type=Memory#HeapMemoryUsage#used
type: gauge
description: Heap Memory Used
units: B
# boolean value
- name: java.lang:type=Memory#Verbose
type: gauge
description: Memory Verbose Mode
- apiVersion: v1
kind: Route
metadata:
name: ope
spec:
to:
kind: Service
name: ope
- apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: ope
spec:
scaleTargetRef:
kind: DeploymentConfig
name: ope
apiVersion: v1
subresource: scale
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 5