From d5d4a852c0f3255e7578c81ddf1b53ccea5552eb Mon Sep 17 00:00:00 2001 From: Maciej Wereski Date: Mon, 15 Nov 2021 15:19:11 +0100 Subject: [PORTAL] Use log template Ability to turn off filebeat is needed as it is being deprecated. To achieve that existing log helper template is used. Issue-ID: OOM-1 Signed-off-by: Maciej Wereski Change-Id: I7e8df12aaf8e68f12a56d097d8045eeb0924e428 --- .../components/portal-app/templates/deployment.yaml | 20 +++----------------- kubernetes/portal/components/portal-app/values.yaml | 5 +++++ .../components/portal-sdk/templates/deployment.yaml | 20 +++----------------- kubernetes/portal/components/portal-sdk/values.yaml | 5 +++++ 4 files changed, 16 insertions(+), 34 deletions(-) (limited to 'kubernetes/portal/components') diff --git a/kubernetes/portal/components/portal-app/templates/deployment.yaml b/kubernetes/portal/components/portal-app/templates/deployment.yaml index 39393efb59..db4454d5e5 100644 --- a/kubernetes/portal/components/portal-app/templates/deployment.yaml +++ b/kubernetes/portal/components/portal-app/templates/deployment.yaml @@ -158,7 +158,7 @@ spec: - name: properties-onapportal mountPath: "{{ .Values.global.env.tomcatDir }}/temp" - name: var-log-onap - mountPath: /var/log/onap + mountPath: "{{ .Values.log.path }}" resources: {{ include "common.resources" . }} {{- if .Values.nodeSelector }} @@ -169,17 +169,7 @@ spec: affinity: {{ toYaml .Values.affinity | indent 10 }} {{- end }} - - name: filebeat-onap - image: {{ include "repositoryGenerator.image.logging" . }} - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - name: filebeat-conf - subPath: filebeat.yml - - name: portal-data-filebeat - mountPath: /usr/share/filebeat/data - - name: var-log-onap - mountPath: /var/log/onap + {{ include "common.log.sidecar" . | nindent 6 }} volumes: {{ include "common.certInitializer.volumes" . | indent 8 }} - name: localtime @@ -192,13 +182,9 @@ spec: configMap: name: {{ include "common.fullname" . }}-onapportal defaultMode: 0755 - - name: filebeat-conf - configMap: - name: portal-filebeat + {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }} - name: var-log-onap emptyDir: {} - - name: portal-data-filebeat - emptyDir: {} - name: portal-tomcat-logs emptyDir: {} imagePullSecrets: diff --git a/kubernetes/portal/components/portal-app/values.yaml b/kubernetes/portal/components/portal-app/values.yaml index b46876ced9..6cf2513c44 100644 --- a/kubernetes/portal/components/portal-app/values.yaml +++ b/kubernetes/portal/components/portal-app/values.yaml @@ -166,3 +166,8 @@ resources: cpu: 2 memory: 8Gi unlimited: {} + +# Log configuration +log: + path: /var/log/onap +logConfigMapNamePrefix: '{{ include "common.fullname" . }}' diff --git a/kubernetes/portal/components/portal-sdk/templates/deployment.yaml b/kubernetes/portal/components/portal-sdk/templates/deployment.yaml index 95247b3dd2..abc5daab80 100644 --- a/kubernetes/portal/components/portal-sdk/templates/deployment.yaml +++ b/kubernetes/portal/components/portal-sdk/templates/deployment.yaml @@ -149,7 +149,7 @@ spec: - name: portal-tomcat-logs mountPath: "{{ .Values.global.env.tomcatDir }}/logs" - name: var-log-onap - mountPath: /var/log/onap + mountPath: "{{ .Values.log.path }}" resources: {{ include "common.resources" . }} {{- if .Values.nodeSelector }} @@ -160,17 +160,7 @@ spec: affinity: {{ toYaml .Values.affinity | indent 10 }} {{- end }} - - name: filebeat-onap - image: {{ include "repositoryGenerator.image.logging" . }} - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - volumeMounts: - - mountPath: /usr/share/filebeat/filebeat.yml - name: filebeat-conf - subPath: filebeat.yml - - name: portal-data-filebeat - mountPath: /usr/share/filebeat/data - - name: var-log-onap - mountPath: /var/log/onap + {{ include "common.log.sidecar" . | nindent 6 }} volumes: - name: localtime hostPath: @@ -182,13 +172,9 @@ spec: configMap: name: {{ include "common.fullname" . }}-onapportalsdk defaultMode: 0755 - - name: filebeat-conf - configMap: - name: portal-filebeat + {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 8 }} - name: var-log-onap emptyDir: {} - - name: portal-data-filebeat - emptyDir: {} - name: portal-tomcat-logs emptyDir: {} {{ include "common.certInitializer.volumes" . | indent 8 }} diff --git a/kubernetes/portal/components/portal-sdk/values.yaml b/kubernetes/portal/components/portal-sdk/values.yaml index 7631c3a482..f0c3954c11 100644 --- a/kubernetes/portal/components/portal-sdk/values.yaml +++ b/kubernetes/portal/components/portal-sdk/values.yaml @@ -161,3 +161,8 @@ resources: cpu: 4 memory: 10Gi unlimited: {} + +# Log configuration +log: + path: /var/log/onap +logConfigMapNamePrefix: '{{ include "common.fullname" . }}' -- cgit 1.2.3-korg