From 8da38d9ddc9eb61d3890c9a1e59e80cae82368cd Mon Sep 17 00:00:00 2001 From: Rotem Adhoh Date: Thu, 15 Aug 2024 13:44:16 -0400 Subject: [PATCH] Feature: allows to set resources for the JMX Exporter container. Resolves #202 --- charts/trino/README.md | 12 ++++++++++++ .../trino/templates/deployment-coordinator.yaml | 2 ++ charts/trino/values.yaml | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/charts/trino/README.md b/charts/trino/README.md index 0ff34d21..86d9c99a 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -664,6 +664,18 @@ Fast distributed SQL query engine for big data analytics that helps you explore help: 'ThreadCount (java.lang<>ThreadCount)' type: UNTYPED * `jmx.exporter.securityContext` - object, default: `{}` +* `jmx.exporter.resources` - object, default: `{}` + + It is recommended not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, use the following example, and adjust it as necessary. + Example: + ```yaml + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + ``` * `serviceMonitor.enabled` - bool, default: `false` Set to true to create resources for the [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator). diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 2c345e4a..7cf4976c 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -215,6 +215,8 @@ spec: volumeMounts: - mountPath: /etc/jmx-exporter/ name: jmx-exporter-config-volume + resources: + {{- toYaml .Values.jmx.exporter.resources | nindent 12 }} {{- end }} {{- if .Values.sidecarContainers.coordinator }} {{- toYaml .Values.sidecarContainers.coordinator | nindent 8 }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 3f2cff12..74c742d5 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -786,6 +786,22 @@ jmx: # value: '$2' # help: 'ThreadCount (java.lang<>ThreadCount)' # type: UNTYPED + resources: {} + # jmx.exporter.resources -- It is recommended not to specify default resources + # and to leave this as a conscious choice for the user. This also increases + # chances charts run on environments with little resources, such as Minikube. + # If you do want to specify resources, use the following example, and adjust + # it as necessary. + # @raw + # Example: + # ```yaml + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + # ``` serviceMonitor: # serviceMonitor.enabled -- Set to true to create resources for the [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator).