Add resources specification to fm-rest-api

Some pods are being evicted due to some containers
exceeding the usage of a specific resource. The goal
of this change is to be able to specify values of
limits and requests for fm-rest-api pods. In this
way we can make sure that the system has the necessary
resources to support the api.

Test Plan:

PASS: Check that with the 'enabled' flag set to 'false' no
      values of requests and limits are specified.
PASS: Check that with the 'enabled' flag set to 'true' the
      default values of requests and limits takes place.
PASS: Override the default value of requests/limits and set the
      'enabled' flag to 'true' and check that the new value
      takes place in the description of the pod.

Partial-bug: 1970645

Signed-off-by: Rafael Falcao <rafael.vieirafalcao@windriver.com>
Change-Id: I8a247c09643303f80a61b989d4b82c3835b7e601
This commit is contained in:
Rafael Falcão 2022-08-22 12:08:43 -03:00 committed by Rafael Vieira Falcão
parent 835f6c0285
commit b34b868801
2 changed files with 9 additions and 2 deletions

View File

@ -40,6 +40,7 @@ spec:
{{ tuple $envAll "fmapi" $mounts_fm_rest_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "fmapi" $mounts_fm_rest_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
- name: fm-rest-api - name: fm-rest-api
{{ tuple $envAll $envAll.Values.pod.resources.fm | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: RUNNING_IN_CONTAINER - name: RUNNING_IN_CONTAINER
value: "True" value: "True"
@ -74,8 +75,6 @@ spec:
- name: http - name: http
containerPort: 18003 containerPort: 18003
protocol: TCP protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
nodeSelector: nodeSelector:
{{ .Values.labels.fm_api.node_selector_key }}: {{ .Values.labels.fm_api.node_selector_value }} {{ .Values.labels.fm_api.node_selector_key }}: {{ .Values.labels.fm_api.node_selector_value }}
{{ if $envAll.Values.pod.tolerations.fm.enabled }} {{ if $envAll.Values.pod.tolerations.fm.enabled }}

View File

@ -326,6 +326,14 @@ pod:
fm: fm:
timeout: 30 timeout: 30
resources: resources:
enabled: false
fm:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
jobs: jobs:
ks_endpoints: ks_endpoints:
requests: requests: