From 8d602e72cd21544a1d07223a4090928b54565ce3 Mon Sep 17 00:00:00 2001 From: liaozan <378024053@qq.com> Date: Mon, 31 Jul 2023 00:13:48 +0800 Subject: [PATCH] Polish --- Dockerfile | 4 ++-- k8s-deploy-template.yaml | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7a130b..ea10920 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,8 @@ ENV EXT_JVM_OPTS="${JAVA_OPTS}" ENV JVM_OPTS="-javaagent:/opt/skywalking-agent/skywalking-agent.jar=agent.service_name=${APP_NAME},collector.backend_service=skywalking-oap-server.devops:11800\ -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false\ - -XX:MaxRAMPercentage=60 -XX:MaxMetaspaceSize=256m -XX:NativeMemoryTracking=summary\ - -XX:+UseG1GC -XX:+UseStringDeduplication -XX:G1HeapRegionSize=8m -Xlog:gc*:/data/logs/gc/gc-%t.log:time,uptime\ + -XX:MaxRAMPercentage=60 -XX:MaxMetaspaceSize=256m\ + -XX:+UseG1GC -XX:+UseStringDeduplication -XX:G1HeapRegionSize=4m -Xlog:gc*:/data/logs/gc/gc-%t.log:time,uptime:filecount=50\ -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/heapdump/heapdump.hprof -XX:OnOutOfMemoryError=/app/dump-file-rollover.sh\ -XX:-OmitStackTraceInFastThrow -XX:+PrintCommandLineFlags" diff --git a/k8s-deploy-template.yaml b/k8s-deploy-template.yaml index abe1ecf..467c9a4 100644 --- a/k8s-deploy-template.yaml +++ b/k8s-deploy-template.yaml @@ -25,13 +25,6 @@ spec: values: - ${NODE_TAG} terminationGracePeriodSeconds: 20 - initContainers: - - name: ${APP_NAME}-init - image: registry-vpc.cn-hangzhou.aliyuncs.com/acs/busybox - command: [ 'mkdir', '-p', '/data/logs/gc', '/data/heapdump' ] - volumeMounts: - - name: ${APP_NAME}-volume - mountPath: /data containers: - name: ${APP_NAME} image: ${IMAGE} @@ -48,6 +41,10 @@ spec: - name: actuator containerPort: 1024 protocol: TCP + lifecycle: + postStart: + exec: + command: [ 'mkdir', '-p', '/data/logs/gc', '/data/heapdump' ] startupProbe: httpGet: scheme: HTTP -- GitLab