[MULTICLOUD] Use log template 82/125782/1
authorMaciej Wereski <m.wereski@partner.samsung.com>
Wed, 17 Nov 2021 15:45:14 +0000 (16:45 +0100)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Wed, 17 Nov 2021 15:45:14 +0000 (16:45 +0100)
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 <m.wereski@partner.samsung.com>
Change-Id: I22bcac642e1f9607dc4e65e2b8b34c946b3c29cb

13 files changed:
kubernetes/multicloud/components/multicloud-fcaps/templates/deployment.yaml
kubernetes/multicloud/components/multicloud-fcaps/values.yaml
kubernetes/multicloud/components/multicloud-pike/templates/deployment.yaml
kubernetes/multicloud/components/multicloud-pike/values.yaml
kubernetes/multicloud/components/multicloud-starlingx/templates/deployment.yaml
kubernetes/multicloud/components/multicloud-starlingx/values.yaml
kubernetes/multicloud/components/multicloud-vio/templates/deployment.yaml
kubernetes/multicloud/components/multicloud-vio/values.yaml
kubernetes/multicloud/components/multicloud-windriver/templates/deployment.yaml
kubernetes/multicloud/components/multicloud-windriver/values.yaml
kubernetes/multicloud/templates/configmap.yaml
kubernetes/multicloud/templates/deployment.yaml
kubernetes/multicloud/values.yaml

index b438bf0..fc46a65 100644 (file)
@@ -60,7 +60,7 @@ spec:
          value: "{{ .Values.config.ssl_enabled }}"
        name: {{ include "common.name" . }}
        volumeMounts:
-       - mountPath: /var/log/onap
+       - mountPath: "{{ .Values.log.path }}"
          name: fcaps-log
        - mountPath: /opt/fcaps/fcaps/pub/config/log.yml
          name: fcaps-logconfig
@@ -86,17 +86,7 @@ spec:
          failureThreshold: {{ .Values.liveness.failureThreshold }}
        {{ end }}
      # side car containers
-     - image: {{ include "repositoryGenerator.image.logging" . }}
-       imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-       name: filebeat-onap
-       volumeMounts:
-       - mountPath: /usr/share/filebeat/filebeat.yml
-         name: filebeat-conf
-         subPath: filebeat.yml
-       - mountPath: /var/log/onap
-         name: fcaps-log
-       - mountPath: /usr/share/filebeat/data
-         name: fcaps-data-filebeat
+     {{ include "common.log.sidecar" . | nindent 5 }}
      - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.rabbitmq }}
        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
        name: rabbit-mq
@@ -104,11 +94,7 @@ spec:
      volumes:
      - name: fcaps-log
        emptyDir: {}
-     - name: fcaps-data-filebeat
-       emptyDir: {}
-     - name: filebeat-conf
-       configMap:
-         name: multicloud-filebeat-configmap
+     {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 5 }}
      - name: fcaps-logconfig
        configMap:
          name: {{ include "common.fullname" . }}-log-configmap
index 39ddbae..b664498 100644 (file)
@@ -95,3 +95,8 @@ serviceAccount:
   nameOverride: multicloud-fcaps
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index d12e663..ebebaac 100644 (file)
@@ -60,7 +60,7 @@ spec:
          value: "{{ .Values.config.ssl_enabled }}"
        name: {{ include "common.name" . }}
        volumeMounts:
-       - mountPath: /var/log/onap
+       - mountPath: "{{ .Values.log.path }}"
          name: pike-log
        - mountPath: /opt/pike/pike/pub/config/log.yml
          name: pike-logconfig
@@ -88,26 +88,12 @@ spec:
          failureThreshold: {{ .Values.liveness.failureThreshold }}
        {{ end }}
      # side car containers
-     - image: {{ include "repositoryGenerator.image.logging" . }}
-       imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-       name: filebeat-onap
-       volumeMounts:
-       - mountPath: /usr/share/filebeat/filebeat.yml
-         name: filebeat-conf
-         subPath: filebeat.yml
-       - mountPath: /var/log/onap
-         name: pike-log
-       - mountPath: /usr/share/filebeat/data
-         name: pike-data-filebeat
+     {{ include "common.log.sidecar" . | nindent 5 }}
      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
      volumes:
      - name: pike-log
        emptyDir: {}
