添加CPU内存资源限制,防止服务部署异常

This commit is contained in:
王皓昱
2021-05-15 14:27:21 +08:00
parent 75379d81ef
commit d8259d3e8e

View File

@ -53,6 +53,13 @@ spec:
# 需要暴露的端口库号列表
ports:
- containerPort: 18012
resources:
requests:
cpu: 2000m
memory: 4Gi
limits:
cpu: 4000m
memory: 8Gi
# 容器运行前需设置的环境变量列表
env:
# Apollo 配置中心变量设置
@ -62,6 +69,13 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: JAVA_TOOL_OPTIONS
value: -XX:+UnlockExperimentalVMOptions
-XX:+UseContainerSupport
-XX:+UseCGroupMemoryLimitForHeap
-XX:InitialRAMPercentage=40.0
-XX:MinRAMPercentage=20.0
-XX:MaxRAMPercentage=80.0
---
kind: Service
apiVersion: v1