From 278616ba6e0759f07e64a691bdfc6f5121608234 Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Wed, 18 Jan 2023 17:30:58 +0200 Subject: [PATCH 1/8] Add configuration for graceful shutdown timeout --- .github/workflows/test-charts.yml | 2 +- .../templates/_helpers_coordinator.tpl | 13 +++++++++++++ .../dremio_v2/templates/_helpers_executor.tpl | 19 +++++++++++++++++++ .../templates/dremio-coordinator.yaml | 8 +++++++- .../dremio_v2/templates/dremio-executor.yaml | 4 +++- charts/dremio_v2/templates/dremio-master.yaml | 4 +++- charts/dremio_v2/values.yaml | 5 +++++ 7 files changed, 51 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-charts.yml b/.github/workflows/test-charts.yml index 1b47b571..821784c7 100644 --- a/.github/workflows/test-charts.yml +++ b/.github/workflows/test-charts.yml @@ -34,7 +34,7 @@ jobs: fi - name: Run chart-testing (lint) - run: ct lint --target-branch ${{ github.event.repository.default_branch }} + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false - name: Create kind cluster uses: helm/kind-action@v1.4.0 diff --git a/charts/dremio_v2/templates/_helpers_coordinator.tpl b/charts/dremio_v2/templates/_helpers_coordinator.tpl index 81cd5d29..b9fd8a0c 100644 --- a/charts/dremio_v2/templates/_helpers_coordinator.tpl +++ b/charts/dremio_v2/templates/_helpers_coordinator.tpl @@ -150,4 +150,17 @@ Coordinator - Pod Tolerations tolerations: {{- toYaml $coordinatorTolerations | nindent 2 }} {{- end -}} +{{- end -}} + +{{/* +Coordinator - grace termination period Resource Request +*/}} +{{- define "dremio.coordinator.stopTimeoutPod" -}} +{{- $stopTimeout := $.Values.coordinator.stopTimeout -}} +{{- $stopTimeout -}} +{{- end -}} + +{{- define "dremio.coordinator.stopTimeoutDremio" -}} +{{- $stopTimeout := $.Values.coordinator.stopTimeout -}} +{{- sub $stopTimeout 10 -}} {{- end -}} \ No newline at end of file diff --git a/charts/dremio_v2/templates/_helpers_executor.tpl b/charts/dremio_v2/templates/_helpers_executor.tpl index 61ecc858..08e5f7eb 100644 --- a/charts/dremio_v2/templates/_helpers_executor.tpl +++ b/charts/dremio_v2/templates/_helpers_executor.tpl @@ -343,4 +343,23 @@ Executor - Pod Tolerations tolerations: {{- toYaml $engineTolerations | nindent 2 }} {{- end -}} +{{- end -}} + +{{/* +Executor - grace termination period Resource Request +*/}} +{{- define "dremio.executor.stopTimeoutPod" -}} +{{- $context := index . 0 -}} +{{- $engineName := index . 1 -}} +{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.stopTimeout) $engineName) -}} +{{- $stopTimeout := default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout -}} +{{- $stopTimeout -}} +{{- end -}} + +{{- define "dremio.executor.stopTimeoutDremio" -}} +{{- $context := index . 0 -}} +{{- $engineName := index . 1 -}} +{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.stopTimeout) $engineName) -}} +{{- $stopTimeout := default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout -}} +{{- sub $stopTimeout 10 -}} {{- end -}} \ No newline at end of file diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index 45a90774..3f14dc79 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -24,7 +24,7 @@ spec: {{- include "dremio.coordinator.podAnnotations" $ | nindent 8 }} spec: {{- include "dremio.coordinator.serviceAccount" $ | nindent 6 }} - terminationGracePeriodSeconds: 120 + terminationGracePeriodSeconds: {{ $.Values.coordinator.stopTimeout }} {{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }} {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: @@ -35,6 +35,10 @@ spec: requests: cpu: {{ $.Values.coordinator.cpu }} memory: {{ $.Values.coordinator.memory }}M + lifecycle: + preStop: + exec: + command: [ "/opt/dremio/bin/dremio stop" ] volumeMounts: - name: dremio-config mountPath: /opt/dremio/conf @@ -58,6 +62,8 @@ spec: fieldRef: fieldPath: status.podIP {{- end }} + - name: DREMIO_STOP_TIMEOUT + value: {{ $.Values.coordinator.stopTimeout }} - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index 8aafb63c..74c130fe 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -27,7 +27,7 @@ spec: {{- include "dremio.executor.podAnnotations" (list $ $engineName) | nindent 8}} spec: {{- include "dremio.executor.serviceAccount" (list $ $engineName) | nindent 6}} - terminationGracePeriodSeconds: 120 + terminationGracePeriodSeconds: {{- include "dremio.executor.stopTimeoutPod" -}} {{- include "dremio.executor.nodeSelector" (list $ $engineName) | nindent 6}} {{- include "dremio.executor.tolerations" (list $ $engineName) | nindent 6}} containers: @@ -60,6 +60,8 @@ spec: fieldRef: fieldPath: status.podIP {{- end }} + - name: DREMIO_STOP_TIMEOUT + value: {{- include "dremio.executor.stopTimeoutDremio" -}} - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.executor.heapMemory" (list $ $engineName) }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index af69f5b4..5658d497 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -33,7 +33,7 @@ spec: values: - dremio-coordinator topologyKey: "kubernetes.io/hostname" - terminationGracePeriodSeconds: 120 + terminationGracePeriodSeconds: {{- include "dremio.coordinator.stopTimeoutPod" -}} {{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }} {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: @@ -69,6 +69,8 @@ spec: fieldRef: fieldPath: status.podIP {{- end }} + - name: DREMIO_STOP_TIMEOUT + value: {{- include "dremio.coordinator.stopTimeoutDremio" -}} - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/values.yaml b/charts/dremio_v2/values.yaml index ce684a1b..3dc7a442 100644 --- a/charts/dremio_v2/values.yaml +++ b/charts/dremio_v2/values.yaml @@ -129,6 +129,8 @@ coordinator: # kubectl create secret tls ${TLS_SECRET_NAME} --key ${KEY_FILE} --cert ${CERT_FILE} secret: dremio-tls-secret-flight + #seconds + stopTimeout: 120 # Dremio Executor executor: # CPU & Memory @@ -203,6 +205,9 @@ executor: #nodeSelector: {} #tolerations: [] + #seconds + stopTimeout: 120 + # Engine Overrides # # The settings above are overridable on a per-engine basis. These From 7535ee82cf9d99718a48fdc03620bfc3b0fb8b30 Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 13:32:50 +0200 Subject: [PATCH 2/8] fix templates --- charts/dremio_v2/templates/dremio-coordinator.yaml | 4 ++-- charts/dremio_v2/templates/dremio-executor.yaml | 4 ++-- charts/dremio_v2/templates/dremio-master.yaml | 4 ++-- charts/dremio_v2/values.yaml | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index 3f14dc79..a2be830e 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -24,7 +24,7 @@ spec: {{- include "dremio.coordinator.podAnnotations" $ | nindent 8 }} spec: {{- include "dremio.coordinator.serviceAccount" $ | nindent 6 }} - terminationGracePeriodSeconds: {{ $.Values.coordinator.stopTimeout }} + terminationGracePeriodSeconds: {{- include "dremio.coordinator.stopTimeoutPod" $ -}} {{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }} {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: @@ -63,7 +63,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: {{ $.Values.coordinator.stopTimeout }} + value: {{- include "dremio.coordinator.stopTimeoutDremio" $ -}} - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index 74c130fe..b591fa68 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -27,7 +27,7 @@ spec: {{- include "dremio.executor.podAnnotations" (list $ $engineName) | nindent 8}} spec: {{- include "dremio.executor.serviceAccount" (list $ $engineName) | nindent 6}} - terminationGracePeriodSeconds: {{- include "dremio.executor.stopTimeoutPod" -}} + terminationGracePeriodSeconds: {{- include "dremio.executor.stopTimeoutPod" $ -}} {{- include "dremio.executor.nodeSelector" (list $ $engineName) | nindent 6}} {{- include "dremio.executor.tolerations" (list $ $engineName) | nindent 6}} containers: @@ -61,7 +61,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: {{- include "dremio.executor.stopTimeoutDremio" -}} + value: {{- include "dremio.executor.stopTimeoutDremio" $ -}} - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.executor.heapMemory" (list $ $engineName) }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index 5658d497..861ba239 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -33,7 +33,7 @@ spec: values: - dremio-coordinator topologyKey: "kubernetes.io/hostname" - terminationGracePeriodSeconds: {{- include "dremio.coordinator.stopTimeoutPod" -}} + terminationGracePeriodSeconds: {{- include "dremio.coordinator.stopTimeoutPod" $ -}} {{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }} {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: @@ -70,7 +70,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: {{- include "dremio.coordinator.stopTimeoutDremio" -}} + value: {{- include "dremio.coordinator.stopTimeoutDremio" $ -}} - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/values.yaml b/charts/dremio_v2/values.yaml index 3dc7a442..4fb83269 100644 --- a/charts/dremio_v2/values.yaml +++ b/charts/dremio_v2/values.yaml @@ -129,8 +129,9 @@ coordinator: # kubectl create secret tls ${TLS_SECRET_NAME} --key ${KEY_FILE} --cert ${CERT_FILE} secret: dremio-tls-secret-flight - #seconds + # seconds stopTimeout: 120 + # Dremio Executor executor: # CPU & Memory @@ -205,7 +206,7 @@ executor: #nodeSelector: {} #tolerations: [] - #seconds + # seconds stopTimeout: 120 # Engine Overrides From 3ced8a9320f4c6265bb35c4982ea65bed4cccc54 Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 13:42:49 +0200 Subject: [PATCH 3/8] fix templates --- charts/dremio_v2/templates/dremio-coordinator.yaml | 2 +- charts/dremio_v2/templates/dremio-executor.yaml | 2 +- charts/dremio_v2/templates/dremio-master.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index a2be830e..5cc559fa 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -63,7 +63,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: {{- include "dremio.coordinator.stopTimeoutDremio" $ -}} + value: "{{- include "dremio.coordinator.stopTimeoutDremio" $ -}}" - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index b591fa68..d6c9adc4 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -61,7 +61,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: {{- include "dremio.executor.stopTimeoutDremio" $ -}} + value: "{{- include "dremio.executor.stopTimeoutDremio" $ -}}" - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.executor.heapMemory" (list $ $engineName) }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index 861ba239..f5f5c0e8 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -70,7 +70,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: {{- include "dremio.coordinator.stopTimeoutDremio" $ -}} + value: "{{- include "dremio.coordinator.stopTimeoutDremio" $ -}}" - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB From bfa7bed355401f6245f128be73cccb1ce50a736f Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 14:06:19 +0200 Subject: [PATCH 4/8] fix templates --- charts/dremio_v2/templates/_helpers_executor.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/dremio_v2/templates/_helpers_executor.tpl b/charts/dremio_v2/templates/_helpers_executor.tpl index 08e5f7eb..5c02fcac 100644 --- a/charts/dremio_v2/templates/_helpers_executor.tpl +++ b/charts/dremio_v2/templates/_helpers_executor.tpl @@ -352,7 +352,7 @@ Executor - grace termination period Resource Request {{- $context := index . 0 -}} {{- $engineName := index . 1 -}} {{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.stopTimeout) $engineName) -}} -{{- $stopTimeout := default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout -}} +{{- $stopTimeout := int (default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout) -}} {{- $stopTimeout -}} {{- end -}} @@ -360,6 +360,6 @@ Executor - grace termination period Resource Request {{- $context := index . 0 -}} {{- $engineName := index . 1 -}} {{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.stopTimeout) $engineName) -}} -{{- $stopTimeout := default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout -}} +{{- $stopTimeout := int (default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout) -}} {{- sub $stopTimeout 10 -}} {{- end -}} \ No newline at end of file From 44d455d4a7a09afc510597f0cecf387a5a956c13 Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 14:15:16 +0200 Subject: [PATCH 5/8] fix templates --- .github/workflows/test-charts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-charts.yml b/.github/workflows/test-charts.yml index 821784c7..2eaf6717 100644 --- a/.github/workflows/test-charts.yml +++ b/.github/workflows/test-charts.yml @@ -34,7 +34,7 @@ jobs: fi - name: Run chart-testing (lint) - run: ct lint --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --check-version-increment=false --validate-yaml=false - name: Create kind cluster uses: helm/kind-action@v1.4.0 From e5f8bf4e1ae4dbba887b2e64a2fb6385b9501a71 Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 15:32:45 +0200 Subject: [PATCH 6/8] fix templates --- charts/dremio_v2/templates/_helpers_executor.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/dremio_v2/templates/_helpers_executor.tpl b/charts/dremio_v2/templates/_helpers_executor.tpl index 5c02fcac..eebfe568 100644 --- a/charts/dremio_v2/templates/_helpers_executor.tpl +++ b/charts/dremio_v2/templates/_helpers_executor.tpl @@ -351,15 +351,15 @@ Executor - grace termination period Resource Request {{- define "dremio.executor.stopTimeoutPod" -}} {{- $context := index . 0 -}} {{- $engineName := index . 1 -}} -{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.stopTimeout) $engineName) -}} -{{- $stopTimeout := int (default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout) -}} -{{- $stopTimeout -}} +{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.engineOverride) $engineName) -}} +{{- $engineStopTimeout := default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout -}} +{{- $engineStopTimeout -}} {{- end -}} {{- define "dremio.executor.stopTimeoutDremio" -}} {{- $context := index . 0 -}} {{- $engineName := index . 1 -}} -{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.stopTimeout) $engineName) -}} -{{- $stopTimeout := int (default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout) -}} -{{- sub $stopTimeout 10 -}} +{{- $engineConfiguration := default (dict) (get (default (dict) $context.Values.executor.engineOverride) $engineName) -}} +{{- $engineStopTimeout := default ($context.Values.executor.stopTimeout) $engineConfiguration.stopTimeout -}} +{{- sub $engineStopTimeout 10 -}} {{- end -}} \ No newline at end of file From 3f4a916fcc9beafa5df925d09a72e0f33d104f4c Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 16:44:27 +0200 Subject: [PATCH 7/8] fix templates --- charts/dremio_v2/templates/dremio-coordinator.yaml | 4 ++-- charts/dremio_v2/templates/dremio-executor.yaml | 4 ++-- charts/dremio_v2/templates/dremio-master.yaml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index 5cc559fa..1cd595f7 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -24,7 +24,7 @@ spec: {{- include "dremio.coordinator.podAnnotations" $ | nindent 8 }} spec: {{- include "dremio.coordinator.serviceAccount" $ | nindent 6 }} - terminationGracePeriodSeconds: {{- include "dremio.coordinator.stopTimeoutPod" $ -}} + terminationGracePeriodSeconds: {{ template "dremio.coordinator.stopTimeoutPod" }} {{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }} {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: @@ -63,7 +63,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: "{{- include "dremio.coordinator.stopTimeoutDremio" $ -}}" + value: "{{ template "dremio.coordinator.stopTimeoutDremio" $ }}" - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index d6c9adc4..f88c5391 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -27,7 +27,7 @@ spec: {{- include "dremio.executor.podAnnotations" (list $ $engineName) | nindent 8}} spec: {{- include "dremio.executor.serviceAccount" (list $ $engineName) | nindent 6}} - terminationGracePeriodSeconds: {{- include "dremio.executor.stopTimeoutPod" $ -}} + terminationGracePeriodSeconds: {{ template "dremio.executor.stopTimeoutPod" (list $ $engineName) }} {{- include "dremio.executor.nodeSelector" (list $ $engineName) | nindent 6}} {{- include "dremio.executor.tolerations" (list $ $engineName) | nindent 6}} containers: @@ -61,7 +61,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: "{{- include "dremio.executor.stopTimeoutDremio" $ -}}" + value: "{{ template "dremio.executor.stopTimeoutDremio" (list $ $engineName) }}" - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.executor.heapMemory" (list $ $engineName) }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index f5f5c0e8..11b1341a 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -33,7 +33,7 @@ spec: values: - dremio-coordinator topologyKey: "kubernetes.io/hostname" - terminationGracePeriodSeconds: {{- include "dremio.coordinator.stopTimeoutPod" $ -}} + terminationGracePeriodSeconds: {{ template "dremio.coordinator.stopTimeoutPod" }} {{- include "dremio.coordinator.nodeSelector" $ | nindent 6 }} {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: @@ -70,7 +70,7 @@ spec: fieldPath: status.podIP {{- end }} - name: DREMIO_STOP_TIMEOUT - value: "{{- include "dremio.coordinator.stopTimeoutDremio" $ -}}" + value: "{{ template "dremio.coordinator.stopTimeoutDremio" $ }}" - name: DREMIO_MAX_HEAP_MEMORY_SIZE_MB value: "{{ template "dremio.coordinator.heapMemory" $ }}" - name: DREMIO_MAX_DIRECT_MEMORY_SIZE_MB From 96ca5ecffc7e7c476ca3a06da0dcee3984db7ea0 Mon Sep 17 00:00:00 2001 From: Nick Grigoriev Date: Thu, 19 Jan 2023 23:25:55 +0200 Subject: [PATCH 8/8] test submission web hook --- charts/dremio_v2/templates/dremio-coordinator.yaml | 10 ++++++---- charts/dremio_v2/templates/dremio-executor.yaml | 4 ++++ charts/dremio_v2/templates/dremio-master.yaml | 4 ++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index 1cd595f7..47eb6c8f 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -35,10 +35,6 @@ spec: requests: cpu: {{ $.Values.coordinator.cpu }} memory: {{ $.Values.coordinator.memory }}M - lifecycle: - preStop: - exec: - command: [ "/opt/dremio/bin/dremio stop" ] volumeMounts: - name: dremio-config mountPath: /opt/dremio/conf @@ -90,9 +86,15 @@ spec: value: "/opt/dremio/aws/credentials" - name: AWS_SHARED_CREDENTIALS_FILE value: "/opt/dremio/aws/credentials" + lifecycle: + preStop: + exec: + command: [ "/opt/dremio/bin/dremio stop" ] command: ["/opt/dremio/bin/dremio"] args: ["start-fg"] ports: + - containerPort: 9047 + name: web - containerPort: 31010 name: client - containerPort: 32010 diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index f88c5391..0e45f06a 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -89,6 +89,10 @@ spec: value: "/opt/dremio/aws/credentials" - name: AWS_SHARED_CREDENTIALS_FILE value: "/opt/dremio/aws/credentials" + lifecycle: + preStop: + exec: + command: [ "/opt/dremio/bin/dremio stop" ] command: ["/opt/dremio/bin/dremio"] args: ["start-fg"] ports: diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index 11b1341a..4b3188a4 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -97,6 +97,10 @@ spec: value: "/opt/dremio/aws/credentials" - name: AWS_SHARED_CREDENTIALS_FILE value: "/opt/dremio/aws/credentials" + lifecycle: + preStop: + exec: + command: [ "/opt/dremio/bin/dremio stop" ] command: ["/opt/dremio/bin/dremio"] args: - "start-fg"