diff --git a/Dockerfile b/Dockerfile index f26137de238c5dd364f09c70cfd585fd7d7600dc..87fe0851911be0834fb3ae0c82e6483c5f6bfae0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ diff --git a/k8s-deploy-template.yaml b/k8s-deploy-template.yaml index e57729c8995025f6c32836a719ecaa7b285cd0e2..34c14afad23f81727045623be6c3e2163ce56d90 100644 --- a/k8s-deploy-template.yaml +++ b/k8s-deploy-template.yaml @@ -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