Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-prometheus-stack] allow setting GOGC env configure #4058

2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 55.3.1
version: 55.4.0
appVersion: v0.70.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ spec:
- containerPort: 8080
name: http
{{- end }}
env:
{{- range $key, $value := .Values.prometheusOperator.env }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
resources:
{{ toYaml .Values.prometheusOperator.resources | indent 12 }}
securityContext:
Expand Down
6 changes: 6 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,12 @@ prometheusOperator:
# cpu: 100m
# memory: 100Mi

## Operator Environment
## env:
## VARIABLE: value
env:
GOGC: "30"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you setting it to 30 when 100 is the default ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the PR you linked, makes a lot of sense now :D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latter. My observation is that the memory usage increases a lot initially when the operator populates its local cache but it's transient because most of the data is discarded by the transform func and reclaiming more aggressively than the default is beneficial in this case.

From the discussion between @philipgough and @simonpasquier. ref: https://github.com/prometheus-operator/prometheus-operator/pull/5993/files/2c67ca6fc45549a588bd39d362b9bad167b0c025#r1393911325

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution @dongjiang1989 :)


# Required for use in managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico),
# because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working
##
Expand Down