Skip to content

Commit

Permalink
[stable/metabase] Add log4jProperties (helm#11171)
Browse files Browse the repository at this point in the history
* Adding log4jProperties

Signed-off-by: Francisco Guimarães <[email protected]>

* Bump Chart version and metabase version

Signed-off-by: Francisco Guimarães <[email protected]>

* Adding necessary JAVA_TOOL_OPTIONS option when using log4jProperties

Signed-off-by: Francisco Guimarães <[email protected]>

* Replace javaToolOptions by javaOpts

Signed-off-by: Francisco Guimarães <[email protected]>

* Fix deployment chart

Signed-off-by: Francisco Guimarães <[email protected]>
  • Loading branch information
franciscocpg authored and k8s-ci-robot committed Mar 1, 2019
1 parent af554de commit 06c63b5
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stable/metabase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
description: The easy, open source way for everyone in your company to ask questions
and learn from data.
name: metabase
version: 0.4.6
version: 0.5.0
appVersion: v0.31.2
maintainers:
- name: pmint93
Expand Down
3 changes: 2 additions & 1 deletion stable/metabase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The following table lists the configurable parameters of the Metabase chart and
| password.length | Minimum length required for Metabase account's password | 6 |
| timeZone | Service time zone | UTC |
| emojiLogging | Get a funny emoji in service log | true |
| javaToolOptions | JVM options | null |
| javaOpts | JVM options | null |
| pluginsDirectory | A directory with Metabase plugins | null |
| service.type | ClusterIP, NodePort, or LoadBalancer | ClusterIP |
| service.externalPort | Service external port | 80 |
Expand All @@ -78,6 +78,7 @@ The following table lists the configurable parameters of the Metabase chart and
| ingress.labels | Ingress labels configuration | null |
| ingress.annotations | Ingress annotations configuration | null |
| ingress.tls | Ingress TLS configuration | null |
| log4jProperties | Custom `log4j.properties` file | null |
| resources | Server resource requests and limits | {} |

The above parameters map to the env variables defined in [metabase](http://github.com/metabase/metabase). For more information please refer to the [metabase documentations](http://www.metabase.com/docs/v0.24.2/).
Expand Down
14 changes: 14 additions & 0 deletions stable/metabase/templates/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "metabase.fullname" . }}-config
labels:
app: {{ template "metabase.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{- if .Values.log4jProperties }}
log4j.properties:
{{ toYaml .Values.log4jProperties | indent 4}}
{{- end}}
25 changes: 23 additions & 2 deletions stable/metabase/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
labels:
app: {{ template "metabase.name" . }}
release: {{ .Release.Name }}
Expand Down Expand Up @@ -81,9 +83,14 @@ spec:
value: {{ .Values.password.length | quote }}
- name: JAVA_TIMEZONE
value: {{ .Values.timeZone }}
{{- if .Values.javaToolOptions }}
{{- if .Values.javaOpts }}
- name: JAVA_OPTS
value: {{ .Values.javaToolOptions | quote }}
value: {{ .Values.javaOpts | quote }}
{{- else }}
{{- if .Values.log4jProperties }}
- name: JAVA_OPTS
value: "-Dlog4j.configuration=file:/tmp/conf/log4j.properties"
{{- end }}
{{- end }}
{{- if .Values.pluginsDirectory }}
- name: MB_PLUGINS_DIR
Expand All @@ -107,9 +114,23 @@ spec:
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 5
{{- if .Values.log4jProperties }}
volumeMounts:
- name: config
mountPath: /tmp/conf/
{{- end}}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
volumes:
{{- if .Values.log4jProperties}}
- name: config
configMap:
name: {{ template "metabase.fullname" . }}-config
items:
- key: log4j.properties
path: log4j.properties
{{- end }}
8 changes: 7 additions & 1 deletion stable/metabase/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ password:

timeZone: UTC
emojiLogging: true
# javaToolOptions:
# javaOpts:
# pluginsDirectory:

service:
Expand Down Expand Up @@ -74,6 +74,12 @@ ingress:
# - secretName: metabase-tls
# hosts:
# - metabase.domain.com

# A custom log4j.properties file can be provided using a multiline YAML string.
# See https://github.com/metabase/metabase/blob/master/resources/log4j.properties
#
# log4jProperties:

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down

0 comments on commit 06c63b5

Please sign in to comment.