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/ ./ ...@@ -12,7 +12,7 @@ COPY --from=builder app/application/ ./
RUN mkdir -p /data/logs 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:+UseG1GC -Xlog:gc*:/data/logs/gc.log:time,uptime \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/heapdump.hprof \ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/heapdump.hprof \
-XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags \ -XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags \
......
...@@ -25,6 +25,13 @@ spec: ...@@ -25,6 +25,13 @@ spec:
values: values:
- ${NODE_POOL_ID} - ${NODE_POOL_ID}
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
initContainers:
- name: ${APP_NAME}-init
image: busybox
command: [ 'mkdir', '-p', "/data/logs" ]
volumeMounts:
- name: ${APP_NAME}-volume
mountPath: /data
containers: containers:
- name: ${APP_NAME} - name: ${APP_NAME}
image: ${IMAGE} image: ${IMAGE}
...@@ -64,9 +71,9 @@ spec: ...@@ -64,9 +71,9 @@ spec:
periodSeconds: 10 periodSeconds: 10
volumeMounts: volumeMounts:
- name: ${APP_NAME}-volume - name: ${APP_NAME}-volume
mountPath: / mountPath: /data
volumes: volumes:
name: ${APP_NAME}-volume - name: ${APP_NAME}-volume
hostPath: hostPath:
path: /data/share/pod/data/${APP_NAME} path: /share/pod/data/${APP_NAME}
type: DirectoryOrCreate type: DirectoryOrCreate
\ No newline at end of file \ 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