Merge "config seg aai model loader"
authorAlexis de Talhouët <alexis.de_talhouet@bell.ca>
Tue, 6 Feb 2018 17:20:22 +0000 (17:20 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 6 Feb 2018 17:20:22 +0000 (17:20 +0000)
27 files changed:
kubernetes/aai/resources/config/aai-data/chef-config/dev/.knife/solo.rb [moved from kubernetes/config/docker/init/src/config/aai/aai-data/chef-config/dev/.knife/solo.rb with 100% similarity]
kubernetes/aai/resources/config/aai-data/environments/README.md [moved from kubernetes/config/docker/init/src/config/aai/aai-data/environments/README.md with 100% similarity]
kubernetes/aai/resources/config/aai-data/environments/simpledemo.json [moved from kubernetes/config/docker/init/src/config/aai/aai-data/environments/simpledemo.json with 100% similarity]
kubernetes/aai/resources/config/aai-data/environments/solo.json [moved from kubernetes/config/docker/init/src/config/aai/aai-data/environments/solo.json with 100% similarity]
kubernetes/aai/resources/config/log/filebeat/filebeat.yml [new file with mode: 0644]
kubernetes/aai/resources/config/sparky-be/appconfig/aai.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/aai.properties with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/auth/aai-os-cert.p12 [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/auth/aai-os-cert.p12 with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/auth/client-cert-onap.p12 [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/auth/client-cert-onap.p12 with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/auth/inventory-ui-keystore [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/auth/inventory-ui-keystore with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/elasticsearch.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/elasticsearch.properties with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/model/aai_oxm_v9.xml [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/model/aai_oxm_v9.xml with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/portal/portal-authentication.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/portal/portal-authentication.properties with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/portal/portal.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/portal/portal.properties with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/roles.config [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/roles.config with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/search-service.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/search-service.properties with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/suggestive-search.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/suggestive-search.properties with 100% similarity]
kubernetes/aai/resources/config/sparky-be/appconfig/synchronizer.properties [moved from kubernetes/config/docker/init/src/config/aai/sparky-be/appconfig/synchronizer.properties with 100% similarity]
kubernetes/aai/templates/aai-filebeat-configmap.yaml [new file with mode: 0644]
kubernetes/aai/templates/aai-resources-deployment.yaml
kubernetes/aai/templates/aai-resources-traversal-configmap.yaml [new file with mode: 0644]
kubernetes/aai/templates/aai-traversal-deployment.yaml
kubernetes/aai/templates/sparky-be-deployment-configmap.yaml [new file with mode: 0644]
kubernetes/aai/templates/sparky-be-deployment.yaml
kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-elastic-search.json [new file with mode: 0644]
kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-kibana.json [new file with mode: 0644]
kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-logstash.json [new file with mode: 0644]
kubernetes/config/prepull_docker.sh

diff --git a/kubernetes/aai/resources/config/log/filebeat/filebeat.yml b/kubernetes/aai/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/aai/templates/aai-filebeat-configmap.yaml b/kubernetes/aai/templates/aai-filebeat-configmap.yaml
new file mode 100644 (file)
index 0000000..5a123a5
--- /dev/null
@@ -0,0 +1,9 @@
+#{{ if not .Values.disableAaiAaiResources }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: aai-filebeat-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
+#{{ end }}
index 7ff5e66..5ca0c16 100644 (file)
@@ -50,7 +50,10 @@ spec:
         - mountPath: /etc/localtime
           name: localtime
           readOnly: true
-        - mountPath: /var/chef/aai-data/
+        - mountPath: /var/chef/aai-data/chef-config/dev/.knife/solo.rb
+          subPath: solo.rb
+          name: aai-chef-config
+        - mountPath: /var/chef/aai-data/environments/
           name: aai-data
         - mountPath: /var/log/onap
           name: aai-resources-logs
@@ -69,6 +72,7 @@ spec:
         imagePullPolicy: {{ .Values.pullPolicy }}
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
+          subPath: filebeat.yml
           name: filebeat-conf
         - mountPath: /var/log/onap
           name: aai-resources-logs
@@ -78,12 +82,15 @@ spec:
       - name: localtime
         hostPath:
           path: /etc/localtime
+      - name: aai-chef-config
+        configMap:
+          name: aai-chef-config-configmap
       - name: aai-data
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-data/"
+        configMap:
+          name: aai-resources-environments-configmap
       - name: filebeat-conf
-        hostPath:
-          path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+        configMap:
+          name: aai-filebeat-configmap
       - name: aai-resources-logs
         emptyDir: {}
       - name: aai-resources-filebeat
diff --git a/kubernetes/aai/templates/aai-resources-traversal-configmap.yaml b/kubernetes/aai/templates/aai-resources-traversal-configmap.yaml
new file mode 100644 (file)
index 0000000..772c3a7
--- /dev/null
@@ -0,0 +1,17 @@
+#{{ if not .Values.disableAaiAaiResources }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: aai-chef-config-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/aai-data/chef-config/dev/.knife/solo.rb").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: aai-resources-environments-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/aai-data/environments/*").AsConfig . | indent 2 }}
+#{{ end }}
index f659392..fda0055 100644 (file)
@@ -52,7 +52,10 @@ spec:
         - mountPath: /etc/localtime
           name: localtime
           readOnly: true
-        - mountPath: /var/chef/aai-data/
+        - mountPath: /var/chef/aai-data/chef-config/dev/.knife/solo.rb
+          subPath: solo.rb
+          name: aai-chef-config
+        - mountPath: /var/chef/aai-data/environments/
           name: aai-data
         - mountPath: /var/log/onap
           name: aai-traversal-logs
@@ -71,6 +74,7 @@ spec:
         imagePullPolicy: {{ .Values.pullPolicy }}
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
+          subPath: filebeat.yml
           name: filebeat-conf
         - mountPath: /var/log/onap
           name: aai-traversal-logs
@@ -80,12 +84,15 @@ spec:
       - name: localtime
         hostPath:
           path: /etc/localtime
+      - name: aai-chef-config
+        configMap:
+          name: aai-chef-config-configmap
       - name: aai-data
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-data/"
+        configMap:
+          name: aai-resources-environments-configmap
       - name: filebeat-conf
-        hostPath:
-          path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+        configMap:
+          name: aai-filebeat-configmap
       - name: aai-traversal-logs
         emptyDir: {}
       - name: aai-traversal-filebeat
diff --git a/kubernetes/aai/templates/sparky-be-deployment-configmap.yaml b/kubernetes/aai/templates/sparky-be-deployment-configmap.yaml
new file mode 100644 (file)
index 0000000..55dea65
--- /dev/null
@@ -0,0 +1,34 @@
+#{{ if not .Values.disableAaiSparkyBe }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sparky-be-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/*").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sparky-be-model-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/model/*").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: sparky-be-portal-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/portal/*").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: Secret
+metadata:
+  name: sparky-be-secret
+  namespace: {{ .Values.nsPrefix }}-aai
+type: Opaque
+data:
+{{ tpl (.Files.Glob "resources/config/sparky-be/appconfig/auth/*").AsSecrets . | indent 2 }}
+#{{ end }}
index 484a87f..dfeab6a 100644 (file)
@@ -29,8 +29,30 @@ spec:
         - mountPath: /etc/localtime
           name: localtime
           readOnly: true
-        - mountPath: /opt/app/sparky/config/
+        - mountPath: /opt/app/sparky/config/auth/
+          name: aai-sparky-be-auth-config
+        - mountPath: /opt/app/sparky/config/synchronizer.properties
+          subPath: synchronizer.properties
           name: aai-sparky-be-config
+        - mountPath: /opt/app/sparky/config/suggestive-search.properties
+          subPath: suggestive-search.properties
+          name: aai-sparky-be-config
+        - mountPath: /opt/app/sparky/config/search-service.properties
+          subPath: search-service.properties
+          name: aai-sparky-be-config
+        - mountPath: /opt/app/sparky/config/roles.config
+          subPath: roles.config
+          name: aai-sparky-be-config
+        - mountPath: /opt/app/sparky/config/elasticsearch.properties
+          subPath: elasticsearch.properties
+          name: aai-sparky-be-config
+        - mountPath: /opt/app/sparky/config/aai.properties
+          subPath: aai.properties
+          name: aai-sparky-be-config
+        - mountPath: /opt/app/sparky/config/model/
+          name: aai-sparky-be-model-config
+        - mountPath: /opt/app/sparky/config/portal/
+          name: aai-sparky-be-portal-config
         - mountPath: /var/log/onap
           name: aai-sparky-be-logs
         - mountPath: /opt/app/sparky/bundleconfig/etc/logback.xml
@@ -48,6 +70,7 @@ spec:
         imagePullPolicy: {{ .Values.pullPolicy }}
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
+          subPath: filebeat.yml
           name: filebeat-conf
         - mountPath: /var/log/onap
           name: aai-sparky-be-logs
@@ -58,11 +81,20 @@ spec:
         hostPath:
           path: /etc/localtime
       - name: aai-sparky-be-config
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/sparky-be/appconfig/"
+        configMap:
+          name: sparky-be-configmap
+      - name: aai-sparky-be-model-config
+        configMap:
+          name: sparky-be-model-configmap
+      - name: aai-sparky-be-portal-config
+        configMap:
+          name: sparky-be-portal-configmap
+      - name: aai-sparky-be-auth-config
+        secret:
+          secretName: sparky-be-secret
       - name: filebeat-conf
-        hostPath:
-          path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/logback/filebeat.yml
+        configMap:
+          name: aai-filebeat-configmap
       - name: aai-sparky-be-logs
         emptyDir: {}
       - name: aai-sparky-filebeat
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-elastic-search.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-elastic-search.json
new file mode 100644 (file)
index 0000000..7785502
--- /dev/null
@@ -0,0 +1,23 @@
+{
+  "service": {
+    "name": "Health Check: Log - Elastic Search",
+    "checks": [
+      {
+        "id": "log-elasticsearch-server",
+        "name": "Log Elastic Search Health Check",
+        "http": "http://elasticsearch.onap-log:9200/_cluster/health?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-elasticsearch-tcp",
+        "name": "Log Elastic Search TCP Health Check",
+        "tcp": "elasticsearchtcp.onap-log:9300",
+        "interval": "15s",
+        "timeout": "1s"
+      }
+    ]
+  }
+}
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-kibana.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-kibana.json
new file mode 100644 (file)
index 0000000..794fb4b
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  "service": {
+    "name": "Health Check: Log - Kibana",
+    "checks": [
+      {
+        "id": "log-kibana-server",
+        "name": "Log kibana Health Check",
+        "http": "http://kibana.onap-log:5601/status",
+        "method": "HEAD",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      }
+    ]
+  }
+}
diff --git a/kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-logstash.json b/kubernetes/config/docker/init/src/config/consul/consul-agent-config/log-logstash.json
new file mode 100644 (file)
index 0000000..3c0f450
--- /dev/null
@@ -0,0 +1,95 @@
+{
+  "service": {
+    "name": "Health Check: Log - Log Stash",
+    "checks": [
+      {
+        "id": "log-logstash-internal-server-gi",
+        "name": "Log Stash Health Check - General Information",
+        "http": "http://logstashinternal.onap-log:9600/?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-node-info",
+        "name": "Log Stash Health Check - Node Information",
+        "http": "http://logstashinternal.onap-log:9600/_node/?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-os-info",
+        "name": "Log Stash Health Check - OS Information",
+        "http": "http://logstashinternal.onap-log:9600/_node/os?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-jvm-info",
+        "name": "Log Stash Health Check - JVM Information",
+        "http": "http://logstashinternal.onap-log:9600/_node/jvm?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-plugin-info",
+        "name": "Log Stash Health Check - Plugin Information",
+        "http": "http://logstashinternal.onap-log:9600/_node/plugins?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-node-stat",
+        "name": "Log Stash Health Check - Node Stats",
+        "http": "http://logstashinternal.onap-log:9600/_node/stats?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-jvm-stat",
+        "name": "Log Stash Health Check - JVM Stats",
+        "http": "http://logstashinternal.onap-log:9600/_node/stats/jvm?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-process-stat",
+        "name": "Log Stash Health Check - Process Stats",
+        "http": "http://logstashinternal.onap-log:9600/_node/stats/process?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-internal-server-os-stat",
+        "name": "Log Stash Health Check - OS Stats",
+        "http": "http://logstashinternal.onap-log:9600/_node/stats/os?pretty",
+        "method": "GET",
+        "tls_skip_verify": true,
+        "interval": "15s",
+        "timeout": "1s"
+      },
+      {
+        "id": "log-logstash-tcp",
+        "name": "Log Stash File Beat TCP Health Check",
+        "tcp": "logstash.onap-log:5044",
+        "interval": "15s",
+        "timeout": "1s"
+      }
+    ]
+  }
+}
index e456c3e..ef46334 100755 (executable)
@@ -101,33 +101,32 @@ do
         #parse yaml files
         for line in  `parse_yaml $filename`
         do
-                #find all image subtag inside converted values.yaml file's lines
-                if echo $line | grep -q $IMAGE_TEXT ; then
-                        #find imageName inside line
-                        imageName=`echo $line | awk -F "=" '{print $2}'`
-                        #remove attional prefix and postfix
-                        imageNameFinal=`echo "$imageName" | sed -e 's/^"//' -e 's/"$//' `
-
-                        #check if line contain Version as a subtag in lines if yes then call docker pull with version
-                        if echo $line | grep -q $IMAGE_VERSION_TEXT ; then
-                                echo docker pull "$imageNameWithVersion":"$imageNameFinal"
-                                docker pull $imageNameWithVersion:$imageNameFinal &
-                                imageNameWithVersion=" "
-                        else
-                                #check Version is not in subtag and old scanned value is present then call docker pull without version
-                                if [ "$imageNameWithVersion" != " " ]; then
-                                        echo docker pull "$imageNameWithVersion"
-                                        docker pull $imageNameWithVersion &
-                                        imageNameWithVersion=$imageNameFinal
+                #skiping commented line
+                if [[ ${line:0:1} != '#' ]]; then
+                        #find all image subtag inside converted values.yaml file's lines
+                        if echo $line | grep -q $IMAGE_TEXT ; then
+                                #find imageName inside line
+                                imageName=`echo $line | awk -F "=" '{print $2}'`
+                                #remove attional prefix and postfix
+                                imageNameFinal=`echo "$imageName" | sed -e 's/^"//' -e 's/"$//' `
+
+                               #check if line contain Version as a subtag in lines if yes then call docker pull with version
+                                if echo $line | grep -q $IMAGE_VERSION_TEXT ; then
+                                        echo docker pull "$imageNameWithVersion":"$imageNameFinal"
+                                        docker pull $imageNameWithVersion:$imageNameFinal &
+                                        imageNameWithVersion=" "
                                 else
-                                        imageNameWithVersion=$imageNameFinal
+                                        #check Version is not in subtag and old scanned value is present then call docker pull without version
+                                        if [ "$imageNameWithVersion" != " " ]; then
+                                                echo docker pull "$imageNameWithVersion"
+                                                docker pull $imageNameWithVersion &
+                                                imageNameWithVersion=$imageNameFinal
+                                        else
+                                                imageNameWithVersion=$imageNameFinal
+                                        fi
                                 fi
                         fi
-
-
                 fi
-
-
         done
 done
 # complete processing