aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/msb/charts/msb-discovery
diff options
context:
space:
mode:
authorLiZi <li.zi30@zte.com.cn>2018-04-09 07:34:04 -0400
committerLiZi <li.zi30@zte.com.cn>2018-04-09 07:34:16 -0400
commit4dd8e1197468f6ee883398006e92dc9e17dae21a (patch)
tree177f3c9b7a18621a42f70a7d2deb5d87e63e53e4 /kubernetes/msb/charts/msb-discovery
parent6cfff80ec93d4a4fa3bdeb5289a70c4296560db1 (diff)
Add a filebeat container to each service of MSB
Change-Id: I92bf908523d2b08a28c9d118b9efdc49dad56f6e Issue-ID: MSB-185 Signed-off-by: LiZi <li.zi30@zte.com.cn>
Diffstat (limited to 'kubernetes/msb/charts/msb-discovery')
-rw-r--r--kubernetes/msb/charts/msb-discovery/resources/config/log/logback.xml27
-rw-r--r--kubernetes/msb/charts/msb-discovery/templates/configmap.yaml7
-rw-r--r--kubernetes/msb/charts/msb-discovery/templates/deployment.yaml16
3 files changed, 50 insertions, 0 deletions
diff --git a/kubernetes/msb/charts/msb-discovery/resources/config/log/logback.xml b/kubernetes/msb/charts/msb-discovery/resources/config/log/logback.xml
new file mode 100644
index 0000000000..33775962b7
--- /dev/null
+++ b/kubernetes/msb/charts/msb-discovery/resources/config/log/logback.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration debug="true" scan="true" scanPeriod="3 seconds">
+ <!--<jmxConfigurator /> -->
+ <!-- specify the base path of the log directory -->
+ <property name="logDir" value="/var/log/onap" />
+ <!-- specify the component name -->
+ <property name="componentName" value="msb" />
+ <!-- specify the sub component name -->
+ <property name="subComponentName" value="discovery" />
+ <!-- The directories where logs are written -->
+ <property name="logDirectory" value="${logDir}/${componentName}/${subComponentName}" />
+ <property name="pattern" value="%d{&amp;quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&amp;quot;, UTC}\t[%thread]\t%-5level\t%logger{36}\t%replace(%replace(%replace(%mdc){'\t','\\\\t'}){', ','\t'}){'\n', '\\\\n'}\t%replace(%replace(%msg){'\n', '\\\\n'}){'\t','\\\\t'}%n" />
+ <!-- log file names -->
+ <property name="errorLogName" value="error" />
+ <property name="metricsLogName" value="metrics" />
+ <property name="auditLogName" value="audit" />
+ <property name="debugLogName" value="debug" />
+ <property name="queueSize" value="256" />
+ <property name="maxFileSize" value="50MB" />
+ <property name="maxHistory" value="30" />
+ <property name="totalSizeCap" value="10GB" />
+ <!-- Example evaluator filter applied against console appender -->
+ <appender class="ch.qos.logback.core.ConsoleAppender" name="STDOUT">
+ <encoder>
+ <pattern>${pattern}</pattern>
+ </encoder>
+ </appender> \ No newline at end of file
diff --git a/kubernetes/msb/charts/msb-discovery/templates/configmap.yaml b/kubernetes/msb/charts/msb-discovery/templates/configmap.yaml
new file mode 100644
index 0000000000..97c720a6ab
--- /dev/null
+++ b/kubernetes/msb/charts/msb-discovery/templates/configmap.yaml
@@ -0,0 +1,7 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ include "common.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
+data:
+{{ tpl (.Files.Glob "resources/config/log/logback.xml").AsConfig . | indent 2 }}
diff --git a/kubernetes/msb/charts/msb-discovery/templates/deployment.yaml b/kubernetes/msb/charts/msb-discovery/templates/deployment.yaml
index 0fb2cc6604..b2660052dd 100644
--- a/kubernetes/msb/charts/msb-discovery/templates/deployment.yaml
+++ b/kubernetes/msb/charts/msb-discovery/templates/deployment.yaml
@@ -58,6 +58,8 @@ spec:
- mountPath: /etc/localtime
name: localtime
readOnly: true
+ - mountPath: /usr/local/discover-works/logs
+ name: msb-discovery-logs
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- if .Values.nodeSelector }}
@@ -68,9 +70,23 @@ spec:
affinity:
{{ toYaml .Values.affinity | indent 10 }}
{{- end }}
+
+ # side car containers
+ - name: filebeat-onap
+ image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
+ imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ volumeMounts:
+ - mountPath: /var/log/onap
+ name: msb-discovery-logs
+ - mountPath: /usr/share/filebeat/data
+ name: msb-discovery-filebeat
volumes:
- name: localtime
hostPath:
path: /etc/localtime
+ - name: msb-discovery-logs
+ emptyDir: {}
+ - name: msb-discovery-filebeat
+ emptyDir: {}
imagePullSecrets:
- name: "{{ include "common.namespace" . }}-docker-registry-key"