Skip to content

Commit

Permalink
controller/extensions: Add explicit requests/limits for ephemeral sto…
Browse files Browse the repository at this point in the history
…rage

On Autopilot, ephemeral storage defaults to a request/limit of 1GiB,
but on Agones we assume there's no ephemeral storage limit. The
default persistent log limit is 10GB.

In this PR, we adds a default resources.{limits,requests} block to the
controller if the user has not already specified `resources` and set
it to the persistent log maximum plus a fudge factor of 100MB to allow
for the certs and some overhead. By default this comes out to 10100MB,
which slides under the Autopilot 10GiB limit by virtue of GiB/MB
differences.

Towards googleforgames#2777
  • Loading branch information
zmerlynn committed Jan 19, 2023
1 parent 35e899d commit 46ce09a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion install/helm/agones/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,14 @@ spec:
periodSeconds: {{ .Values.agones.controller.healthCheck.periodSeconds }}
failureThreshold: {{ .Values.agones.controller.healthCheck.failureThreshold }}
timeoutSeconds: {{ .Values.agones.controller.healthCheck.timeoutSeconds }}
{{- if .Values.agones.controller.resources }}
resources:
{{- if .Values.agones.controller.resources }}
{{ toYaml .Values.agones.controller.resources | indent 10 }}
{{- else}}
limits:
ephemeral-storage: {{ add .Values.agones.controller.persistentLogsSizeLimitMB 100 | printf "%dMi" }}
requests:
ephemeral-storage: {{ add .Values.agones.controller.persistentLogsSizeLimitMB 100 | printf "%dMi" }}
{{- end }}
volumeMounts:
- name: certs
Expand Down
7 changes: 6 additions & 1 deletion install/helm/agones/templates/extensions-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,14 @@ spec:
periodSeconds: {{ .Values.agones.controller.healthCheck.periodSeconds }}
failureThreshold: {{ .Values.agones.controller.healthCheck.failureThreshold }}
timeoutSeconds: {{ .Values.agones.controller.healthCheck.timeoutSeconds }}
{{- if .Values.agones.controller.resources }}
resources:
{{- if .Values.agones.controller.resources }}
{{ toYaml .Values.agones.controller.resources | indent 10 }}
{{- else}}
limits:
ephemeral-storage: {{ add .Values.agones.controller.persistentLogsSizeLimitMB 100 | printf "%dMi" }}
requests:
ephemeral-storage: {{ add .Values.agones.controller.persistentLogsSizeLimitMB 100 | printf "%dMi" }}
{{- end }}
volumeMounts:
- name: certs
Expand Down
5 changes: 5 additions & 0 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15634,6 +15634,11 @@ spec:
periodSeconds: 3
failureThreshold: 3
timeoutSeconds: 1
resources:
limits:
ephemeral-storage: 10100Mi
requests:
ephemeral-storage: 10100Mi
volumeMounts:
- name: certs
mountPath: /home/agones/certs
Expand Down

0 comments on commit 46ce09a

Please sign in to comment.