Skip to content

Commit

Permalink
feat: allow configuration of resource limits
Browse files Browse the repository at this point in the history
More reasonable default memory limits are also configured.

Signed-off-by: Davide Madrisan <[email protected]>
  • Loading branch information
madrisan committed Apr 8, 2024
1 parent bbf86f3 commit 536d882
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 30 deletions.
6 changes: 3 additions & 3 deletions templates/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ spec:
httpGet:
path: /health
port: http
{{- with .Values.api.resources }}
resources:
requests:
memory: {{ .Values.api.resources.memory }}
cpu: {{ .Values.api.resources.cpu }}
{{- toYaml . | nindent 12}}
{{- end }}
{{ if not .Values.global.s3.enabled }}
volumeMounts:
- mountPath: /app/storage
Expand Down
6 changes: 3 additions & 3 deletions templates/clock-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ spec:
{{ end }}
image: getlago/api:v{{ .Values.version }}
name: {{ .Release.Name }}-clock
{{- with .Values.clock.resources }}
resources:
requests:
memory: {{ .Values.clock.resources.memory }}
cpu: {{ .Values.clock.resources.cpu }}
{{- toYaml . | nindent 12}}
{{- end }}
restartPolicy: Always
serviceAccountName: {{ .Values.global.serviceAccountName | default (printf "%s-serviceaccount" .Release.Name) }}
6 changes: 3 additions & 3 deletions templates/events-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ spec:
{{ end }}
image: getlago/api:v{{ .Values.version }}
name: {{ .Release.Name }}-events-worker
{{- with .Values.eventsWorker.resources }}
resources:
requests:
memory: {{ .Values.eventsWorker.resources.memory }}
cpu: {{ .Values.eventsWorker.resources.cpu }}
{{- toYaml . | nindent 12}}
{{- end }}
livenessProbe:
exec:
command: ["/bin/bash", "-l", "-c", "bundle exec sidekiqmon processes | grep $(hostname) || exit 1"]
Expand Down
6 changes: 3 additions & 3 deletions templates/front-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ spec:
ports:
- containerPort: 80
protocol: TCP
{{- with .Values.front.resources }}
resources:
requests:
memory: {{ .Values.front.resources.memory }}
cpu: {{ .Values.front.resources.cpu }}
{{- toYaml . | nindent 12}}
{{- end }}
restartPolicy: Always
6 changes: 3 additions & 3 deletions templates/pdf-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
ports:
- containerPort: 3000
protocol: TCP
{{- with .Values.pdf.resources }}
resources:
requests:
memory: {{ .Values.pdf.resources.memory }}
cpu: {{ .Values.pdf.resources.cpu }}
{{- toYaml . | nindent 12}}
{{- end }}
restartPolicy: Always
6 changes: 3 additions & 3 deletions templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ spec:
livenessProbe:
exec:
command: ["/bin/bash", "-l", "-c", "bundle exec sidekiqmon processes | grep $(hostname) || exit 1"]
{{- with .Values.worker.resources }}
resources:
requests:
memory: {{ .Values.worker.resources.memory }}
cpu: {{ .Values.worker.resources.cpu }}
{{- toYaml . | nindent 12}}
{{- end }}
{{ if not .Values.global.s3.enabled }}
volumeMounts:
- mountPath: /app/storage
Expand Down
31 changes: 19 additions & 12 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ front:
service:
port: 80
resources:
memory: 512
cpu: "200m"
requests:
memory: 512Mi
cpu: "200m"
podAnnotations: {}
podLabels: {}

Expand All @@ -116,8 +117,9 @@ api:
sidekiqWeb:
enabled: true
resources:
memory: 1024
cpu: "1000m"
requests:
memory: 1Gi
cpu: "1000m"
volumes:
storage: "10Gi"
podAnnotations: {}
Expand All @@ -131,8 +133,9 @@ worker:
logStdout: true
logLevel: error
resources:
memory: 1024
cpu: "1000m"
requests:
memory: 1Gi
cpu: "1000m"
podAnnotations: {}
podLabels: {}

Expand All @@ -144,8 +147,9 @@ eventsWorker:
logStdout: true
logLevel: error
resources:
memory: 1024
cpu: "1000m"
requests:
memory: 1Gi
cpu: "1000m"
podAnnotations: {}
podLabels: {}

Expand All @@ -156,8 +160,9 @@ clock:
logStdout: true
logLevel: info
resources:
memory: 256
cpu: "100m"
requests:
memory: 256Mi
cpu: "100m"
podAnnotations: {}
podLabels: {}

Expand All @@ -166,12 +171,14 @@ pdf:
service:
port: 3001
resources:
memory: 2048
cpu: "1000m"
requests:
memory: 2Gi
cpu: "1000m"
podAnnotations: {}
podLabels: {}

job:
migrate:
podAnnotations: {}
podLabels: {}
resources: {}

0 comments on commit 536d882

Please sign in to comment.