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

Support JMX option #667

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 8 additions & 10 deletions helm/openwhisk/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -292,23 +292,21 @@ imagePullSecrets:
{{/* Environment variables required for invoker volumes configuration */}}
{{- define "openwhisk.invoker.volumes" -}}
{{- if eq .Values.invoker.containerFactory.impl "docker" }}
volumes:
{{ include "openwhisk.docker_volumes" . | indent 6 }}
- name: scripts-dir
configMap:
name: {{ .Release.Name }}-invoker-scripts
{{ include "openwhisk.docker_volumes" . }}
- name: scripts-dir
configMap:
name: {{ .Release.Name }}-invoker-scripts
{{- end }}
{{- end }}

{{/* Environment variables required for invoker volumes configuration */}}
{{- define "openwhisk.invoker.volume_mounts" -}}
{{- if (eq .Values.invoker.containerFactory.impl "docker") }}
volumeMounts:
{{ include "openwhisk.docker_volume_mounts" . | indent 8 }}
{{ include "openwhisk.docker_volume_mounts" . }}
{{- if .Values.invoker.containerFactory.networkConfig.dns.inheritInvokerConfig }}
- name: scripts-dir
mountPath: "/invoker-scripts/configureDNS.sh"
subPath: "configureDNS.sh"
- name: scripts-dir
mountPath: "/invoker-scripts/configureDNS.sh"
subPath: "configureDNS.sh"
{{- end }}
{{- end }}
{{- end }}
Expand Down
21 changes: 18 additions & 3 deletions helm/openwhisk/templates/controller-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ spec:
# The controller must wait for elasticsearch to be ready before it starts
{{ include "openwhisk.readiness.waitForElasticSearch" . | indent 6 }}
{{- end }}
volumes:
- name: jmxremote-secret
secret:
secretName: {{ .Release.Name }}-jmxremote-secret
# The lean controller requires invoker volumes mounts
{{- if .Values.controller.lean }}
{{ include "openwhisk.invoker.volumes" . }}
{{ include "openwhisk.invoker.volumes" . | indent 6 }}
{{- end }}
{{ include "openwhisk.docker.imagePullSecrets" . | indent 6 }}

Expand All @@ -84,12 +88,23 @@ spec:
ports:
- name: controller
containerPort: {{ .Values.controller.port }}
- name: jmx
jmxPort: {{ .Values.jmx.port }}
- name: jmx-rmi
jmxPort: {{ .Values.jmx.rmiPort }}
- name: akka-remoting
containerPort: 2552
- name: akka-mgmt-http
containerPort: 19999
volumeMounts:
- name: jmxremote-secret
mountPath: "/conf/jmxremote.access"
subPath: "jmxremote.access"
- name: jmxremote-secret
mountPath: "/conf/jmxremote.password"
subPath: "jmxremote.password"
{{- if .Values.controller.lean }}
{{ include "openwhisk.invoker.volume_mounts" . }}
{{ include "openwhisk.invoker.volume_mounts" . | indent 8 }}
{{- end }}
livenessProbe:
httpGet:
Expand Down Expand Up @@ -127,7 +142,7 @@ spec:

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

# specific controller arguments
- name: "CONTROLLER_OPTS"
Expand Down
22 changes: 18 additions & 4 deletions helm/openwhisk/templates/invoker-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ spec:
tolerations:
{{ include "openwhisk.toleration.invoker" . | indent 8 }}
{{- end }}

{{ include "openwhisk.invoker.volumes" . }}
volumes:
- name: jmxremote-secret
secret:
secretName: {{ .Release.Name }}-jmxremote-secret
{{ include "openwhisk.invoker.volumes" . | indent 6 }}

initContainers:
{{- if eq .Values.invoker.containerFactory.impl "docker" }}
Expand Down Expand Up @@ -138,7 +141,7 @@ spec:

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

# Invoker options
- name: "INVOKER_OPTS"
Expand Down Expand Up @@ -214,5 +217,16 @@ spec:
ports:
- name: invoker
containerPort: {{ .Values.invoker.port }}
{{ include "openwhisk.invoker.volume_mounts" . }}
- name: jmx
jmxPort: {{ .Values.jmx.port }}
- name: jmx-rmi
jmxPort: {{ .Values.jmx.rmiPort }}
volumeMounts:
- name: jmxremote-secret
mountPath: "/conf/jmxremote.access"
subPath: "jmxremote.access"
- name: jmxremote-secret
mountPath: "/conf/jmxremote.password"
subPath: "jmxremote.password"
{{ include "openwhisk.invoker.volume_mounts" . | indent 8 }}
{{- end }}
27 changes: 27 additions & 0 deletions helm/openwhisk/templates/jmx-remote-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-jmxremote-secret
labels:
{{ include "openwhisk.label_boilerplate" . | indent 4 }}
type: Opaque
data:
jmxremote.access: {{ (printf "%s %s" .Values.jmx.user "readwrite") | b64enc }}
jmxremote.password: {{ (printf "%s %s" .Values.jmx.user .Values.jmx.pass) | b64enc }}
9 changes: 9 additions & 0 deletions helm/openwhisk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ invoker:
isolateUserActions: true
replicaCount: 1

# JMX configurations
jmx:
enabled: false
port: 15000
rmiPort: 16000
user: "jmxuser"
pass: "jmxpass"
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"

# API Gateway configurations
apigw:
imageName: "openwhisk/apigateway"
Expand Down