From a8e466d9dd5d17841a6e0cc80235b129bbeac8f1 Mon Sep 17 00:00:00 2001 From: Filipe Souza Date: Thu, 25 Jan 2024 01:30:21 -0300 Subject: [PATCH] - Added limits for the server container spec; --- chart/VALUES_SUMMARY.md | 1 + chart/templates/deployments.yaml | 4 ++++ chart/values.yaml | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/chart/VALUES_SUMMARY.md b/chart/VALUES_SUMMARY.md index ef8ad5b..7304d20 100644 --- a/chart/VALUES_SUMMARY.md +++ b/chart/VALUES_SUMMARY.md @@ -44,6 +44,7 @@ This chart can provide an rAthena emulator installation on a Kubernetes cluster. | server.ports[0] | dict | `{"containerPort":8211,"name":"game","protocol":"UDP"}` | The "game" port definition. If you change this, make sure to change the service.ports.game and server.config accordingly. | | server.ports[1] | dict | `{"containerPort":27015,"name":"query","protocol":"UDP"}` | The "query" port definition . If you change this, make sure to change the service.ports.query_port and server.config accordingly. | | server.ports[2] | dict | `{"containerPort":25575,"name":"rcon","protocol":"UDP"}` | The "rcon" port definition . If you change this, make sure to change the service.ports.rcon and server.config accordingly. | +| server.resources | dict | `{"limits":{"cpu":4,"memory":"12Gi"},"requests":{"cpu":4,"memory":"8Gi"}}` | Resources limits for the container. | | server.service | dict | | Change the service configuration. If you change those, make sure to change the server.config and server.ports accordingly. | | server.service.annotations | object | `{}` | Additional annotations to the resources | | server.service.enabled | bool | `true` | Enables the creation of the service component. | diff --git a/chart/templates/deployments.yaml b/chart/templates/deployments.yaml index 105909b..73e9789 100644 --- a/chart/templates/deployments.yaml +++ b/chart/templates/deployments.yaml @@ -36,6 +36,10 @@ spec: - name: server image: "{{ .Values.server.image.name }}:{{ .Values.server.image.tag }}" imagePullPolicy: {{ .Values.server.image.imagePullPolicy }} + resources: + {{- with .Values.server.resources }} + {{- toYaml . | nindent 12 }} + {{- end }} ports: {{- with .Values.server.ports }} {{- toYaml . | nindent 12 }} diff --git a/chart/values.yaml b/chart/values.yaml index e72af11..5d78652 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -7,6 +7,14 @@ server: annotations: { } # -- Additional labels to the resources labels: { } + # -- (dict) Resources limits for the container. + resources: + limits: + cpu: 4 + memory: "12Gi" + requests: + cpu: 4 + memory: "8Gi" # -- (dict) Define some parameters for the storage volume storage: # -- (bool) Define if it will use an existing PVC containing the installation data.