[VFC] Use log template 92/125792/1
authorMaciej Wereski <m.wereski@partner.samsung.com>
Thu, 18 Nov 2021 15:28:05 +0000 (16:28 +0100)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Thu, 18 Nov 2021 15:28:05 +0000 (16:28 +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: Ib3389c8e2f9221683862d3482c82f73f7f637441

17 files changed:
kubernetes/vfc/components/vfc-generic-vnfm-driver/templates/deployment.yaml
kubernetes/vfc/components/vfc-generic-vnfm-driver/values.yaml
kubernetes/vfc/components/vfc-huawei-vnfm-driver/templates/deployment.yaml
kubernetes/vfc/components/vfc-huawei-vnfm-driver/values.yaml
kubernetes/vfc/components/vfc-nslcm/templates/deployment.yaml
kubernetes/vfc/components/vfc-nslcm/values.yaml
kubernetes/vfc/components/vfc-vnflcm/templates/deployment.yaml
kubernetes/vfc/components/vfc-vnflcm/values.yaml
kubernetes/vfc/components/vfc-vnfmgr/templates/deployment.yaml
kubernetes/vfc/components/vfc-vnfmgr/values.yaml
kubernetes/vfc/components/vfc-vnfres/templates/deployment.yaml
kubernetes/vfc/components/vfc-vnfres/values.yaml
kubernetes/vfc/components/vfc-zte-vnfm-driver/templates/deployment.yaml
kubernetes/vfc/components/vfc-zte-vnfm-driver/values.yaml
kubernetes/vfc/resources/config/log/filebeat/filebeat.yml [moved from kubernetes/vfc/resources/config/logging/filebeat/filebeat.yml with 100% similarity]
kubernetes/vfc/templates/configmap.yaml
kubernetes/vfc/values.yaml

index c910f47..d5a043d 100644 (file)
@@ -69,7 +69,7 @@ spec:
             mountPath: /etc/localtime
             readOnly: true
           - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
+            mountPath: "{{ .Values.log.path }}"
           - name: {{ include "common.fullname" . }}-logconfig
             mountPath: /opt/vfc/gvnfmdriver/config/log.yml
             subPath: log.yml
@@ -85,18 +85,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -106,11 +95,6 @@ spec:
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
-
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index dcdcef8..d92989d 100644 (file)
@@ -85,3 +85,8 @@ resources:
       cpu: 200m
       memory: 500Mi
   unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 4f74d1d..dd763b4 100644 (file)
@@ -72,7 +72,7 @@ spec:
             mountPath: /etc/localtime
             readOnly: true
           - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
+            mountPath: {{ .Values.log.path }}
           - name: {{ include "common.fullname" . }}-logconfig
             mountPath: /opt/vfc/hwvnfmdriver/config/log4j.properties
             subPath: log4j.properties
@@ -88,18 +88,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -109,11 +98,6 @@ spec:
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
-
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 548cab8..596a1cf 100644 (file)
@@ -86,4 +86,9 @@ resources:
     requests:
       cpu: 200m
       memory: 2000Mi
-  unlimited: {}
\ No newline at end of file
+  unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 17d8cc2..13c1705 100644 (file)
@@ -115,18 +115,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -136,11 +125,6 @@ spec:
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
-
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index be78200..21ff189 100644 (file)
@@ -104,3 +104,8 @@ resources:
       cpu: 200m
       memory: 500Mi
   unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 75968b2..69de15c 100644 (file)
@@ -99,7 +99,7 @@ spec:
             mountPath: /etc/localtime
             readOnly: true
           - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
+            mountPath: {{ .Values.log.path }}
           - name: {{ include "common.fullname" . }}-logconfig
             mountPath: /opt/vfc/gvnfm-vnflcm/config/log.yml
             subPath: log.yml
@@ -115,18 +115,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -136,11 +125,6 @@ spec:
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
-
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 9098b44..e4ae447 100644 (file)
@@ -104,3 +104,8 @@ resources:
       cpu: 200m
       memory: 500Mi
   unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index f9a8ba7..0ee0b93 100644 (file)
@@ -99,7 +99,7 @@ spec:
             mountPath: /etc/localtime
             readOnly: true
           - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
+            mountPath: {{ .Values.log.path }}
           - name: {{ include "common.fullname" . }}-logconfig
             mountPath: /opt/vfc/gvnfm-vnfmgr/config/log.yml
             subPath: log.yml
@@ -115,18 +115,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -137,10 +126,6 @@ spec:
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
 
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index f8a5b28..cc2becc 100644 (file)
@@ -103,3 +103,8 @@ resources:
       cpu: 200m
       memory: 500Mi
   unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 06258a0..a017815 100644 (file)
@@ -115,18 +115,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -136,11 +125,6 @@ spec:
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
-
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 74e5b21..68d66a6 100644 (file)
@@ -104,3 +104,8 @@ resources:
       cpu: 200m
       memory: 500Mi
   unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 8c24dd6..9dcba3b 100644 (file)
@@ -69,7 +69,7 @@ spec:
             mountPath: /etc/localtime
             readOnly: true
           - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
+            mountPath: {{ .Values.log.path }}
           - name: {{ include "common.fullname" . }}-logconfig
             mountPath: /opt/vfc/ztevnfmdriver/config/log.yml
             subPath: log.yml
@@ -85,18 +85,7 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
@@ -106,11 +95,6 @@ spec:
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
-
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 643c3fb..c6db92a 100644 (file)
@@ -84,4 +84,9 @@ resources:
     requests:
       cpu: 100m
       memory: 500Mi
-  unlimited: {}
\ No newline at end of file
+  unlimited: {}
+
+# Log configuration
+log:
+  path: /var/log/onap
+logConfigMapNamePrefix: '{{ include "common.fullname" . }}'
index 88fda22..e890b8d 100644 (file)
 # limitations under the License.
 */}}
 
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ include "common.release" . }}-vfc-filebeat-configmap
-  namespace: {{ include "common.namespace" . }}
-data:
-{{ tpl (.Files.Glob "resources/config/logging/filebeat/*").AsConfig . | indent 2 }}
\ No newline at end of file
+{{ include "common.log.configMap" . }}
index 64bd029..01d9eef 100644 (file)
@@ -35,6 +35,7 @@ global:
     service: mariadb-galera
     internalPort: 3306
     nameOverride: mariadb-galera
+  centralizedLoggingEnabled: true
 
 #################################################################
 # Secrets metaconfig
@@ -69,13 +70,16 @@ mariadb-galera: &localMariadb
 
 vfc-generic-vnfm-driver:
   enabled: true
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'
 
 vfc-huawei-vnfm-driver:
   enabled: true
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'
 
 vfc-nslcm:
   enabled: true
   mariadb-galera: *localMariadb
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'
 
 vfc-redis:
   enabled: true
@@ -83,14 +87,17 @@ vfc-redis:
 vfc-vnflcm:
   enabled: true
   mariadb-galera: *localMariadb
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'
 
 vfc-vnfmgr:
   enabled: true
   mariadb-galera: *localMariadb
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'
 
 vfc-vnfres:
   enabled: true
   mariadb-galera: *localMariadb
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'
 
 # sub-chart configuration
 vfc-workflow:
@@ -103,3 +110,4 @@ vfc-workflow-engine:
 
 vfc-zte-vnfm-driver:
   enabled: true
+  logConfigMapNamePrefix: '{{ include "common.release" . }}-vfc'