Skip to content

Commit 9be985b

Browse files
authored
Configure JMX for remote access (#282)
1 parent 90dbc05 commit 9be985b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

charts/streams-app/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ Alternatively, a YAML file that specifies the values for the parameters can be p
7979

8080
### JMX Configuration
8181

82-
| Parameter | Description | Default |
83-
|------------|---------------------------------------------------|---------|
84-
| `jmx.port` | The jmx port which JMX style metrics are exposed. | `5555` |
82+
| Parameter | Description | Default |
83+
|---------------|-------------------------------------------------------------------------|-------------|
84+
| `jmx.enabled` | Whether or not to open JMX port for remote access (e.g., for debugging) | `false` |
85+
| `jmx.port` | The JMX port which JMX style metrics are exposed. | `5555` |
86+
| `jmx.host` | The host to use for JMX remote access. | `localhost` |
8587

8688
### Prometheus JMX Exporter Configuration
8789

charts/streams-app/templates/deployment.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ spec:
174174
value: '-Dcom.sun.management.jmxremote.port={{ .Values.jmx.port }}
175175
-Dcom.sun.management.jmxremote.authenticate=false
176176
-Dcom.sun.management.jmxremote.ssl=false
177+
{{- if .Values.jmx.enabled }}
178+
-Djava.rmi.server.hostname={{ .Values.jmx.host }}
179+
-Dcom.sun.management.jmxremote.rmi.port={{ .Values.jmx.port }}
180+
{{- end }}
177181
-XX:MaxRAMPercentage={{ printf "%.1f" .Values.javaOptions.maxRAMPercentage }}
178182
{{ .Values.javaOptions.others | join " " }}'
179183
{{- if or (.Values.files) (and .Values.persistence.enabled .Values.statefulSet) (.Values.secretFilesRefs) }}
@@ -207,7 +211,7 @@ spec:
207211
protocol: {{ .protocol | quote }}
208212
{{- end }}
209213
{{- end }}
210-
{{- if .Values.prometheus.jmx.enabled }}
214+
{{- if .Values.jmx.enabled }}
211215
- containerPort: {{ .Values.jmx.port }}
212216
name: jmx
213217
{{- end }}

charts/streams-app/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ readinessProbe: {}
9292
## Kafka Connect JMX Settings
9393
## ref: https://kafka.apache.org/documentation/#connect_monitoring
9494
jmx:
95+
enabled: false
9596
port: 5555
97+
host: localhost
9698

9799
autoscaling:
98100
enabled: false

0 commit comments

Comments
 (0)