Skip to content

Commit

Permalink
reworking and adding customizability to probes (valeriano-manassero#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-nik authored Jun 20, 2024
1 parent 64984ac commit 1cfa474
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 37 deletions.
6 changes: 2 additions & 4 deletions valeriano-manassero/trino/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "433"
description: High performance, distributed SQL query engine for big data
name: trino
version: 10.0.0
version: 10.1.0
kubeVersion: ">= 1.24.0-0 < 1.31.0-0"
home: https://trino.io
icon: https://trino.io/assets/images/trino-logo/trino-ko_tiny-alt.svg
Expand All @@ -27,6 +27,4 @@ keywords:
annotations:
artifacthub.io/changes: |
- kind: changed
description: Reduce default jvm configuration to make easier to customize
- kind: changed
description: Increase kubernetes version support
description: Adding customizability to probes and changing what is probed
6 changes: 5 additions & 1 deletion valeriano-manassero/trino/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# trino

![Version: 10.0.0](https://img.shields.io/badge/Version-10.0.0-informational?style=flat-square) ![AppVersion: 433](https://img.shields.io/badge/AppVersion-433-informational?style=flat-square)
![Version: 10.1.0](https://img.shields.io/badge/Version-10.1.0-informational?style=flat-square) ![AppVersion: 433](https://img.shields.io/badge/AppVersion-433-informational?style=flat-square)

High performance, distributed SQL query engine for big data

Expand Down Expand Up @@ -38,10 +38,12 @@ Kubernetes: `>= 1.24.0-0 < 1.31.0-0`
| config.coordinator.jvm.gcMethod.type | string | `"UseG1GC"` | |
| config.coordinator.jvm.maxRAMPercentage | float | `80` | |
| config.coordinator.jvmExtraConfig | string | `"-agentpath:/usr/lib/trino/bin/libjvmkill.so\n-XX:+ExplicitGCInvokesConcurrent\n-XX:+HeapDumpOnOutOfMemoryError\n-XX:+ExitOnOutOfMemoryError\n-XX:-OmitStackTraceInFastThrow\n-XX:ReservedCodeCacheSize=512M\n-XX:PerMethodRecompilationCutoff=10000\n-XX:PerBytecodeRecompilationCutoff=10000\n-Djdk.attach.allowAttachSelf=true\n-Djdk.nio.maxCachedBufferSize=2000000\n-XX:+UnlockDiagnosticVMOptions\n-XX:G1NumCollectionsKeepPinned=10000000"` | |
| config.coordinator.livenessProbe | object | `{}` | |
| config.coordinator.nodeSelector | object | `{}` | |
| config.coordinator.podAnnotations | object | `{}` | |
| config.coordinator.podLabels | object | `{}` | |
| config.coordinator.query.maxMemoryPerNode | string | `"1GB"` | |
| config.coordinator.readinessProbe | object | `{}` | |
| config.coordinator.replicas | int | `1` | |
| config.coordinator.resources | object | `{}` | |
| config.coordinator.tolerations | list | `[]` | |
Expand Down Expand Up @@ -81,10 +83,12 @@ Kubernetes: `>= 1.24.0-0 < 1.31.0-0`
| config.worker.jvm.maxRAMPercentage | float | `80` | |
| config.worker.jvmExtraConfig | string | `"-agentpath:/usr/lib/trino/bin/libjvmkill.so\n-XX:+ExplicitGCInvokesConcurrent\n-XX:+HeapDumpOnOutOfMemoryError\n-XX:+ExitOnOutOfMemoryError\n-XX:-OmitStackTraceInFastThrow\n-XX:ReservedCodeCacheSize=512M\n-XX:PerMethodRecompilationCutoff=10000\n-XX:PerBytecodeRecompilationCutoff=10000\n-Djdk.attach.allowAttachSelf=true\n-Djdk.nio.maxCachedBufferSize=2000000\n-XX:+UnlockDiagnosticVMOptions\n-XX:G1NumCollectionsKeepPinned=10000000"` | |
| config.worker.lifecycle | object | `{}` | |
| config.worker.livenessProbe | object | `{}` | |
| config.worker.nodeSelector | object | `{}` | |
| config.worker.podAnnotations | object | `{}` | |
| config.worker.podLabels | object | `{}` | |
| config.worker.query.maxMemoryPerNode | string | `"1GB"` | |
| config.worker.readinessProbe | object | `{}` | |
| config.worker.replicas | int | `2` | Replica count when autoscaler is disabled. If autoscaler is enabled, it sets minimum number of replicas. |
| config.worker.resources | object | `{}` | |
| config.worker.tolerations | list | `[]` | |
Expand Down
12 changes: 0 additions & 12 deletions valeriano-manassero/trino/templates/configmap-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,6 @@ data:
{{- end }}
{{ end }}

---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "trino.worker" . }}-health-check
labels:
{{- include "trino.labels" . | nindent 4 }}
app.kubernetes.io/component: worker
data:
health_check.sh: |
#!/bin/bash
curl -H 'X-trino-User: healthCheck' -m 3 --silent {{ template "trino.fullname" . }}:{{ .Values.config.general.http.port }}/v1/info/state | grep --silent 'ACTIVE'
---
apiVersion: v1
kind: ConfigMap
Expand Down
17 changes: 13 additions & 4 deletions valeriano-manassero/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,21 @@ spec:
{{- end }}
livenessProbe:
httpGet:
path: /v1/status
path: /v1/info
port: http-coord
initialDelaySeconds: {{ .Values.config.coordinator.livenessProbe.initialDelaySeconds | default 30 }}
periodSeconds: {{ .Values.config.coordinator.livenessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.config.coordinator.livenessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.config.coordinator.livenessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.config.coordinator.livenessProbe.successThreshold | default 1 }}
readinessProbe:
httpGet:
path: /v1/status
port: http-coord
exec:
command: [/usr/lib/trino/bin/health-check]
initialDelaySeconds: {{ .Values.config.coordinator.readinessProbe.initialDelaySeconds | default 10 }}
periodSeconds: {{ .Values.config.coordinator.readinessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.config.coordinator.readinessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.config.coordinator.readinessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.config.coordinator.readinessProbe.successThreshold | default 1 }}
resources:
{{ toYaml .Values.config.coordinator.resources | indent 12 }}
{{- with .Values.config.coordinator.nodeSelector }}
Expand Down
34 changes: 18 additions & 16 deletions valeriano-manassero/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ spec:
- secret:
name: {{ .Values.faultToleranceSecret | default "trino-fault-tolerance" }}
{{- end }}
- name: health-check-volume
configMap:
name: {{ template "trino.worker" . }}-health-check
defaultMode: 0777
{{- if eq .Values.config.general.catalogsMountType "configmap" }}
- name: catalog-volume
configMap:
Expand Down Expand Up @@ -130,8 +126,6 @@ spec:
name: config-volume
- mountPath: /etc/trino/schemas
name: schemas-volume
- mountPath: /startup/
name: health-check-volume
- mountPath: {{ .Values.config.general.path }}/catalog
name: catalog-volume
- mountPath: {{ .Values.config.general.path }}/certs
Expand Down Expand Up @@ -160,8 +154,11 @@ spec:
- name: {{ $mountName }}
{{- tpl (toYaml $mount) $ | nindent 14 -}}
{{- end }}
{{- if .Values.jmxExporter.worker.enabled }}
ports:
- name: http-worker
containerPort: {{ .Values.config.general.http.port }}
protocol: TCP
{{- if .Values.jmxExporter.worker.enabled }}
- name: jmx-exporter
containerPort: {{ .Values.jmxExporter.port | default 9000 }}
protocol: TCP
Expand All @@ -171,17 +168,22 @@ spec:
{{ toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
exec:
command:
- /startup/health_check.sh
initialDelaySeconds: 10
periodSeconds: 25
httpGet:
path: /v1/info
port: http-worker
initialDelaySeconds: {{ .Values.config.worker.livenessProbe.initialDelaySeconds | default 30 }}
periodSeconds: {{ .Values.config.worker.livenessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.config.worker.livenessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.config.worker.livenessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.config.worker.livenessProbe.successThreshold | default 1 }}
readinessProbe:
exec:
command:
- /startup/health_check.sh
initialDelaySeconds: 5
periodSeconds: 10
command: [/usr/lib/trino/bin/health-check]
initialDelaySeconds: {{ .Values.config.worker.readinessProbe.initialDelaySeconds | default 10 }}
periodSeconds: {{ .Values.config.worker.readinessProbe.periodSeconds | default 10 }}
timeoutSeconds: {{ .Values.config.worker.readinessProbe.timeoutSeconds | default 5 }}
failureThreshold: {{ .Values.config.worker.readinessProbe.failureThreshold | default 6 }}
successThreshold: {{ .Values.config.worker.readinessProbe.successThreshold | default 1 }}
resources:
{{ toYaml .Values.config.worker.resources | indent 12 }}
{{- with .Values.config.worker.nodeSelector }}
Expand Down
24 changes: 24 additions & 0 deletions valeriano-manassero/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ config:
extraConfig: ""
query:
maxMemoryPerNode: "1GB"
livenessProbe: {}
# initialDelaySeconds: 20
# periodSeconds: 10
# timeoutSeconds: 5
# failureThreshold: 6
# successThreshold: 1
readinessProbe: {}
# initialDelaySeconds: 20
# periodSeconds: 10
# timeoutSeconds: 5
# failureThreshold: 6
# successThreshold: 1

worker:
# -- Replica count when autoscaler is disabled. If autoscaler is enabled, it sets minimum number of replicas.
Expand Down Expand Up @@ -166,6 +178,18 @@ config:
# localtemp:
# hostPath:
# path: /mnt
livenessProbe: {}
# initialDelaySeconds: 20
# periodSeconds: 10
# timeoutSeconds: 5
# failureThreshold: 6
# successThreshold: 1
readinessProbe: {}
# initialDelaySeconds: 20
# periodSeconds: 10
# timeoutSeconds: 5
# failureThreshold: 6
# successThreshold: 1


eventListenerProperties: {}
Expand Down

0 comments on commit 1cfa474

Please sign in to comment.