Skip to content

Commit 865e353

Browse files
committed
Add jmx options
1 parent f6df5a6 commit 865e353

File tree

5 files changed

+69
-6
lines changed

5 files changed

+69
-6
lines changed

helm/openwhisk/templates/_helpers.tpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ imagePullSecrets:
292292
{{/* Environment variables required for invoker volumes configuration */}}
293293
{{- define "openwhisk.invoker.volumes" -}}
294294
{{- if eq .Values.invoker.containerFactory.impl "docker" }}
295-
volumes:
296295
{{ include "openwhisk.docker_volumes" . | indent 6 }}
297296
- name: scripts-dir
298297
configMap:
@@ -303,7 +302,6 @@ imagePullSecrets:
303302
{{/* Environment variables required for invoker volumes configuration */}}
304303
{{- define "openwhisk.invoker.volume_mounts" -}}
305304
{{- if (eq .Values.invoker.containerFactory.impl "docker") }}
306-
volumeMounts:
307305
{{ include "openwhisk.docker_volume_mounts" . | indent 8 }}
308306
{{- if .Values.invoker.containerFactory.networkConfig.dns.inheritInvokerConfig }}
309307
- name: scripts-dir

helm/openwhisk/templates/controller-pod.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ spec:
6363
{{- end }}
6464
{{ include "openwhisk.readiness.waitForCouchDB" . | indent 6 }}
6565
{{- if eq .Values.activationStoreBackend "ElasticSearch" }}
66-
# The controller must wait for elasticsearch to be ready before it starts
66+
# The controller must wait for elasticsearch to be ready before it starts
6767
{{ include "openwhisk.readiness.waitForElasticSearch" . | indent 6 }}
6868
{{- end }}
69+
volumes:
70+
- name: jmxremote-secret
71+
secret:
72+
secretName: {{ .Release.Name }}-jmxremote-secret
6973
# The lean controller requires invoker volumes mounts
7074
{{- if .Values.controller.lean }}
7175
{{ include "openwhisk.invoker.volumes" . }}
@@ -84,10 +88,21 @@ spec:
8488
ports:
8589
- name: controller
8690
containerPort: {{ .Values.controller.port }}
91+
- name: jmx
92+
jmxPort: {{ .Values.jmx.port }}
93+
- name: jmx-rmi
94+
jmxPort: {{ .Values.jmx.rmiPort }}
8795
- name: akka-remoting
8896
containerPort: 2552
8997
- name: akka-mgmt-http
9098
containerPort: 19999
99+
volumeMounts:
100+
- name: jmxremote-secret
101+
mountPath: "/conf/jmxremote.access"
102+
subPath: "jmxremote.access"
103+
- name: jmxremote-secret
104+
mountPath: "/conf/jmxremote.password"
105+
subPath: "jmxremote.password"
91106
{{- if .Values.controller.lean }}
92107
{{ include "openwhisk.invoker.volume_mounts" . }}
93108
{{- end }}
@@ -127,7 +142,7 @@ spec:
127142

128143
# Java options
129144
- name: "JAVA_OPTS"
130-
value: "-Xmx{{- .Values.controller.jvmHeapMB -}}M {{ .Values.controller.jvmOptions }}"
145+
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 }}"
131146

132147
# specific controller arguments
133148
- name: "CONTROLLER_OPTS"

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ spec:
6868
tolerations:
6969
{{ include "openwhisk.toleration.invoker" . | indent 8 }}
7070
{{- end }}
71-
71+
volumes:
72+
- name: jmxremote-secret
73+
secret:
74+
secretName: {{ .Release.Name }}-jmxremote-secret
7275
{{ include "openwhisk.invoker.volumes" . }}
7376

7477
initContainers:
@@ -138,7 +141,7 @@ spec:
138141

139142
# Java options
140143
- name: "JAVA_OPTS"
141-
value: "-Xmx{{- .Values.invoker.jvmHeapMB -}}M {{ .Values.invoker.jvmOptions }}"
144+
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 }}"
142145

143146
# Invoker options
144147
- name: "INVOKER_OPTS"
@@ -214,5 +217,16 @@ spec:
214217
ports:
215218
- name: invoker
216219
containerPort: {{ .Values.invoker.port }}
220+
- name: jmx
221+
jmxPort: {{ .Values.jmx.port }}
222+
- name: jmx-rmi
223+
jmxPort: {{ .Values.jmx.rmiPort }}
224+
volumeMounts:
225+
- name: jmxremote-secret
226+
mountPath: "/conf/jmxremote.access"
227+
subPath: "jmxremote.access"
228+
- name: jmxremote-secret
229+
mountPath: "/conf/jmxremote.password"
230+
subPath: "jmxremote.password"
217231
{{ include "openwhisk.invoker.volume_mounts" . }}
218232
{{- 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
@@ -289,6 +289,15 @@ invoker:
289289
isolateUserActions: true
290290
replicaCount: 1
291291

292+
# JMX configurations
293+
jmx:
294+
enabled: false
295+
port: 15000
296+
rmiPort: 16000
297+
user: "jmxuser"
298+
pass: "jmxpass"
299+
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"
300+
292301
# API Gateway configurations
293302
apigw:
294303
imageName: "openwhisk/apigateway"

0 commit comments

Comments
 (0)