Fix nodeSlector and Affinity for aai charts

Indentation problem. Correctly placed nodeSelector and Affinity
aligned with Contrainers in template.spec
common.resources do not need indent as indent 12 already present
in return value

Change-Id: Ie0e84fba2f18d903fdcc8bb8f6ff06a4785c0a75
Issue-ID: OOM-1541
Signed-off-by: Kranthi Guttikonda <kranthi.guttikonda@b-yond.com>
Signed-off-by: kranthikirang <kranthi.guttikonda@b-yond.com>
diff --git a/charts/aai-babel/templates/deployment.yaml b/charts/aai-babel/templates/deployment.yaml
index 5ac0792..d450678 100644
--- a/charts/aai-babel/templates/deployment.yaml
+++ b/charts/aai-babel/templates/deployment.yaml
@@ -98,15 +98,15 @@
             name: {{ include "common.fullname" . }}-config
             subPath: logback.xml
           resources:
-{{ include "common.resources" . | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
-{{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
+{{ include "common.resources" . }}
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
 
         # side car containers
         - name: filebeat-onap
diff --git a/charts/aai-champ/templates/deployment.yaml b/charts/aai-champ/templates/deployment.yaml
index aa9157f..cad071a 100644
--- a/charts/aai-champ/templates/deployment.yaml
+++ b/charts/aai-champ/templates/deployment.yaml
@@ -114,15 +114,15 @@
           - mountPath: /var/log/onap
             name: {{ include "common.fullname" . }}-logs
           resources:
-{{ include "common.resources" . | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
-{{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
+{{ include "common.resources" . }}
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
 
         # side car containers
         - name: filebeat-onap
diff --git a/charts/aai-data-router/templates/deployment.yaml b/charts/aai-data-router/templates/deployment.yaml
index a7ecbce..5c0d9b2 100644
--- a/charts/aai-data-router/templates/deployment.yaml
+++ b/charts/aai-data-router/templates/deployment.yaml
@@ -35,6 +35,14 @@
         release: {{ .Release.Name }}
       name: {{ include "common.name" . }}
     spec:
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
       initContainers:
       - command:
         - /bin/sh
@@ -120,7 +128,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
 
       # side car containers
       - name: filebeat-onap
@@ -136,6 +144,8 @@
           name: {{ include "common.fullname" . }}-logs
         - mountPath: /usr/share/filebeat/data
           name: aai-filebeat
+        resources:
+{{ include "common.resources" . }}
       volumes:
       - name: localtime
         hostPath:
diff --git a/charts/aai-elasticsearch/templates/deployment.yaml b/charts/aai-elasticsearch/templates/deployment.yaml
index 586d64f..14b896e 100644
--- a/charts/aai-elasticsearch/templates/deployment.yaml
+++ b/charts/aai-elasticsearch/templates/deployment.yaml
@@ -95,7 +95,7 @@
           - name: elasticsearch-data
             mountPath: /usr/share/elasticsearch/data
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/charts/aai-gizmo/templates/deployment.yaml b/charts/aai-gizmo/templates/deployment.yaml
index 0a30388..5b00ffe 100644
--- a/charts/aai-gizmo/templates/deployment.yaml
+++ b/charts/aai-gizmo/templates/deployment.yaml
@@ -105,15 +105,15 @@
             name: {{ include "common.fullname" . }}-logback-config
             subPath: logback.xml
           resources:
-{{ include "common.resources" . | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
-{{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
+{{ include "common.resources" . }}
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
 
         - name: filebeat-onap
           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
diff --git a/charts/aai-graphadmin/templates/deployment.yaml b/charts/aai-graphadmin/templates/deployment.yaml
index 869eac0..abb72f1 100644
--- a/charts/aai-graphadmin/templates/deployment.yaml
+++ b/charts/aai-graphadmin/templates/deployment.yaml
@@ -126,7 +126,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/charts/aai-graphadmin/templates/job.yaml b/charts/aai-graphadmin/templates/job.yaml
index cdcf2b1..eb33cc6 100644
--- a/charts/aai-graphadmin/templates/job.yaml
+++ b/charts/aai-graphadmin/templates/job.yaml
@@ -111,7 +111,7 @@
           subPath: {{ . }}
           {{ end }}
         resources:
-{{ include "common.resources" . | indent 10 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/charts/aai-modelloader/templates/deployment.yaml b/charts/aai-modelloader/templates/deployment.yaml
index 3a81168..f34693f 100644
--- a/charts/aai-modelloader/templates/deployment.yaml
+++ b/charts/aai-modelloader/templates/deployment.yaml
@@ -35,6 +35,14 @@
         release: {{ .Release.Name }}
       name: {{ include "common.name" . }}
     spec:
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
       containers:
       - name: {{ include "common.name" . }}
         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
@@ -60,7 +68,7 @@
         - containerPort: {{ .Values.service.internalPort }}
         - containerPort: {{ .Values.service.internalPort2 }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
 
       # side car containers
       - name: filebeat-onap
@@ -74,6 +82,8 @@
           name: {{ include "common.fullname" . }}-logs
         - mountPath: /usr/share/filebeat/data
           name: aai-filebeat
+        resources:
+{{ include "common.resources" . }}
       volumes:
       - name: localtime
         hostPath:
diff --git a/charts/aai-resources/templates/deployment.yaml b/charts/aai-resources/templates/deployment.yaml
index 8d7b740..21e502d 100644
--- a/charts/aai-resources/templates/deployment.yaml
+++ b/charts/aai-resources/templates/deployment.yaml
@@ -544,7 +544,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
@@ -566,6 +566,8 @@
           name: {{ include "common.fullname" . }}-logs
         - mountPath: /usr/share/filebeat/data
           name: {{ include "common.fullname" . }}-filebeat
+        resources:
+{{ include "common.resources" . }}
     {{ if .Values.global.installSidecarSecurity }}
       - name: {{ .Values.global.rproxy.name }}
         image: "{{ include "common.repository" . }}/{{ .Values.global.rproxy.image }}"
diff --git a/charts/aai-search-data/templates/deployment.yaml b/charts/aai-search-data/templates/deployment.yaml
index e68a205..1d39d4e 100644
--- a/charts/aai-search-data/templates/deployment.yaml
+++ b/charts/aai-search-data/templates/deployment.yaml
@@ -93,7 +93,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/charts/aai-sparky-be/templates/deployment.yaml b/charts/aai-sparky-be/templates/deployment.yaml
index d622be6..0d9e85d 100644
--- a/charts/aai-sparky-be/templates/deployment.yaml
+++ b/charts/aai-sparky-be/templates/deployment.yaml
@@ -125,7 +125,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
@@ -147,6 +147,8 @@
           name: {{ include "common.fullname" . }}-logs
         - mountPath: /usr/share/filebeat/data
           name: aai-sparky-filebeat
+        resources:
+{{ include "common.resources" . }}
 
       volumes:
       - name: localtime
diff --git a/charts/aai-spike/templates/deployment.yaml b/charts/aai-spike/templates/deployment.yaml
index a3ff068..c962f1d 100644
--- a/charts/aai-spike/templates/deployment.yaml
+++ b/charts/aai-spike/templates/deployment.yaml
@@ -106,15 +106,15 @@
           - mountPath: /var/log/onap
             name: {{ include "common.fullname" . }}-logs
           resources:
-{{ include "common.resources" . | indent 12 }}
-        {{- if .Values.nodeSelector }}
-        nodeSelector:
-{{ toYaml .Values.nodeSelector | indent 10 }}
-        {{- end -}}
-        {{- if .Values.affinity }}
-        affinity:
-{{ toYaml .Values.affinity | indent 10 }}
-        {{- end }}
+{{ include "common.resources" . }}
+      {{- if .Values.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.nodeSelector | indent 8 }}
+      {{- end -}}
+      {{- if .Values.affinity }}
+      affinity:
+{{ toYaml .Values.affinity | indent 8 }}
+      {{- end }}
 
         # side car containers
         - name: filebeat-onap
@@ -128,6 +128,8 @@
             name: {{ include "common.fullname" . }}-logs
           - mountPath: /usr/share/filebeat/data
             name: aai-filebeat
+          resources:
+{{ include "common.resources" . }}
 
       volumes:
         - name: localtime
diff --git a/charts/aai-traversal/templates/deployment.yaml b/charts/aai-traversal/templates/deployment.yaml
index 834ab32..11950ad 100644
--- a/charts/aai-traversal/templates/deployment.yaml
+++ b/charts/aai-traversal/templates/deployment.yaml
@@ -358,7 +358,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ include "common.resources" . | indent 12 }}
+{{ include "common.resources" . }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
@@ -380,6 +380,8 @@
           name: {{ include "common.fullname" . }}-logs
         - mountPath: /usr/share/filebeat/data
           name: {{ include "common.fullname" . }}-filebeat
+        resources:
+{{ include "common.resources" . }}
       volumes:
       - name: localtime
         hostPath: