From f313ba956d64be9f997899af5df46b28bc087e19 Mon Sep 17 00:00:00 2001 From: mayankg2703 Date: Mon, 5 Feb 2018 09:01:02 +0000 Subject: [PATCH] config seg aai resources and traversal Issue-ID: OOM-658 Change-Id: I8878f202147edc419341fdc3bdafeb1ebc2eec1c Signed-off-by: mayankg2703 --- .../aai-data/chef-config/dev/.knife/solo.rb | 0 .../config}/aai-data/environments/README.md | 0 .../config}/aai-data/environments/simpledemo.json | 0 .../config}/aai-data/environments/solo.json | 0 .../aai/resources/config/log/filebeat/filebeat.yml | 41 ++++++++++++++++++++++ .../aai/templates/aai-filebeat-configmap.yaml | 9 +++++ .../aai/templates/aai-resources-deployment.yaml | 17 ++++++--- .../aai-resources-traversal-configmap.yaml | 17 +++++++++ .../aai/templates/aai-traversal-deployment.yaml | 17 ++++++--- 9 files changed, 91 insertions(+), 10 deletions(-) rename kubernetes/{config/docker/init/src/config/aai => aai/resources/config}/aai-data/chef-config/dev/.knife/solo.rb (100%) rename kubernetes/{config/docker/init/src/config/aai => aai/resources/config}/aai-data/environments/README.md (100%) rename kubernetes/{config/docker/init/src/config/aai => aai/resources/config}/aai-data/environments/simpledemo.json (100%) rename kubernetes/{config/docker/init/src/config/aai => aai/resources/config}/aai-data/environments/solo.json (100%) create mode 100644 kubernetes/aai/resources/config/log/filebeat/filebeat.yml create mode 100644 kubernetes/aai/templates/aai-filebeat-configmap.yaml create mode 100644 kubernetes/aai/templates/aai-resources-traversal-configmap.yaml diff --git a/kubernetes/config/docker/init/src/config/aai/aai-data/chef-config/dev/.knife/solo.rb b/kubernetes/aai/resources/config/aai-data/chef-config/dev/.knife/solo.rb similarity index 100% rename from kubernetes/config/docker/init/src/config/aai/aai-data/chef-config/dev/.knife/solo.rb rename to kubernetes/aai/resources/config/aai-data/chef-config/dev/.knife/solo.rb diff --git a/kubernetes/config/docker/init/src/config/aai/aai-data/environments/README.md b/kubernetes/aai/resources/config/aai-data/environments/README.md similarity index 100% rename from kubernetes/config/docker/init/src/config/aai/aai-data/environments/README.md rename to kubernetes/aai/resources/config/aai-data/environments/README.md diff --git a/kubernetes/config/docker/init/src/config/aai/aai-data/environments/simpledemo.json b/kubernetes/aai/resources/config/aai-data/environments/simpledemo.json similarity index 100% rename from kubernetes/config/docker/init/src/config/aai/aai-data/environments/simpledemo.json rename to kubernetes/aai/resources/config/aai-data/environments/simpledemo.json diff --git a/kubernetes/config/docker/init/src/config/aai/aai-data/environments/solo.json b/kubernetes/aai/resources/config/aai-data/environments/solo.json similarity index 100% rename from kubernetes/config/docker/init/src/config/aai/aai-data/environments/solo.json rename to kubernetes/aai/resources/config/aai-data/environments/solo.json diff --git a/kubernetes/aai/resources/config/log/filebeat/filebeat.yml b/kubernetes/aai/resources/config/log/filebeat/filebeat.yml new file mode 100644 index 0000000000..f316b866af --- /dev/null +++ b/kubernetes/aai/resources/config/log/filebeat/filebeat.yml @@ -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 index 0000000000..5a123a54a0 --- /dev/null +++ b/kubernetes/aai/templates/aai-filebeat-configmap.yaml @@ -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 }} diff --git a/kubernetes/aai/templates/aai-resources-deployment.yaml b/kubernetes/aai/templates/aai-resources-deployment.yaml index 7ff5e66ee2..5ca0c165df 100644 --- a/kubernetes/aai/templates/aai-resources-deployment.yaml +++ b/kubernetes/aai/templates/aai-resources-deployment.yaml @@ -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 index 0000000000..772c3a79c8 --- /dev/null +++ b/kubernetes/aai/templates/aai-resources-traversal-configmap.yaml @@ -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 }} diff --git a/kubernetes/aai/templates/aai-traversal-deployment.yaml b/kubernetes/aai/templates/aai-traversal-deployment.yaml index f659392935..fda0055d21 100644 --- a/kubernetes/aai/templates/aai-traversal-deployment.yaml +++ b/kubernetes/aai/templates/aai-traversal-deployment.yaml @@ -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 -- 2.16.6