Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JMX Exporter container port spec #222

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,13 @@ Fast distributed SQL query engine for big data analytics that helps you explore
* `jmx.exporter.image` - string, default: `"bitnami/jmx-exporter:latest"`
* `jmx.exporter.pullPolicy` - string, default: `"Always"`
* `jmx.exporter.port` - int, default: `5556`
* `jmx.exporter.configProperties` - list, default: `[]`
* `jmx.exporter.configProperties` - string, default: `""`

JMX Config Properties is mounted to /etc/jmx-exporter/jmx-exporter-config.yaml
The string value is templated using `tpl`. JMX Config Properties is mounted to /etc/jmx-exporter/jmx-exporter-config.yaml
Example:
```yaml
configProperties: |-
hostPort: localhost:{{- .Values.jmx.registryPort }}
startDelaySeconds: 0
ssl: false
lowercaseOutputName: false
Expand Down
4 changes: 2 additions & 2 deletions charts/trino/templates/configmap-jmx-exporter.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.jmx.exporter.enabled -}}
{{- if .Values.jmx.exporter.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -9,5 +9,5 @@ metadata:
app.kubernetes.io/component: jmx
data:
jmx-exporter-config.yaml: |-
{{- .Values.jmx.exporter.configProperties | nindent 4 }}
{{- tpl .Values.jmx.exporter.configProperties . | nindent 4 }}
{{- end }}
31 changes: 18 additions & 13 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,15 @@ spec:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
{{- if .Values.jmx.enabled }}
{{- with .Values.jmx }}
{{- if .enabled }}
- name: jmx-registry
containerPort: {{ .Values.jmx.registryPort }}
containerPort: {{ .registryPort }}
protocol: TCP
- name: jmx-server
containerPort: {{ .Values.jmx.serverPort }}
containerPort: {{ .serverPort }}
protocol: TCP
{{- end }}
{{- if .Values.jmx.exporter.enabled }}
- name: jmx-exporter
containerPort: {{ .Values.jmx.exporter.port }}
protocol: TCP
{{- end }}
{{- range $key, $value := .Values.coordinator.additionalExposedPorts }}
- name: {{ $value.name }}
Expand Down Expand Up @@ -201,22 +198,30 @@ spec:
{{- toYaml .Values.coordinator.lifecycle | nindent 12 }}
resources:
{{- toYaml .Values.coordinator.resources | nindent 12 }}
{{- if .Values.jmx.exporter.enabled }}
{{- with .Values.jmx.exporter }}
{{- if .enabled }}
- name: jmx-exporter
image: {{ .Values.jmx.exporter.image }}
imagePullPolicy: {{ .Values.jmx.exporter.pullPolicy }}
{{- with .Values.jmx.exporter.securityContext }}
image: {{ .image }}
imagePullPolicy: {{ .pullPolicy }}
{{- with .securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
args:
- "{{ .Values.jmx.exporter.port }}"
- "{{ .port }}"
- /etc/jmx-exporter/jmx-exporter-config.yaml
volumeMounts:
- mountPath: /etc/jmx-exporter/
name: jmx-exporter-config-volume
{{- with .resources }}
resources:
{{- toYaml .Values.jmx.exporter.resources | nindent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: jmx-exporter
containerPort: {{ .port }}
protocol: TCP
{{- end }}
{{- end }}
{{- if .Values.sidecarContainers.coordinator }}
{{- toYaml .Values.sidecarContainers.coordinator | nindent 8 }}
Expand Down
7 changes: 4 additions & 3 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,13 @@ jmx:
image: bitnami/jmx-exporter:latest
pullPolicy: Always
port: 5556
configProperties: []
securityContext: {}
# jmx.exporter.configProperties -- JMX Config Properties is mounted to /etc/jmx-exporter/jmx-exporter-config.yaml
configProperties: ""
# jmx.exporter.configProperties -- The string value is templated using `tpl`. JMX Config Properties is mounted to /etc/jmx-exporter/jmx-exporter-config.yaml
# @raw
# Example:
# ```yaml
# configProperties: |-
# hostPort: localhost:{{- .Values.jmx.registryPort }}
# startDelaySeconds: 0
# ssl: false
# lowercaseOutputName: false
Expand All @@ -804,6 +804,7 @@ jmx:
# value: '$2'
# help: 'ThreadCount (java.lang<type=Threading><>ThreadCount)'
# type: UNTYPED
securityContext: {}
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
Expand Down