From a53052fe402fa9802b1cf0b1532be64a5d4bb13d Mon Sep 17 00:00:00 2001 From: dragonslayer27 Date: Mon, 7 Mar 2022 14:08:54 -0500 Subject: [PATCH] Provide different JVM configs for co-ordinator and workers Provide different JVM configs for co-ordinator and workers --- charts/trino/README.md | 5 ---- charts/trino/ci/custom-values.yaml | 19 ++++++++++++++ .../templates/configmap-coordinator.yaml | 8 +++--- charts/trino/templates/configmap-worker.yaml | 8 +++--- .../templates/deployment-coordinator.yaml | 2 +- charts/trino/templates/deployment-worker.yaml | 2 +- charts/trino/values-coordinator.yaml | 25 +++++++++++++++++++ charts/trino/values-worker.yaml | 25 +++++++++++++++++++ charts/trino/values.yaml | 20 --------------- 9 files changed, 79 insertions(+), 35 deletions(-) create mode 100644 charts/trino/ci/custom-values.yaml create mode 100644 charts/trino/values-coordinator.yaml create mode 100644 charts/trino/values-worker.yaml diff --git a/charts/trino/README.md b/charts/trino/README.md index fc51911a..732253ce 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -31,14 +31,10 @@ The following table lists the configurable parameters of the Trino chart and the | `server.exchangeManager.baseDir` | | `"/tmp/trino-local-file-system-exchange-manager"` | | `server.workerExtraConfig` | | `""` | | `server.coordinatorExtraConfig` | | `""` | -| `server.jvm.maxHeapSize` | | `"8G"` | -| `server.jvm.gcMethod.type` | | `"UseG1GC"` | -| `server.jvm.gcMethod.g1.heapRegionSize` | | `"32M"` | | `server.autoscaling.enabled` | | `false` | | `server.autoscaling.maxReplicas` | | `5` | | `server.autoscaling.targetCPUUtilizationPercentage` | | `50` | | `additionalNodeProperties` | | `{}` | -| `additionalJVMConfig` | | `{}` | | `additionalConfigProperties` | | `{}` | | `additionalLogProperties` | | `{}` | | `additionalExchangeManagerProperties` | | `{}` | @@ -49,7 +45,6 @@ The following table lists the configurable parameters of the Trino chart and the | `securityContext.runAsGroup` | | `1000` | | `service.type` | | `"ClusterIP"` | | `service.port` | | `8080` | -| `resources` | | `{}` | | `nodeSelector` | | `{}` | | `tolerations` | | `[]` | | `affinity` | | `{}` | diff --git a/charts/trino/ci/custom-values.yaml b/charts/trino/ci/custom-values.yaml new file mode 100644 index 00000000..2a83c54a --- /dev/null +++ b/charts/trino/ci/custom-values.yaml @@ -0,0 +1,19 @@ +# All custom values belong here during testing. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +coordinator: + jvm: + maxHeapSize: "8G" + gcMethod: + type: "UseG1GC" + g1: + heapRegionSize: "32M" + +worker: + jvm: + maxHeapSize: "8G" + gcMethod: + type: "UseG1GC" + g1: + heapRegionSize: "32M" diff --git a/charts/trino/templates/configmap-coordinator.yaml b/charts/trino/templates/configmap-coordinator.yaml index b23971ab..b421d2ec 100644 --- a/charts/trino/templates/configmap-coordinator.yaml +++ b/charts/trino/templates/configmap-coordinator.yaml @@ -19,9 +19,9 @@ data: jvm.config: | -server - -Xmx{{ .Values.server.jvm.maxHeapSize }} - -XX:+{{ .Values.server.jvm.gcMethod.type }} - -XX:G1HeapRegionSize={{ .Values.server.jvm.gcMethod.g1.heapRegionSize }} + -Xmx{{ .Values.coordinator.jvm.maxHeapSize }} + -XX:+{{ .Values.coordinator.jvm.gcMethod.type }} + -XX:G1HeapRegionSize={{ .Values.coordinator.jvm.gcMethod.g1.heapRegionSize }} -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError @@ -32,7 +32,7 @@ data: -XX:PerMethodRecompilationCutoff=10000 -XX:PerBytecodeRecompilationCutoff=10000 -Djdk.nio.maxCachedBufferSize=2000000 - {{- range $configValue := .Values.additionalJVMConfig }} + {{- range $configValue := .Values.coordinator.additionalJVMConfig }} {{ $configValue }} {{- end }} diff --git a/charts/trino/templates/configmap-worker.yaml b/charts/trino/templates/configmap-worker.yaml index e095c740..7b56b34d 100644 --- a/charts/trino/templates/configmap-worker.yaml +++ b/charts/trino/templates/configmap-worker.yaml @@ -20,9 +20,9 @@ data: jvm.config: | -server - -Xmx{{ .Values.server.jvm.maxHeapSize }} - -XX:+{{ .Values.server.jvm.gcMethod.type }} - -XX:G1HeapRegionSize={{ .Values.server.jvm.gcMethod.g1.heapRegionSize }} + -Xmx{{ .Values.worker.jvm.maxHeapSize }} + -XX:+{{ .Values.worker.jvm.gcMethod.type }} + -XX:G1HeapRegionSize={{ .Values.worker.jvm.gcMethod.g1.heapRegionSize }} -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError @@ -33,7 +33,7 @@ data: -XX:PerMethodRecompilationCutoff=10000 -XX:PerBytecodeRecompilationCutoff=10000 -Djdk.nio.maxCachedBufferSize=2000000 - {{- range $configValue := .Values.additionalJVMConfig }} + {{- range $configValue := .Values.worker.additionalJVMConfig }} {{ $configValue }} {{- end }} diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 56b05f71..62e1aad3 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -73,7 +73,7 @@ spec: path: /v1/info port: http resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.coordinator.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/trino/templates/deployment-worker.yaml b/charts/trino/templates/deployment-worker.yaml index 151190da..341d57a1 100644 --- a/charts/trino/templates/deployment-worker.yaml +++ b/charts/trino/templates/deployment-worker.yaml @@ -61,7 +61,7 @@ spec: path: /v1/info port: http resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.worker.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/trino/values-coordinator.yaml b/charts/trino/values-coordinator.yaml new file mode 100644 index 00000000..a221fac9 --- /dev/null +++ b/charts/trino/values-coordinator.yaml @@ -0,0 +1,25 @@ +# Default values for trino coordinator. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +coordinator: + jvm: + maxHeapSize: "8G" + gcMethod: + type: "UseG1GC" + g1: + heapRegionSize: "32M" + + additionalJVMConfig: {} + + resources: {} + # We usually recommend 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, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi \ No newline at end of file diff --git a/charts/trino/values-worker.yaml b/charts/trino/values-worker.yaml new file mode 100644 index 00000000..4eaf0f5a --- /dev/null +++ b/charts/trino/values-worker.yaml @@ -0,0 +1,25 @@ +# Default values for trino worker. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +worker: + jvm: + maxHeapSize: "8G" + gcMethod: + type: "UseG1GC" + g1: + heapRegionSize: "32M" + + additionalJVMConfig: {} + + resources: {} + # We usually recommend 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, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi \ No newline at end of file diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index c6a0818b..896d8a81 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -36,12 +36,6 @@ server: baseDir: "/tmp/trino-local-file-system-exchange-manager" workerExtraConfig: "" coordinatorExtraConfig: "" - jvm: - maxHeapSize: "8G" - gcMethod: - type: "UseG1GC" - g1: - heapRegionSize: "32M" autoscaling: enabled: false maxReplicas: 5 @@ -49,8 +43,6 @@ server: additionalNodeProperties: {} -additionalJVMConfig: {} - additionalConfigProperties: {} additionalLogProperties: {} @@ -81,18 +73,6 @@ service: type: ClusterIP port: 8080 -resources: {} - # We usually recommend 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, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - nodeSelector: {} tolerations: []