diff --git a/.github/helm-docs.sh b/.github/helm-docs.sh index 25baf7f..47b36d4 100755 --- a/.github/helm-docs.sh +++ b/.github/helm-docs.sh @@ -1,7 +1,7 @@ #!/bin/bash CHART_DIRS="$(git diff --find-renames --name-only "$(git rev-parse --abbrev-ref HEAD)" remotes/origin/main -- 'valeriano-manassero' | grep '[cC]hart.yaml' | sed -e 's#/[Cc]hart.yaml##g')" -HELM_DOCS_VERSION="1.12.0" +HELM_DOCS_VERSION="1.11.0" curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz tar -xf /tmp/helm-docs.tar.gz helm-docs diff --git a/valeriano-manassero/trino/Chart.yaml b/valeriano-manassero/trino/Chart.yaml index 3439beb..bb1eb14 100644 --- a/valeriano-manassero/trino/Chart.yaml +++ b/valeriano-manassero/trino/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "380" description: High performance, distributed SQL query engine for big data name: trino -version: 2.6.2 +version: 2.7.0 home: https://trino.io icon: https://trino.io/assets/images/trino-logo/trino-ko_tiny-alt.svg sources: diff --git a/valeriano-manassero/trino/README.md b/valeriano-manassero/trino/README.md index 0512884..9f2bc3b 100644 --- a/valeriano-manassero/trino/README.md +++ b/valeriano-manassero/trino/README.md @@ -1,6 +1,6 @@ # trino -![Version: 2.6.2](https://img.shields.io/badge/Version-2.6.2-informational?style=flat-square) ![AppVersion: 380](https://img.shields.io/badge/AppVersion-380-informational?style=flat-square) +![Version: 2.7.0](https://img.shields.io/badge/Version-2.7.0-informational?style=flat-square) ![AppVersion: 380](https://img.shields.io/badge/AppVersion-380-informational?style=flat-square) High performance, distributed SQL query engine for big data @@ -92,6 +92,21 @@ High performance, distributed SQL query engine for big data | initKeystore.image.pullPolicy | string | `"IfNotPresent"` | | | initKeystore.image.repository | string | `"bitnami/java"` | | | initKeystore.image.tag | int | `17` | | +| jmxExporter.coordinator.enabled | bool | `false` | | +| jmxExporter.downloadLink | string | `"https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.17.2/jmx_prometheus_javaagent-0.17.2.jar"` | | +| jmxExporter.image.pullPolicy | string | `"IfNotPresent"` | | +| jmxExporter.image.repository | string | `"curlimages/curl"` | | +| jmxExporter.image.tag | string | `"7.87.0"` | | +| jmxExporter.jarfile | string | `"jmx_prometheus_javaagent-0.17.2.jar"` | | +| jmxExporter.path | string | `"/prometheus"` | | +| jmxExporter.port | int | `9000` | | +| jmxExporter.serviceMonitor.additionalLabels | object | `{}` | | +| jmxExporter.serviceMonitor.enabled | bool | `true` | | +| jmxExporter.serviceMonitor.interval | string | `"1m"` | | +| jmxExporter.serviceMonitor.path | string | `"/metrics"` | | +| jmxExporter.serviceMonitor.port | string | `"jmx-exporter"` | | +| jmxExporter.serviceMonitor.scrapeTimeout | string | `"10s"` | | +| jmxExporter.worker.enabled | bool | `false` | | | resourceGroups | object | `{}` | | | schemas | object | `{}` | | | secretMounts | list | `[]` | | diff --git a/valeriano-manassero/trino/templates/configmap-coordinator.yaml b/valeriano-manassero/trino/templates/configmap-coordinator.yaml index 0b64445..c8d6930 100644 --- a/valeriano-manassero/trino/templates/configmap-coordinator.yaml +++ b/valeriano-manassero/trino/templates/configmap-coordinator.yaml @@ -21,6 +21,9 @@ data: -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -Djdk.attach.allowAttachSelf=true +{{- if .Values.jmxExporter.coordinator.enabled }} + -javaagent:{{ .Values.jmxExporter.path }}/lib/{{ .Values.jmxExporter.jarfile }}={{ .Values.jmxExporter.port }}:{{ .Values.jmxExporter.path }}/etc/trino.yaml +{{- end }} {{ .Values.config.coordinator.jvmExtraConfig | indent 4 }} config.properties: | diff --git a/valeriano-manassero/trino/templates/configmap-jmx-exporter.yaml b/valeriano-manassero/trino/templates/configmap-jmx-exporter.yaml new file mode 100644 index 0000000..daab7da --- /dev/null +++ b/valeriano-manassero/trino/templates/configmap-jmx-exporter.yaml @@ -0,0 +1,63 @@ +{{- if or .Values.jmxExporter.coordinator.enabled .Values.jmxExporter.worker.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "trino.fullname" . }}-jmx-exporter + labels: + {{- include "trino.labels" . | nindent 4 }} +data: + trino.yaml: | + startDelaySeconds: 5 + rules: + - pattern : trino.execution<>InputDataSize.OneMinute.Count + name: trino_coord_Input_bytes_sci + + - pattern : trino.execution<>InputPositions.OneMinute.Count + name: trino_coord_Input_rows + + - pattern : trino.execution<>OutputDataSize.OneMinute.Count + name: trino_coord_Output_bytes_sci + + - pattern : trino.execution<>OutputPositions.OneMinute.Count + name: trino_coord_Output_rows + + - pattern : trino.memory<>TotalDistributedBytes + name: trino_TotalDistributedBytes + + - pattern : trino.memory<>ReservedDistributedBytes + name: trino_ReservedDistributedBytes + + - pattern : trino.execution<>FailedQueries.OneMinute.Count + name: trino_Failed_Queries + + - pattern : trino.execution<>RunningQueries + name: trino_running_queries + + - pattern : trino.failuredetector<>ActiveCount + name: trino_active_nodes + + - pattern : trino.memory<>FreeDistributedBytes + name: trino_cluster_free_memory + + - pattern : trino.execution<>Executor.QueuedTaskCount + name: trino_queued_task_count + + - pattern : trino.execution<>StartedQueries.FiveMinute.Count + name: trino_started_queries + + - pattern : java.langcommitted + name: trino_jvm_heap_memory_usage + + - pattern : java.lang<>ThreadCount + name: trino_jvm_thread_count + + - pattern : trino.execution<>InternalFailures.OneMinute.Count + name: trino_failed_queries_internal + + - pattern : trino.execution<>ExternalFailures.OneMinute.Count + name: trino_failed_queries_external + + - pattern : trino.execution<>UserErrorFailures.OneMinute.Count + name: trino_failed_queries_user + +{{- end }} diff --git a/valeriano-manassero/trino/templates/configmap-worker.yaml b/valeriano-manassero/trino/templates/configmap-worker.yaml index c81e097..6b3d694 100644 --- a/valeriano-manassero/trino/templates/configmap-worker.yaml +++ b/valeriano-manassero/trino/templates/configmap-worker.yaml @@ -22,6 +22,9 @@ data: -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -Djdk.attach.allowAttachSelf=true +{{- if .Values.jmxExporter.worker.enabled }} + -javaagent:{{ .Values.jmxExporter.path }}/lib/{{ .Values.jmxExporter.jarfile }}={{ .Values.jmxExporter.port }}:{{ .Values.jmxExporter.path }}/etc/trino.yaml +{{- end }} {{ .Values.config.worker.jvmExtraConfig | indent 4 }} config.properties: | diff --git a/valeriano-manassero/trino/templates/deployment-coordinator.yaml b/valeriano-manassero/trino/templates/deployment-coordinator.yaml index 708bc7c..c2f0ee4 100644 --- a/valeriano-manassero/trino/templates/deployment-coordinator.yaml +++ b/valeriano-manassero/trino/templates/deployment-coordinator.yaml @@ -87,6 +87,13 @@ spec: persistentVolumeClaim: claimName: {{ .Values.groupProvider.pvcName }} {{- end }}{{- end }} + {{- if .Values.jmxExporter.coordinator.enabled }} + - name: jmx-exporter-config + configMap: + name: {{ template "trino.fullname" . }}-jmx-exporter + - name: jmx-exporter-lib + emptyDir: {} + {{- end }} {{- range .Values.secretMounts }} - name: {{ .name }} secret: @@ -97,8 +104,25 @@ spec: configMap: name: {{ .configMapName }} {{- end }} - {{- if or .Values.config.coordinator.initContainers (include "trino.tlsEncryption" . ) }} + {{- if or .Values.jmxExporter.coordinator.enabled .Values.config.coordinator.initContainers (include "trino.tlsEncryption" . ) }} initContainers: + {{- if .Values.jmxExporter.coordinator.enabled }} + - name: download-jmx-exporter + image: {{ .Values.jmxExporter.image.repository }}:{{ .Values.jmxExporter.image.tag }} + imagePullPolicy: {{ .Values.jmxExporter.image.pullPolicy }} + {{- with .Values.image.securityContext }} + securityContext: + runAsUser: {{ .runAsUser }} + runAsGroup: {{ .runAsGroup }} + {{- end }} + args: + - "--output" + - "{{ .Values.jmxExporter.path }}/lib/{{ .Values.jmxExporter.jarfile }}" + - "{{ .Values.jmxExporter.downloadLink }}" + volumeMounts: + - name: jmx-exporter-lib + mountPath: {{ .Values.jmxExporter.path }}/lib/ + {{- end }} {{- if (include "trino.tlsEncryption" . ) }} - name: init-certs image: {{ .Values.initKeystore.image.repository }}:{{ .Values.initKeystore.image.tag }} @@ -211,6 +235,12 @@ spec: - mountPath: {{ .Values.config.general.path }}/group-provider name: {{ .Values.groupProvider.pvcVolumeName | default "group-provider-pvc-volume" }} {{- end }}{{- end }} + {{- if .Values.jmxExporter.coordinator.enabled }} + - mountPath: {{ .Values.jmxExporter.path }}/etc/ + name: jmx-exporter-config + - mountPath: {{ .Values.jmxExporter.path }}/lib/ + name: jmx-exporter-lib + {{- end }} {{- range .Values.secretMounts }} - name: {{ .name }} mountPath: {{ .path }} @@ -234,6 +264,11 @@ spec: containerPort: {{ .Values.config.general.httpsServer.port }} protocol: TCP {{- end }} + {{- if .Values.jmxExporter.coordinator.enabled }} + - name: jmx-exporter + containerPort: {{ .Values.jmxExporter.port | default 9000 }} + protocol: TCP + {{- end }} livenessProbe: httpGet: path: /v1/status diff --git a/valeriano-manassero/trino/templates/deployment-worker.yaml b/valeriano-manassero/trino/templates/deployment-worker.yaml index fad630c..13ff950 100644 --- a/valeriano-manassero/trino/templates/deployment-worker.yaml +++ b/valeriano-manassero/trino/templates/deployment-worker.yaml @@ -51,6 +51,13 @@ spec: name: schemas-volume-worker - name: certs-shared emptyDir: {} + {{- if .Values.jmxExporter.worker.enabled }} + - name: jmx-exporter-config + configMap: + name: {{ template "trino.fullname" . }}-jmx-exporter + - name: jmx-exporter-lib + emptyDir: {} + {{- end }} {{- range .Values.secretMounts }} - name: {{ .name }} secret: @@ -61,10 +68,29 @@ spec: configMap: name: {{ .configMapName }} {{- end }} - {{- if .Values.config.worker.initContainers }} + {{- if or .Values.jmxExporter.worker.enabled .Values.config.coordinator.initContainers }} initContainers: + {{- if .Values.jmxExporter.worker.enabled }} + - name: download-jmx-exporter + image: {{ .Values.jmxExporter.image.repository }}:{{ .Values.jmxExporter.image.tag }} + imagePullPolicy: {{ .Values.jmxExporter.image.pullPolicy }} + {{- with .Values.image.securityContext }} + securityContext: + runAsUser: {{ .runAsUser }} + runAsGroup: {{ .runAsGroup }} + {{- end }} + args: + - "--output" + - "{{ .Values.jmxExporter.path }}/lib/{{ .Values.jmxExporter.jarfile }}" + - "{{ .Values.jmxExporter.downloadLink }}" + volumeMounts: + - name: jmx-exporter-lib + mountPath: {{ .Values.jmxExporter.path }}/lib/ + {{- end }} + {{- if .Values.config.worker.initContainers }} {{- tpl (toYaml .Values.config.worker.initContainers) . | nindent 6 }} {{- end }} + {{- end }} serviceAccountName: {{ include "trino.serviceAccountName" . }} imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }} @@ -87,6 +113,12 @@ spec: name: catalog-volume - mountPath: {{ .Values.config.general.path }}/certs name: certs-shared + {{- if .Values.jmxExporter.worker.enabled }} + - mountPath: {{ .Values.jmxExporter.path }}/etc/ + name: jmx-exporter-config + - mountPath: {{ .Values.jmxExporter.path }}/lib/ + name: jmx-exporter-lib + {{- end }} {{- range .Values.secretMounts }} - name: {{ .name }} mountPath: {{ .path }} @@ -101,6 +133,12 @@ spec: subPath: {{ .subPath }} {{- end }} {{- end }} + {{- if .Values.jmxExporter.worker.enabled }} + ports: + - name: jmx-exporter + containerPort: {{ .Values.jmxExporter.port | default 9000 }} + protocol: TCP + {{- end }} livenessProbe: exec: command: diff --git a/valeriano-manassero/trino/templates/service-coordinator.yaml b/valeriano-manassero/trino/templates/service-coordinator.yaml new file mode 100644 index 0000000..40d49dc --- /dev/null +++ b/valeriano-manassero/trino/templates/service-coordinator.yaml @@ -0,0 +1,19 @@ +{{- if .Values.jmxExporter.coordinator.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "trino.coordinator" . }} + labels: + {{- include "trino.labels" . | nindent 4 }} + app.kubernetes.io/component: coordinator +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.jmxExporter.port | default 9000 }} + targetPort: jmx-exporter + protocol: TCP + name: {{ .Values.jmxExporter.serviceMonitor.port | default "jmx-exporter" }} + selector: + {{- include "trino.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: coordinator +{{- end }} \ No newline at end of file diff --git a/valeriano-manassero/trino/templates/service-worker.yaml b/valeriano-manassero/trino/templates/service-worker.yaml new file mode 100644 index 0000000..7c4aba6 --- /dev/null +++ b/valeriano-manassero/trino/templates/service-worker.yaml @@ -0,0 +1,19 @@ +{{- if .Values.jmxExporter.worker.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "trino.worker" . }} + labels: + {{- include "trino.labels" . | nindent 4 }} + app.kubernetes.io/component: worker +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.jmxExporter.port | default 9000 }} + targetPort: jmx-exporter + protocol: TCP + name: {{ .Values.jmxExporter.serviceMonitor.port | default "jmx-exporter" }} + selector: + {{- include "trino.selectorLabels" . | nindent 4 }} + app.kubernetes.io/component: worker +{{- end }} \ No newline at end of file diff --git a/valeriano-manassero/trino/templates/servicemonitor-coordinator.yaml b/valeriano-manassero/trino/templates/servicemonitor-coordinator.yaml new file mode 100644 index 0000000..93659bf --- /dev/null +++ b/valeriano-manassero/trino/templates/servicemonitor-coordinator.yaml @@ -0,0 +1,32 @@ +{{- if and .Values.jmxExporter.coordinator.enabled .Values.jmxExporter.serviceMonitor.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "trino.coordinator" . }} + labels: + {{- include "trino.labels" . | nindent 4 }} +spec: + jobLabel: {{ .Release.Name }}-coordinator + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "trino.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: coordinator + endpoints: + - port: {{ .Values.jmxExporter.serviceMonitor.port }} + {{- with .Values.jmxExporter.serviceMonitor.path }} + path: {{ . }} + {{- end }} + {{- with .Values.jmxExporter.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.jmxExporter.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + {{- with .Values.jmxExporter.serviceMonitor.relabelings }} + relabelings: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/valeriano-manassero/trino/templates/servicemonitor-worker.yaml b/valeriano-manassero/trino/templates/servicemonitor-worker.yaml new file mode 100644 index 0000000..bbe1613 --- /dev/null +++ b/valeriano-manassero/trino/templates/servicemonitor-worker.yaml @@ -0,0 +1,32 @@ +{{- if and .Values.jmxExporter.worker.enabled .Values.jmxExporter.serviceMonitor.enabled -}} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "trino.worker" . }} + labels: + {{- include "trino.labels" . | nindent 4 }} +spec: + jobLabel: {{ .Release.Name }}-worker + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "trino.selectorLabels" . | nindent 6 }} + app.kubernetes.io/component: worker + endpoints: + - port: {{ .Values.jmxExporter.serviceMonitor.port }} + {{- with .Values.jmxExporter.serviceMonitor.path }} + path: {{ . }} + {{- end }} + {{- with .Values.jmxExporter.serviceMonitor.interval }} + interval: {{ . }} + {{- end }} + {{- with .Values.jmxExporter.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ . }} + {{- end }} + {{- with .Values.jmxExporter.serviceMonitor.relabelings }} + relabelings: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/valeriano-manassero/trino/values.yaml b/valeriano-manassero/trino/values.yaml index 3978f3c..85e998c 100644 --- a/valeriano-manassero/trino/values.yaml +++ b/valeriano-manassero/trino/values.yaml @@ -449,3 +449,29 @@ tls: # requests: # cpu: 100m # memory: 128Mi + +jmxExporter: + coordinator: + enabled: false + worker: + enabled: false + port: 9000 + path: /prometheus + jarfile: jmx_prometheus_javaagent-0.17.2.jar + downloadLink: https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/0.17.2/jmx_prometheus_javaagent-0.17.2.jar + image: + repository: curlimages/curl + tag: 7.87.0 + pullPolicy: IfNotPresent + serviceMonitor: + enabled: true + port: "jmx-exporter" + additionalLabels: {} + interval: 1m + scrapeTimeout: 10s + path: /metrics + # Additional relabeling configs to the ones that Prometheus Operator + # creates by default. + # relabelings: + # - sourceLabels: [__meta_kubernetes_endpoints_label_app_kubernetes_io_version] + # targetLabel: version