-     - name: pike-data-filebeat
-       emptyDir: {}
-     - name: filebeat-conf
-       configMap:
-         name: multicloud-filebeat-configmap
+     {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix"  (tpl .Values.logConfigMapNamePrefix .)) | nindent 5 }}
      - name: pike-logconfig
        configMap:
          name: {{ include "common.fullname" . }}-log-configmap
index 5ef87f4..45c7309 100644 (file)
@@ -92,3 +92,8 @@ serviceAccount:
   nameOverride: multicloud-pike
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 7c39bb7..c9209a0 100644 (file)
@@ -60,7 +60,7 @@ spec:
           value: "{{ .Values.config.ssl_enabled }}"
         name: {{ include "common.name" . }}
         volumeMounts:
-        - mountPath: /var/log/onap
+        - mountPath: "{{ .Values.log.path }}"
           name: starlingx-log
         - mountPath: /opt/starlingx/starlingx/pub/config/log.yml
           name: starlingx-logconfig
@@ -87,17 +87,7 @@ spec:
           failureThreshold: {{ .Values.liveness.failureThreshold }}
         {{ end }}
       # side car containers
-      - image: {{ include "repositoryGenerator.image.logging" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: filebeat-onap
-        volumeMounts:
-        - mountPath: /usr/share/filebeat/filebeat.yml
-          name: filebeat-conf
-          subPath: filebeat.yml
-        - mountPath: /var/log/onap
-          name: starlingx-log
-        - mountPath: /usr/share/filebeat/data
-          name: starlingx-data-filebeat
+      {{ include "common.log.sidecar" . | nindent 7 }}
       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.artifactImage }}
         name: framework-artifactbroker
         command: ["/opt/app/distribution/bin/artifact-dist.sh"]
@@ -115,11 +105,7 @@ spec:
       volumes:
       - name: starlingx-log
         emptyDir: {}
-      - name: starlingx-data-filebeat
-        emptyDir: {}
-      - name: filebeat-conf
-        configMap:
-          name: multicloud-filebeat-configmap
+      {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 7 }}
       - name: starlingx-logconfig
         configMap:
           name: {{ include "common.fullname" . }}-log-configmap
index 69e4d94..f18a090 100644 (file)
@@ -94,3 +94,8 @@ serviceAccount:
   nameOverride: multicloud-starlingx
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 5548359..1d27d6e 100644 (file)
@@ -57,7 +57,7 @@ spec:
          value: "{{ .Values.config.aai.password }}"
        name: {{ include "common.name" . }}
        volumeMounts:
-       - mountPath: /var/log/onap
+       - mountPath: "{{ .Values.log.path }}"
          name: vio-log
        - mountPath: /opt/vio/vio/pub/config/log.yml
          name: vio-logconfig
@@ -83,26 +83,12 @@ spec:
          failureThreshold: {{ .Values.liveness.failureThreshold }}
        {{ end -}}
        # side car containers
-     - image: {{ include "repositoryGenerator.image.logging" . }}
-       imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-       name: filebeat-onap
-       volumeMounts:
-       - mountPath: /usr/share/filebeat/filebeat.yml
-         name: filebeat-conf
-         subPath: filebeat.yml
-       - mountPath: /var/log/onap
-         name: vio-log
-       - mountPath: /usr/share/filebeat/data
-         name: vio-data-filebeat
+     {{ include "common.log.sidecar" . | nindent 5 }}
      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
      volumes:
      - name: vio-log
        emptyDir: {}
-     - name: vio-data-filebeat
-       emptyDir: {}
-     - name: filebeat-conf
-       configMap:
-         name: multicloud-filebeat-configmap
+     {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 5 }}
      - name: vio-logconfig
        configMap:
          name: {{ include "common.fullname" . }}-log-configmap
index 5b218f1..17643ba 100644 (file)
@@ -91,3 +91,8 @@ serviceAccount:
   nameOverride: multicloud-vio
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index f46e450..dfb4bbc 100644 (file)
@@ -69,7 +69,7 @@ spec:
           value: "{{ .Values.config.ssl_enabled }}"
         name: {{ include "common.name" . }}
         volumeMounts:
