Config seg sdc deployment 05/28405/8
authorPramod <pramod.kumarsharma@amdocs.com>
Wed, 17 Jan 2018 12:05:14 +0000 (12:05 +0000)
committerBorislavG <Borislav.Glozman@amdocs.com>
Wed, 7 Feb 2018 14:56:42 +0000 (14:56 +0000)
Issue-ID: OOM-550
Signed-off-by: Pramod <pramod.kumarsharma@amdocs.com>
Change-Id: Ibad8a16fb289ddd4260be5cce0c787e4de212a97

15 files changed:
kubernetes/sdc/resources/config/environments/AUTO.json [moved from kubernetes/config/docker/init/src/config/sdc/environments/AUTO.json with 100% similarity]
kubernetes/sdc/resources/config/environments/Template.json [moved from kubernetes/config/docker/init/src/config/sdc/environments/Template.json with 100% similarity]
kubernetes/sdc/resources/config/log/be/logback.xml [moved from kubernetes/config/docker/init/src/config/log/sdc/be/logback.xml with 100% similarity]
kubernetes/sdc/resources/config/log/fe/logback.xml [moved from kubernetes/config/docker/init/src/config/log/sdc/fe/logback.xml with 100% similarity]
kubernetes/sdc/resources/config/log/filebeat/filebeat.yml [new file with mode: 0644]
kubernetes/sdc/resources/config/sdc-fe/FE_2_setup_configuration.rb [moved from kubernetes/config/docker/init/src/config/sdc/sdc-fe/FE_2_setup_configuration.rb with 100% similarity]
kubernetes/sdc/templates/sdc-be.yaml
kubernetes/sdc/templates/sdc-cs.yaml
kubernetes/sdc/templates/sdc-environments-configmap.yaml [new file with mode: 0644]
kubernetes/sdc/templates/sdc-es.yaml
kubernetes/sdc/templates/sdc-fe-configmap.yaml [new file with mode: 0644]
kubernetes/sdc/templates/sdc-fe.yaml
kubernetes/sdc/templates/sdc-kb.yaml
kubernetes/sdc/templates/sdc-log-configmap.yaml [new file with mode: 0644]
kubernetes/sdc/values.yaml

diff --git a/kubernetes/sdc/resources/config/log/filebeat/filebeat.yml b/kubernetes/sdc/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
index 4156052..6485aa1 100644 (file)
@@ -89,27 +89,29 @@ spec:
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
           name: filebeat-conf
+          subPath: filebeat.yml
         - mountPath: /var/log/onap
           name: sdc-logs-2
         - mountPath: /usr/share/filebeat/data
           name: sdc-data-filebeat
       volumes:
         - name: filebeat-conf
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+          configMap:
+           name: sdc-filebeat-configmap
         - name: sdc-logs-2
           emptyDir: {}
         - name: sdc-data-filebeat
           emptyDir: {}
         - name: sdc-logback
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/sdc/be/logback.xml
+          configMap:
+            name : sdc-log-be-configmap
         - name: sdc-sdc-es-es
           hostPath:
             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
         - name: sdc-environments
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
+          configMap:
+            name: sdc-environments-configmap
+            defaultMode: 0755
         - name: sdc-localtime
           hostPath:
             path:  /etc/localtime
index a81d4ae..d70ead4 100644 (file)
@@ -67,8 +67,9 @@ spec:
           persistentVolumeClaim:
             claimName: sdc-cs-db
         - name: sdc-environments
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
+          configMap:
+            name : sdc-environments-configmap
+            defaultMode: 0755
         - name: sdc-localtime
           hostPath:
             path:  /etc/localtime
diff --git a/kubernetes/sdc/templates/sdc-environments-configmap.yaml b/kubernetes/sdc/templates/sdc-environments-configmap.yaml
new file mode 100644 (file)
index 0000000..f8456b0
--- /dev/null
@@ -0,0 +1,9 @@
+#{{ if not .Values.disableSdcSdcBe }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sdc-environments-configmap
+  namespace: {{ .Values.nsPrefix }}-sdc
+data:
+{{ tpl (.Files.Glob "resources/config/environments/*").AsConfig . | indent 2 }}
+#{{ end }}
index 1d2ba48..3f2ef33 100644 (file)
@@ -16,6 +16,20 @@ spec:
         app: sdc-es
       name: sdc-es
     spec:
