Commit 6c628cf0 authored by liaozan's avatar liaozan 🏀

Add initContainers to make the required folder used for Jvm gc log

parent e55402c1
......@@ -12,7 +12,7 @@ COPY --from=builder app/application/ ./
RUN mkdir -p /data/logs
ENV JVM_OPTS='-XX:MaxRAMPercentage=90 -XX:+AlwaysPreTouch \
ENV JVM_OPTS='-XX:MaxRAMPercentage=80 -XX:+AlwaysPreTouch \
-XX:+UseG1GC -Xlog:gc*:/data/logs/gc.log:time,uptime \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/heapdump.hprof \
-XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags \
......
......@@ -25,6 +25,13 @@ spec:
values:
- ${NODE_POOL_ID}
terminationGracePeriodSeconds: 30
initContainers:
- name: ${APP_NAME}-init
image: busybox
command: [ 'mkdir', '-p', "/data/logs" ]
volumeMounts:
- name: ${APP_NAME}-volume
mountPath: /data
containers:
- name: ${APP_NAME}
image: ${IMAGE}
......@@ -64,9 +71,9 @@ spec:
periodSeconds: 10
volumeMounts:
- name: ${APP_NAME}-volume
mountPath: /
mountPath: /data
volumes:
name: ${APP_NAME}-volume
hostPath:
path: /data/share/pod/data/${APP_NAME}
type: DirectoryOrCreate
\ No newline at end of file
- name: ${APP_NAME}-volume
hostPath:
path: /share/pod/data/${APP_NAME}
type: DirectoryOrCreate
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment