diff --git a/template/deploy/helm/[[operator]]/templates/_telemetry.tpl.j2 b/template/deploy/helm/[[operator]]/templates/_telemetry.tpl.j2 index ccf5b5cf..ed44aea0 100644 --- a/template/deploy/helm/[[operator]]/templates/_telemetry.tpl.j2 +++ b/template/deploy/helm/[[operator]]/templates/_telemetry.tpl.j2 @@ -1,3 +1,10 @@ +{{/* +Used by FILE_LOG_DIRECTORY and the log volume mount in deployment.yaml, which have to agree. +*/}} +{{- define "{[ operator.name }].telemetry.fileLogDirectory" -}} +/var/log/{{ include "{[ operator.name }].appname" . }} +{{- end }} + {{/* Create a list of telemetry related env vars. */}} @@ -17,7 +24,7 @@ Create a list of telemetry related env vars. {{ end }} {{- if .fileLog.enabled }} - name: FILE_LOG_DIRECTORY - value: /stackable/logs/{{ include "{[ operator.name }].appname" $ }} + value: {{ include "{[ operator.name }].telemetry.fileLogDirectory" $ }} {{- end }} {{- if and .fileLog.enabled .fileLog.level }} - name: FILE_LOG_LEVEL diff --git a/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 b/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 index 288cfcae..34359254 100644 --- a/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 +++ b/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 @@ -103,6 +103,11 @@ spec: periodSeconds: 3 failureThreshold: 30 timeoutSeconds: 3 + {{- if .Values.telemetry.fileLog.enabled }} + volumeMounts: + - name: log + mountPath: {{ include "{[ operator.name }].telemetry.fileLogDirectory" . }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} @@ -118,6 +123,11 @@ spec: {{- with .Values.priorityClassName }} priorityClassName: {{ . }} {{- end }} + {{- if .Values.telemetry.fileLog.enabled }} + volumes: + - name: log + emptyDir: {} + {{- end }} {[% else %}] # Templated Deployment disabled for this operator {[% endif %}]