# Run yCrash in OpenShift
# Deployment Documentation for yCrash Server in OpenShift
This guide provides step-by-step instructions to deploy the yc-server application in an OpenShift environment using the provided YAML files. The deployment consists of creating Secrets, a Deployment, Services, Routes, PersistentVolumeClaims, and ServiceAccounts.
# Prerequisites
Ensure you have the following:
- Proper permissions to create resources (Secrets, Deployments, PVCs, etc.)
- Persistent volumes available in the cluster
- Valid
license.licfor yc-server - Project
yc-appsshould exist or be created before deployment:
oc new-project yc-apps --display-name 'yCrash App'
# Step 1: Create a Secret for yCrash License
The ycrash-server-license Secret contains the license.lic file required by the yc-server application.
apiVersion: v1
kind: Secret
metadata:
name: ycrash-server-license
namespace: yc-apps
stringData:
license.lic: |
Licensor=********************
Licensee=********************
UserNo=********************
IPAddress=********************
Feature_1=********************
Feature_2=********************
Expiration=********************
Signature=********************
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Apply the Secret:
oc apply -f ycrash-server-license.yaml
# Step 2: Create PersistentVolumeClaims (PVCs)
Two PVCs are required:
logs-pvc: Stores log files generated by yc-serveruploads-pvc: Stores heap dumps, reports, and other uploaded files
# PersistentVolumeClaim for Logs
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: logs-pvc
namespace: yc-apps
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
2
3
4
5
6
7
8
9
10
11
# PersistentVolumeClaim for Uploads
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: uploads-pvc
namespace: yc-apps
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
2
3
4
5
6
7
8
9
10
11
Apply the PVCs:
oc apply -f logs-pvc.yaml
oc apply -f uploads-pvc.yaml
2
# Step 3: Create the ServiceAccount
The yc-server container will use a dedicated ServiceAccount (yc-server-sa) for interacting with the OpenShift API.
apiVersion: v1
kind: ServiceAccount
metadata:
name: yc-server-sa
namespace: yc-apps
2
3
4
5
Apply the ServiceAccount:
oc apply -f yc-server-sa.yaml
# Step 4: Create the Deployment for yCrash Server
The yc-server deployment runs two replicas of the server application. The configuration includes resource requests, license mounting, and volume mounts.
Key Configuration Details:
License File: Mounted from the Secret ycrash-server-licenseLogs Directory: Mounted from logs-pvcUploads Directory: Mounted from uploads-pvc
apiVersion: apps/v1
kind: Deployment
metadata:
name: yc-apps
namespace: yc-apps
labels:
app: yc-apps
spec:
replicas: 2
selector:
matchLabels:
app: yc-apps
template:
metadata:
labels:
app: yc-apps
spec:
serviceAccountName: yc-server-sa
shareProcessNamespace: true
terminationGracePeriodSeconds: 180
containers:
- name: yc-server
image: ycrash/ycrash:latest
imagePullPolicy: Always
args:
- "-Xms2g"
- "-Xmx4g"
- "-Xss40m"
- "-verbose:gc"
- "-Xlog:gc*:file=/opt/workspace/yc/logs/yc-gclog-%p.gc:time,uptime,level,tags"
- "-XX:+UnlockDiagnosticVMOptions"
- "-XX:+HeapDumpOnOutOfMemoryError"
- "-XX:HeapDumpPath=/opt/workspace/yc/logs/ba-heapdump-%p.hprof"
- "-XX:ErrorFile=/opt/workspace/yc/logs/ba-log-hs_err_pid-%p.log"
- "-Duser.language=en"
- "-Duser.country=en_US"
- "-Djava.awt.headless=true"
- "-DhprofStrictnessWarning=true"
- "-DonlyTroubleshootingReport=true"
- "-Dapp=yc"
- "-DlogDir=/opt/workspace/yc/logs"
- "-DuploadDir=/opt/workspace/yc/uploads"
- "-jar"
- "webapp-runner.jar"
- "-AconnectionTimeout=3600000"
- "--secure-error-report-valve"
- "--port"
- "8080"
- "yc.war"
ports:
- containerPort: 8080
resources:
requests:
memory: 2Gi
cpu: "200m"
limits:
memory: 4Gi
cpu: "500m"
volumeMounts:
- name: ycrash-server-license
mountPath: "/opt/workspace/yc/uploads/license.lic"
subPath: license.lic
- name: logs-pvc
mountPath: "/opt/workspace/yc/logs"
- name: uploads-pvc
mountPath: "/opt/workspace/yc/uploads"
- name: tmp
mountPath: "/tmp"
volumes:
- name: ycrash-server-license
secret:
secretName: ycrash-server-license
items:
- key: license.lic
path: license.lic
- name: logs-pvc
persistentVolumeClaim:
claimName: logs-pvc
- name: uploads-pvc
persistentVolumeClaim:
claimName: uploads-pvc
- name: tmp
emptyDir: {}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Apply the Deployment:
oc apply -f yc-server-deployment.yaml
# Step 5: Create the Service
The yc-server-service exposes the yc-server container within the cluster.
apiVersion: v1
kind: Service
metadata:
name: yc-server-service
labels:
app: yc-apps
namespace: yc-apps
spec:
selector:
app: yc-apps
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: ClusterIP
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Apply the Service:
oc apply -f yc-server-service.yaml
# Step 6: Create the Route
The Route exposes the yc-server service outside the OpenShift cluster via the host yc-server-app.local.
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: yc-server-route
namespace: yc-apps
spec:
host: yc-server-app.local
to:
kind: Service
name: yc-server-service
port:
targetPort: 8080
tls:
termination: edge
wildcardPolicy: None
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Apply the Route:
oc apply -f yc-server-route.yaml
# Verification Steps
- Ensure all resources are created:
oc get all -n yc-apps
- Add
yc-server-app.localto your/etc/hostsfile pointing to the ingress IP and access the application:
Internal: yc-server-serviceExternal: https://yc-server-app.local (opens new window)
# Troubleshooting
- Check logs:
oc logs -f deployment/yc-apps -n yc-apps
- Verify Routes:
oc get routes -n yc-apps
# Combined Deployment YAML file
---
# Secret for yc-server license
apiVersion: v1
kind: Secret
metadata:
name: ycrash-server-license
namespace: yc-apps
stringData:
license.lic: |
apiVersion: v1
kind: Secret
metadata:
name: ycrash-server-license
namespace: yc-apps
stringData:
license.lic: |
Licensor=********************
Licensee=********************
UserNo=********************
IPAddress=********************
Feature_1=********************
Feature_2=********************
Expiration=********************
Signature=********************
---
# Deployment for yc-server
apiVersion: apps/v1
kind: Deployment
metadata:
name: yc-apps
namespace: yc-apps
labels:
app: yc-apps
spec:
replicas: 2
selector:
matchLabels:
app: yc-apps
template:
metadata:
labels:
app: yc-apps
spec:
terminationGracePeriodSeconds: 180
containers:
- name: yc-server
image: ycrash/ycrash:latest
imagePullPolicy: Always
args:
- "-Xms2g"
- "-Xmx4g"
- "-Xss40m"
- "-verbose:gc"
- "-Xlog:gc*:file=/opt/workspace/yc/logs/yc-gclog-%p.gc:time,uptime,level,tags"
- "-XX:+UnlockDiagnosticVMOptions"
- "-XX:+HeapDumpOnOutOfMemoryError"
- "-XX:HeapDumpPath=/opt/workspace/yc/logs/ba-heapdump-%p.hprof"
- "-XX:ErrorFile=/opt/workspace/yc/logs/ba-log-hs_err_pid-%p.log"
- "-Duser.language=en"
- "-Duser.country=en_US"
- "-Djava.awt.headless=true"
- "-DhprofStrictnessWarning=true"
- "-DonlyTroubleshootingReport=true"
- "-Dapp=yc"
- "-DlogDir=/opt/workspace/yc/logs"
- "-DuploadDir=/opt/workspace/yc/uploads"
- "-jar"
- "webapp-runner.jar"
- "-AconnectionTimeout=3600000"
- "--secure-error-report-valve"
- "--port"
- "8080"
- "yc.war"
ports:
- containerPort: 9010
resources:
requests:
memory: 2Gi
cpu: "200m"
limits:
memory: 4Gi
cpu: "500m"
volumeMounts:
- name: ycrash-server-license
mountPath: "/opt/workspace/yc/uploads/license.lic"
subPath: license.lic
- name: logs-pvc
mountPath: "/opt/workspace/yc/logs"
- name: uploads-pvc
mountPath: "/opt/workspace/yc/uploads"
- name: tmp
mountPath: "/tmp"
volumes:
- name: ycrash-server-license
secret:
secretName: ycrash-server-license
items:
- key: license.lic
path: license.lic
- name: logs-pvc
persistentVolumeClaim:
claimName: logs-pvc
- name: uploads-pvc
persistentVolumeClaim:
claimName: uploads-pvc
- name: tmp
emptyDir: {}
---
# Service for yc-server
apiVersion: v1
kind: Service
metadata:
name: yc-server-service
labels:
app: yc-apps
namespace: yc-apps
spec:
selector:
app: yc-apps
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: LoadBalancer
---
# Route for yc-server
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: yc-server-route
namespace: yc-apps
spec:
host: yc-server-app.local
to:
kind: Service
name: yc-server-service
port:
targetPort: 8080
tls:
termination: edge
wildcardPolicy: None
---
# PersistentVolumeClaim for Logs
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: logs-pvc
namespace: yc-apps
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
---
# PersistentVolumeClaim for uploads
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: uploads-pvc
namespace: yc-apps
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172