diff --git a/Dockerfile b/Dockerfile index c7a130b7d1a36e7360a68140ca2581f18f8e4b3f..ea109205b8aa5175d00c69ccd0f5370836fa8ea1 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 abe1ecf17bfd268ba13e22b8a599f5c3b1da61d9..467c9a40fa0cc314833bfbb469137c0f984dca40 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