Skip to content

Commit

Permalink
Add GOMEMLIMIT by default, allow user to configure additional env var…
Browse files Browse the repository at this point in the history
…iables on the deployment

Signed-off-by: Rafael da Fonseca <[email protected]>
  • Loading branch information
rsafonseca committed Feb 7, 2025
1 parent 13c3f6f commit 247b323
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/reports-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ helm install reports-server --namespace reports-server --create-namespace report
| serviceAccount.name | string | `""` | Service account name (required if `serviceAccount.create` is `false`) |
| podAnnotations | object | `{}` | Pod annotations |
| podSecurityContext | object | `{"fsGroup":2000}` | Pod security context |
| podEnv | object | `{}` | Provide additional environment variables to the pods. Map with the same format as kubernetes deployment spec's env. |
| securityContext | object | See [values.yaml](values.yaml) | Container security context |
| livenessProbe | object | `{"failureThreshold":10,"httpGet":{"path":"/livez","port":"https","scheme":"HTTPS"},"initialDelaySeconds":20,"periodSeconds":10}` | Liveness probe |
| readinessProbe | object | `{"failureThreshold":10,"httpGet":{"path":"/readyz","port":"https","scheme":"HTTPS"},"initialDelaySeconds":30,"periodSeconds":10}` | Readiness probe |
Expand Down
4 changes: 4 additions & 0 deletions charts/reports-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $env := .Values.podEnv }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -65,6 +66,9 @@ spec:
resourceFieldRef:
resource: limits.memory
divisor: '1'
{{- with $env }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.config.db.secretName }}
- name: DB_HOST
valueFrom:
Expand Down
3 changes: 3 additions & 0 deletions charts/reports-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ podAnnotations: {}
podSecurityContext:
fsGroup: 2000

# -- Provide additional environment variables to the pods. Map with the same format as kubernetes deployment spec's env.
podEnv: {}

# -- Container security context
# @default -- See [values.yaml](values.yaml)
securityContext:
Expand Down
6 changes: 6 additions & 0 deletions config/install-etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ spec:
- --cert-dir=/tmp
- --secure-port=4443
- --authorization-always-allow-paths=/metrics
env:
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: '1'
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down
6 changes: 6 additions & 0 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ spec:
- --cert-dir=/tmp
- --secure-port=4443
- --authorization-always-allow-paths=/metrics
env:
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: '1'
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down

0 comments on commit 247b323

Please sign in to comment.