fix: align GOMEMLIMIT with pod memory limits and force fresh image pulls
Go's GC doesn't respect cgroup memory limits on its own, risking OOMKill under load; set GOMEMLIMIT to ~90% of each deployment's resources.limits.memory. Also switch imagePullPolicy to Always so :latest tags aren't served stale from node-local cache after a new push.
This commit is contained in:
@@ -22,6 +22,9 @@ spec:
|
|||||||
containerPort: {{ .Values.grpcPort }}
|
containerPort: {{ .Values.grpcPort }}
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.httpPort }}
|
containerPort: {{ .Values.httpPort }}
|
||||||
|
env:
|
||||||
|
- name: GOMEMLIMIT
|
||||||
|
value: {{ .Values.goMemLimit | quote }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: management-service-config
|
name: management-service-config
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ replicaCount: 2
|
|||||||
image:
|
image:
|
||||||
repository: forgejo.riotpiao.homelab.com/rock/kafka-management-service
|
repository: forgejo.riotpiao.homelab.com/rock/kafka-management-service
|
||||||
tag: latest
|
tag: latest
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: Always
|
||||||
|
|
||||||
grpcPort: 9090
|
grpcPort: 9090
|
||||||
httpPort: 8080
|
httpPort: 8080
|
||||||
@@ -23,6 +23,12 @@ resources:
|
|||||||
cpu: "1"
|
cpu: "1"
|
||||||
memory: 512Mi
|
memory: 512Mi
|
||||||
|
|
||||||
|
# Go's GC only reacts to GOGC by default and has no idea about the cgroup
|
||||||
|
# memory limit above -- it'll happily grow heap until the kernel OOMKills it.
|
||||||
|
# Setting GOMEMLIMIT to ~90% of the container limit makes the GC self-throttle
|
||||||
|
# before that happens. Keep this in sync with resources.limits.memory.
|
||||||
|
goMemLimit: "460MiB"
|
||||||
|
|
||||||
hpa:
|
hpa:
|
||||||
enabled: true
|
enabled: true
|
||||||
minReplicas: 2
|
minReplicas: 2
|
||||||
|
|||||||
@@ -23,5 +23,7 @@ spec:
|
|||||||
value: {{ .Values.kafkaBrokers | quote }}
|
value: {{ .Values.kafkaBrokers | quote }}
|
||||||
- name: KMSVC_REDIS_ADDR
|
- name: KMSVC_REDIS_ADDR
|
||||||
value: {{ .Values.redisAddr | quote }}
|
value: {{ .Values.redisAddr | quote }}
|
||||||
|
- name: GOMEMLIMIT
|
||||||
|
value: {{ .Values.goMemLimit | quote }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ namespace: sqs
|
|||||||
image:
|
image:
|
||||||
repository: forgejo.riotpiao.homelab.com/rock/kafka-management-service-queue-operator
|
repository: forgejo.riotpiao.homelab.com/rock/kafka-management-service-queue-operator
|
||||||
tag: latest
|
tag: latest
|
||||||
pullPolicy: IfNotPresent
|
pullPolicy: Always
|
||||||
|
|
||||||
kafkaBrokers: "kmsvc-kafka-bootstrap.sqs.svc.cluster.local:9092"
|
kafkaBrokers: "kmsvc-kafka-bootstrap.sqs.svc.cluster.local:9092"
|
||||||
redisAddr: "kmsvc-redis-master.sqs.svc.cluster.local:6379"
|
redisAddr: "kmsvc-redis-master.sqs.svc.cluster.local:6379"
|
||||||
@@ -15,3 +15,6 @@ resources:
|
|||||||
limits:
|
limits:
|
||||||
cpu: 500m
|
cpu: 500m
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
|
|
||||||
|
# See management-service/values.yaml's goMemLimit comment -- same reasoning.
|
||||||
|
goMemLimit: "230MiB"
|
||||||
|
|||||||
Reference in New Issue
Block a user