-        - mountPath: /var/log/onap
+        - mountPath: "{{ .Values.log.path }}"
           name: windriver-log
         - mountPath: /opt/windriver/titanium_cloud/pub/config/log.yml
           name: windriver-logconfig
@@ -96,17 +96,7 @@ spec:
           failureThreshold: {{ .Values.liveness.failureThreshold }}
         {{ end }}
       # side car containers
-      - image: {{ include "repositoryGenerator.image.logging" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: filebeat-onap
-        volumeMounts:
-        - mountPath: /usr/share/filebeat/filebeat.yml
-          name: filebeat-conf
-          subPath: filebeat.yml
-        - mountPath: /var/log/onap
-          name: windriver-log
-        - mountPath: /usr/share/filebeat/data
-          name: windriver-data-filebeat
+      {{ include "common.log.sidecar" . | nindent 7 }}
       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.artifactImage }}
         name: framework-artifactbroker
         command: ["/opt/app/distribution/bin/artifact-dist.sh"]
@@ -124,11 +114,7 @@ spec:
       volumes:
       - name: windriver-log
         emptyDir: {}
-      - name: windriver-data-filebeat
-        emptyDir: {}
-      - name: filebeat-conf
-        configMap:
-          name: multicloud-filebeat-configmap
+      {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 7 }}
       - name: windriver-logconfig
         configMap:
           name: {{ include "common.fullname" . }}-log-configmap
index d520a78..802659f 100644 (file)
@@ -103,3 +103,8 @@ serviceAccount:
   nameOverride: multicloud-windriver
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 0800fbe..c76f531 100644 (file)
 # limitations under the License.
 */}}
 
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: multicloud-filebeat-configmap
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-data:
-{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
+{{ include "common.log.configMap" . }}
 ---
 apiVersion: v1
 kind: ConfigMap
index 34fe622..53716e5 100644 (file)
@@ -63,7 +63,7 @@ spec:
        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
        name: {{ include "common.name" . }}
        volumeMounts:
-       - mountPath: /var/log/onap
+       - mountPath: "{{ .Values.log.path }}"
          name: framework-log
        - mountPath: /opt/multivimbroker/multivimbroker/pub/config/log.yml
          name: framework-logconfig
@@ -89,17 +89,7 @@ spec:
        {{ end -}}
 
       # side car containers
-     - image: {{ include "repositoryGenerator.image.logging" . }}
-       imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-       name: filebeat-onap
-       volumeMounts:
-       - mountPath: /usr/share/filebeat/filebeat.yml
-         name: filebeat-conf
-         subPath: filebeat.yml
-       - mountPath: /var/log/onap
-         name: framework-log
-       - mountPath: /usr/share/filebeat/data
-         name: framework-data-filebeat
+     {{ include "common.log.sidecar" . | nindent 5 }}
      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
      volumes:
      - name: framework-log
@@ -107,11 +97,7 @@ spec:
      - name: provider-plugin
        configMap:
          name: {{ include "common.fullname" . }}-provider-plugin-configmap
-     - name: framework-data-filebeat
-       emptyDir: {}
-     - name: filebeat-conf
-       configMap:
-         name: multicloud-filebeat-configmap
+     {{ include "common.log.volumes" . | nindent 5 }}
      - name: framework-logconfig
        configMap:
          name: {{ include "common.fullname" . }}-log-configmap
index 90e72be..4f946a7 100644 (file)
@@ -22,6 +22,7 @@ global:
   prometheus:
     enabled: false
   persistence: {}
+  centralizedLoggingEnabled: true
 
 #################################################################
 # Application configuration defaults.
@@ -35,18 +36,23 @@ istioSidecar: true
 
 multicloud-fcaps:
   enabled: true
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-multicloud'
 multicloud-k8s:
   enabled: true
 multicloud-pike:
   enabled: true
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-multicloud'
 multicloud-prometheus:
   enabled: false
 multicloud-starlingx:
   enabled: false
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-multicloud'
 multicloud-vio:
   enabled: false
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-multicloud'
 multicloud-windriver:
   enabled: false
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-multicloud'
 
 # application configuration
 config:
@@ -114,3 +120,7 @@ serviceAccount:
   nameOverride: multicloud
   roles:
     - read
+
+#Log configuration
+log:
+  path: /var/log/onap