+      initContainers:
+      - name: sdc-logs-init
+        image: {{ .Values.image.ubuntuInit }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        command:
+        - /bin/bash
+        - "-c"
+        - |
+          mkdir -p /ubuntu-init/ASDC/ASDC-ES/
+          mkdir -p /ubuntu-init/ASDC/ASDC-CS/
+          mkdir -p /ubuntu-init/ASDC/ASDC-KB/
+          mkdir -p /ubuntu-init/ASDC/ASDC-BE/
+          mkdir -p /ubuntu-init/ASDC/ASDC-FE/
+          chmod -R 777 /ubuntu-init/
       containers:
       - image: {{ .Values.image.sdcElasticsearch }}
         imagePullPolicy: {{ .Values.pullPolicy }}
@@ -30,6 +44,8 @@ spec:
         - name: ES_HEAP_SIZE
           value: "1024M"
         volumeMounts:
+        - name: sdc-logs
+          mountPath: /ubuntu-init/
         - mountPath: /root/chef-solo/environments/
           name: sdc-environments
         - mountPath: /etc/localtime
@@ -47,8 +63,9 @@ spec:
           periodSeconds: 10
       volumes:
         - name: sdc-environments
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
+          configMap :
+            name : sdc-environments-configmap
+            defaultMode: 0755
         - name: sdc-localtime
           hostPath:
             path:  /etc/localtime
diff --git a/kubernetes/sdc/templates/sdc-fe-configmap.yaml b/kubernetes/sdc/templates/sdc-fe-configmap.yaml
new file mode 100644 (file)
index 0000000..2f60ef8
--- /dev/null
@@ -0,0 +1,9 @@
+#{{ if not .Values.disableSdcSdcFe }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sdc-fe-configmap
+  namespace: {{ .Values.nsPrefix }}-sdc
+data:
+{{ tpl (.Files.Glob "resources/config/sdc-fe/*").AsConfig . | indent 2 }}
+#{{ end }}
index bc1777f..b4205ed 100644 (file)
@@ -62,6 +62,7 @@ spec:
           name: sdc-logs-2
         - mountPath: /root/chef-solo/cookbooks/sdc-catalog-fe/recipes/FE_2_setup_configuration.rb
           name: sdc-fe-config
+          subPath: FE_2_setup_configuration.rb
         - mountPath: /tmp/logback.xml
           name: sdc-logback
         lifecycle:
@@ -82,27 +83,29 @@ spec:
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
           name: filebeat-conf
+          subPath: filebeat.yml
         - mountPath: /var/log/onap
           name: sdc-logs-2
         - mountPath: /usr/share/filebeat/data
           name: sdc-data-filebeat
       volumes:
         - name: filebeat-conf
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+          configMap:
+           name : sdc-filebeat-configmap
         - name: sdc-logs-2
           emptyDir: {}
         - name: sdc-data-filebeat
           emptyDir: {}
         - name: sdc-logback
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/sdc/fe/logback.xml
+          configMap:
+           name : sdc-log-fe-configmap
         - name: sdc-sdc-es-es
           hostPath:
             path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-es/ES
         - name: sdc-environments
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
+          configMap:
+            name: sdc-environments-configmap
+            defaultMode: 0755
         - name: sdc-localtime
           hostPath:
             path:  /etc/localtime
@@ -110,8 +113,9 @@ spec:
           hostPath:
             path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/logs
         - name:  sdc-fe-config
-          hostPath:
-            path:  /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/sdc-fe/FE_2_setup_configuration.rb
+          configMap:
+            name: sdc-fe-configmap
+            defaultMode: 0755
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
 #{{ end }}
index a7334d4..658f6c1 100644 (file)
@@ -59,8 +59,9 @@ spec:
           periodSeconds: 10
       volumes:
         - name: sdc-environments
-          hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdc/environments
+          configMap:
+            name: sdc-environments-configmap
+            defaultMode: 0755
         - name: sdc-localtime
           hostPath:
             path:  /etc/localtime
diff --git a/kubernetes/sdc/templates/sdc-log-configmap.yaml b/kubernetes/sdc/templates/sdc-log-configmap.yaml
new file mode 100644 (file)
index 0000000..c79f9e0
--- /dev/null
@@ -0,0 +1,27 @@
+#{{ if not .Values.disableSdcSdcBe }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sdc-log-be-configmap
+  namespace: {{ .Values.nsPrefix }}-sdc
+data:
+{{ tpl (.Files.Glob "resources/config/log/be/*").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sdc-filebeat-configmap
+  namespace: {{ .Values.nsPrefix }}-sdc
+data:
+{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
+#{{ end }}
+---
+#{{ if not .Values.disableSdcSdcFe }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sdc-log-fe-configmap
+  namespace: {{ .Values.nsPrefix }}-sdc
+data:
+{{ tpl (.Files.Glob "resources/config/log/fe/*").AsConfig . | indent 2 }}
+#{{ end }}
index 67f2810..1cc5dd0 100644 (file)
@@ -8,4 +8,5 @@ image:
   sdcElasticsearch: nexus3.onap.org:10001/openecomp/sdc-elasticsearch:v1.1.0
   sdcCassandra: nexus3.onap.org:10001/openecomp/sdc-cassandra:v1.1.0
   sdcBackend: nexus3.onap.org:10001/openecomp/sdc-backend:v1.1.0
-  filebeat: docker.elastic.co/beats/filebeat:5.5.0
\ No newline at end of file
+  filebeat: docker.elastic.co/beats/filebeat:5.5.0
+  ubuntuInit: oomk8s/ubuntu-init:1.0.0