config seg vid deployment 09/28409/5
authorPramod <pramod.kumarsharma@amdocs.com>
Wed, 17 Jan 2018 12:36:06 +0000 (12:36 +0000)
committerpramodksamdocs <pramod.kumarsharma@amdocs.com>
Fri, 2 Feb 2018 11:31:47 +0000 (11:31 +0000)
Issue-ID: OOM-559
Change-Id: I215f471b6711c8491d9381257c1b91ca3d21b8ed
Signed-off-by: Pramod <pramod.kumarsharma@amdocs.com>
kubernetes/vid/resources/config/lf_config/vid-my.cnf [moved from kubernetes/config/docker/init/src/config/vid/vid/lf_config/vid-my.cnf with 100% similarity]
kubernetes/vid/resources/config/lf_config/vid-pre-init.sql [moved from kubernetes/config/docker/init/src/config/vid/vid/lf_config/vid-pre-init.sql with 100% similarity]
kubernetes/vid/resources/config/log/filebeat/filebeat.yml [new file with mode: 0644]
kubernetes/vid/resources/config/log/vid/logback.xml [moved from kubernetes/config/docker/init/src/config/log/vid/logback.xml with 100% similarity]
kubernetes/vid/templates/vid-lfconfig-configmap.yaml [new file with mode: 0644]
kubernetes/vid/templates/vid-log-configmap.yaml [new file with mode: 0644]
kubernetes/vid/templates/vid-mariadb-deployment.yaml
kubernetes/vid/templates/vid-server-deployment.yaml

diff --git a/kubernetes/vid/resources/config/log/filebeat/filebeat.yml b/kubernetes/vid/resources/config/log/filebeat/filebeat.yml
new file mode 100644 (file)
index 0000000..f316b86
--- /dev/null
@@ -0,0 +1,41 @@
+filebeat.prospectors:
+#it is mandatory, in our case it's log
+- input_type: log
+  #This is the canolical path as mentioned in logback.xml, *.* means it will monitor all files in the directory.
+  paths:
+    - /var/log/onap/*/*/*/*.log
+    - /var/log/onap/*/*/*.log
+    - /var/log/onap/*/*.log
+  #Files older than this should be ignored.In our case it will be 48 hours i.e. 2 days. It is a helping flag for clean_inactive
+  ignore_older: 48h
+  # Remove the registry entry for a file that is more than the specified time. In our case it will be 96 hours, i.e. 4 days. It will help to keep registry records with in limit
+  clean_inactive: 96h
+
+
+# Name of the registry file. If a relative path is used, it is considered relative to the
+# data path. Else full qualified file name.
+#filebeat.registry_file: ${path.data}/registry
+
+
+output.logstash:
+  #List of logstash server ip addresses with port number.
+  #But, in our case, this will be the loadbalancer IP address.
+  #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately.
+  hosts: ["logstash.onap-log:5044"]
+  #If enable will do load balancing among availabe Logstash, automatically.
+  loadbalance: true
+
+  #The list of root certificates for server verifications.
+  #If certificate_authorities is empty or not set, the trusted
+  #certificate authorities of the host system are used.
+  #ssl.certificate_authorities: $ssl.certificate_authorities
+
+  #The path to the certificate for SSL client authentication. If the certificate is not specified,
+  #client authentication is not available.
+  #ssl.certificate: $ssl.certificate
+
+  #The client certificate key used for client authentication.
+  #ssl.key: $ssl.key
+
+  #The passphrase used to decrypt an encrypted key stored in the configured key file
+  #ssl.key_passphrase: $ssl.key_passphrase
diff --git a/kubernetes/vid/templates/vid-lfconfig-configmap.yaml b/kubernetes/vid/templates/vid-lfconfig-configmap.yaml
new file mode 100644 (file)
index 0000000..1cc3f21
--- /dev/null
@@ -0,0 +1,9 @@
+#{{ if not .Values.disableVidVidMariadb }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: vid-lfconfig-configmap
+  namespace: {{ .Values.nsPrefix }}-vid
+data:
+{{ tpl (.Files.Glob "resources/config/lf_config/*").AsConfig . | indent 2 }}
+#{{ end }}
diff --git a/kubernetes/vid/templates/vid-log-configmap.yaml b/kubernetes/vid/templates/vid-log-configmap.yaml
new file mode 100644 (file)
index 0000000..00481d2
--- /dev/null
@@ -0,0 +1,17 @@
+#{{ if not .Values.disableVidVidServer }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: vid-log-configmap
+  namespace: {{ .Values.nsPrefix }}-vid
+data:
+{{ tpl (.Files.Glob "resources/config/log/vid/*").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: vid-filebeat-configmap
+  namespace: {{ .Values.nsPrefix }}-vid
+data:
+{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
+#{{ end }}
index 55ef5da..758ee57 100644 (file)
@@ -36,9 +36,11 @@ spec:
         - mountPath: /var/lib/mysql
           name: vid-mariadb-data
         - mountPath: /docker-entrypoint-initdb.d/vid-pre-init.sql
-          name: vid-pre-init
+          name: vid-lfconfig
+          subPath: vid-pre-init.sql
         - mountPath: /etc/mysql/my.cnf
-          name: my-cnf
+          name: vid-lfconfig
+          subPath: my.cnf
         ports:
         - containerPort: 3306
         readinessProbe:
@@ -53,12 +55,15 @@ spec:
         - name: vid-mariadb-data
           persistentVolumeClaim:
             claimName: vid-db
-        - name: vid-pre-init
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/vid/vid/lf_config/vid-pre-init.sql
-        - name: my-cnf
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/vid/vid/lf_config/vid-my.cnf
+        - name: vid-lfconfig
+          configMap:
+            name: vid-lfconfig-configmap
+            defaultMode: 0755
+            items:
+            - key: vid-my.cnf
+              path: my.cnf
+            - key: vid-pre-init.sql
+              path: vid-pre-init.sql
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
-#{{ end }}
\ No newline at end of file
+#{{ end }}
index 832fdeb..c979845 100644 (file)
@@ -73,7 +73,7 @@ spec:
           value: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
         - name: VID_MYSQL_MAXCONNECTIONS
           value: "5"
-        image: {{ .Values.image.vid }} 
+        image: {{ .Values.image.vid }}
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: vid-server
         lifecycle:
@@ -90,6 +90,7 @@ spec:
           name: vid-logs
         - mountPath: /tmp/logback.xml
           name: vid-logback
+          subPath: logback.xml
         readinessProbe:
           tcpSocket:
             port: 8080
@@ -101,6 +102,7 @@ spec:
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
           name: filebeat-conf
+          subPath: filebeat.yml
         - mountPath: /var/log/onap
           name: vid-logs
         - mountPath: /usr/share/filebeat/data
@@ -110,15 +112,15 @@ spec:
           hostPath:
             path: /etc/localtime
         - name: filebeat-conf
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+          configMap:
+            name: vid-filebeat-configmap
         - name: vid-logs
           emptyDir: {}
         - name: vid-data-filebeat
           emptyDir: {}
         - name: vid-logback
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/vid/logback.xml
+          configMap:
+            name: vid-log-configmap
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
 #{{ end }}