Skip to content

Commit a22cb11

Browse files
committed
Add jmx options
1 parent d670957 commit a22cb11

File tree

5 files changed

+69
-5
lines changed

5 files changed

+69
-5
lines changed

helm/openwhisk/templates/_helpers.tpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ imagePullSecrets:
282282
{{/* Environment variables required for invoker volumes configuration */}}
283283
{{- define "openwhisk.invoker.volumes" -}}
284284
{{- if eq .Values.invoker.containerFactory.impl "docker" }}
285-
volumes:
286285
{{ include "openwhisk.docker_volumes" . | indent 6 }}
287286
- name: scripts-dir
288287
configMap:
@@ -293,7 +292,6 @@ imagePullSecrets:
293292
{{/* Environment variables required for invoker volumes configuration */}}
294293
{{- define "openwhisk.invoker.volume_mounts" -}}
295294
{{- if (eq .Values.invoker.containerFactory.impl "docker") }}
296-
volumeMounts:
297295
{{ include "openwhisk.docker_volume_mounts" . | indent 8 }}
298296
{{- if .Values.invoker.containerFactory.networkConfig.dns.inheritInvokerConfig }}
299297
- name: scripts-dir

helm/openwhisk/templates/controller-pod.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ spec:
6262
{{ include "openwhisk.readiness.waitForKafka" . | indent 6 }}
6363
{{- end }}
6464
{{ include "openwhisk.readiness.waitForCouchDB" . | indent 6 }}
65+
66+
volumes:
67+
- name: jmxremote-secret
68+
secret:
69+
secretName: {{ .Release.Name }}-jmxremote-secret
6570
# The lean controller requires invoker volumes mounts
6671
{{- if .Values.controller.lean }}
6772
{{ include "openwhisk.invoker.volumes" . }}
@@ -80,10 +85,21 @@ spec:
8085
ports:
8186
- name: controller
8287
containerPort: {{ .Values.controller.port }}
88+
- name: jmx
89+
jmxPort: {{ .Values.jmx.port }}
90+
- name: jmx-rmi
91+
jmxPort: {{ .Values.jmx.rmiPort }}
8392
- name: akka-remoting
8493
containerPort: 2552
8594
- name: akka-mgmt-http
8695
containerPort: 19999
96+
volumeMounts:
97+
- name: jmxremote-secret
98+
mountPath: "/conf/jmxremote.access"
99+
subPath: "jmxremote.access"
100+
- name: jmxremote-secret
101+
mountPath: "/conf/jmxremote.password"
102+
subPath: "jmxremote.password"
87103
{{- if .Values.controller.lean }}
88104
{{ include "openwhisk.invoker.volume_mounts" . }}
89105
{{- end }}
@@ -123,7 +139,7 @@ spec:
123139

124140
# Java options
125141
- name: "JAVA_OPTS"
126-
value: "-Xmx{{- .Values.controller.jvmHeapMB -}}M {{ .Values.controller.jvmOptions }}"
142+
value: "-Xmx{{- .Values.controller.jvmHeapMB -}}M {{ .Values.controller.jvmOptions }} {{ if .Values.jmx.enabled }} {{ .Values.jmx.jvmCommonArgs }} -Dcom.sun.management.jmxremote.rmi.port={{ .Values.jmx.rmiPort }} -Dcom.sun.management.jmxremote.port={{ .Values.jmx.port }} {{ end }}"
127143

128144
# specific controller arguments
129145
- name: "CONTROLLER_OPTS"

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ spec:
6666
tolerations:
6767
{{ include "openwhisk.toleration.invoker" . | indent 8 }}
6868
{{- end }}
69-
69+
volumes:
70+
- name: jmxremote-secret
71+
secret:
72+
secretName: {{ .Release.Name }}-jmxremote-secret
7073
{{ include "openwhisk.invoker.volumes" . }}
7174

7275
initContainers:
@@ -136,7 +139,7 @@ spec:
136139

137140
# Java options
138141
- name: "JAVA_OPTS"
139-
value: "-Xmx{{- .Values.invoker.jvmHeapMB -}}M {{ .Values.invoker.jvmOptions }}"
142+
value: "-Xmx{{- .Values.invoker.jvmHeapMB -}}M {{ .Values.invoker.jvmOptions }} {{ if .Values.jmx.enabled }} {{ .Values.jmx.jvmCommonArgs }} -Dcom.sun.management.jmxremote.rmi.port={{ .Values.jmx.rmiPort }} -Dcom.sun.management.jmxremote.port={{ .Values.jmx.port }} {{ end }}"
140143

141144
# Invoker options
142145
- name: "INVOKER_OPTS"
@@ -190,5 +193,16 @@ spec:
190193
ports:
191194
- name: invoker
192195
containerPort: {{ .Values.invoker.port }}
196+
- name: jmx
197+
jmxPort: {{ .Values.jmx.port }}
198+
- name: jmx-rmi
199+
jmxPort: {{ .Values.jmx.rmiPort }}
200+
volumeMounts:
201+
- name: jmxremote-secret
202+
mountPath: "/conf/jmxremote.access"
203+
subPath: "jmxremote.access"
204+
- name: jmxremote-secret
205+
mountPath: "/conf/jmxremote.password"
206+
subPath: "jmxremote.password"
193207
{{ include "openwhisk.invoker.volume_mounts" . }}
194208
{{- end }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
apiVersion: v1
19+
kind: Secret
20+
metadata:
21+
name: {{ .Release.Name }}-jmxremote-secret
22+
labels:
23+
{{ include "openwhisk.label_boilerplate" . | indent 4 }}
24+
type: Opaque
25+
data:
26+
jmxremote.access: {{ (printf "%s %s" .Values.jmx.user "readwrite") | b64enc }}
27+
jmxremote.password: {{ (printf "%s %s" .Values.jmx.user .Values.jmx.pass) | b64enc }}

helm/openwhisk/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ invoker:
275275
isolateUserActions: true
276276
replicaCount: 1
277277

278+
# JMX configurations
279+
jmx:
280+
enabled: false
281+
port: 15000
282+
rmiPort: 16000
283+
user: "jmxuser"
284+
pass: "jmxpass"
285+
jvmCommonArgs: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=/home/owuser/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/home/owuser/jmxremote.access"
286+
278287
# API Gateway configurations
279288
apigw:
280289
imageName: "openwhisk/apigateway"

0 commit comments

Comments
 (0)