Fix: aai resource limits- charts except cassandra

Issue-ID: OOM-1147

Change-Id: I438d404b0717b5179857d3226590b28c0372848d
Signed-off-by: rajeshkalai <rajesh.kalaiselvan@amdocs.com>

Fix: request -resource limits for aai

Issue-ID: OOM-1147

Change-Id: I5898e2c6c6b4c6cc1c302c287b15f5697bf2e36b
Signed-off-by: rajeshkalai <rajesh.kalaiselvan@amdocs.com>
diff --git a/kubernetes/aai/charts/aai-babel/templates/deployment.yaml b/kubernetes/aai/charts/aai-babel/templates/deployment.yaml
index 7778324..2f8f60f 100644
--- a/kubernetes/aai/charts/aai-babel/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-babel/templates/deployment.yaml
@@ -85,7 +85,7 @@
             name: {{ include "common.fullname" . }}-config
             subPath: logback.xml
           resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
diff --git a/kubernetes/aai/charts/aai-babel/values.yaml b/kubernetes/aai/charts/aai-babel/values.yaml
index 7ba1c6b..01b4dfc 100644
--- a/kubernetes/aai/charts/aai-babel/values.yaml
+++ b/kubernetes/aai/charts/aai-babel/values.yaml
@@ -27,6 +27,8 @@
 # application image
 image: onap/babel:1.3-STAGING-latest
 
+flavor: small
+
 # application configuration
 config:
   keyStorePassword: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10
@@ -61,4 +63,18 @@
 ingress:
   enabled: false
 
-resources: {}
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 1
+      memory: 2Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-champ/templates/deployment.yaml b/kubernetes/aai/charts/aai-champ/templates/deployment.yaml
index d2f7bca..4987e4a 100644
--- a/kubernetes/aai/charts/aai-champ/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-champ/templates/deployment.yaml
@@ -86,7 +86,7 @@
           - mountPath: /var/log/onap
             name: {{ include "common.fullname" . }}-logs
           resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
diff --git a/kubernetes/aai/charts/aai-champ/values.yaml b/kubernetes/aai/charts/aai-champ/values.yaml
index a6435dd..75ecffb 100644
--- a/kubernetes/aai/charts/aai-champ/values.yaml
+++ b/kubernetes/aai/charts/aai-champ/values.yaml
@@ -27,6 +27,8 @@
 # application image
 image: onap/champ:1.3-STAGING-latest
 
+flavor: small
+
 # application configuration
 config:
   keyStorePassword: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10
@@ -60,7 +62,21 @@
 ingress:
   enabled: false
 
-resources: {}
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 2
+      memory: 4Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
 
 # XML beans configuration
 event:
diff --git a/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml b/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml
index 4b58c73..585cc4f 100644
--- a/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-data-router/templates/deployment.yaml
@@ -110,6 +110,8 @@
             port: {{ .Values.service.internalPort }}
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
+        resources:
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       volumes:
       - name: localtime
         hostPath:
diff --git a/kubernetes/aai/charts/aai-data-router/values.yaml b/kubernetes/aai/charts/aai-data-router/values.yaml
index 10521ab..06c64c3 100644
--- a/kubernetes/aai/charts/aai-data-router/values.yaml
+++ b/kubernetes/aai/charts/aai-data-router/values.yaml
@@ -24,7 +24,7 @@
 image: onap/data-router:1.3-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 dockerhubRepository: registry.hub.docker.com
 ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
 
@@ -82,7 +82,6 @@
   mountPath: /dockerdata-nfs
   mountSubPath: aai/data-router/logs
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -100,3 +99,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 1
+      memory: 2Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml b/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml
index acb0599..e1f3b39 100644
--- a/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-elasticsearch/templates/deployment.yaml
@@ -87,7 +87,7 @@
           - name: elasticsearch-data
             mountPath: /usr/share/elasticsearch/data
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/kubernetes/aai/charts/aai-elasticsearch/values.yaml b/kubernetes/aai/charts/aai-elasticsearch/values.yaml
index 0cb1a36..c6afbb5 100644
--- a/kubernetes/aai/charts/aai-elasticsearch/values.yaml
+++ b/kubernetes/aai/charts/aai-elasticsearch/values.yaml
@@ -23,6 +23,8 @@
 image: elasticsearch:2.4.1
 pullPolicy: Always
 
+flavor: small
+
 # application configuration
 config:
   tcpPort: 8443
@@ -78,7 +80,6 @@
   mountPath: /dockerdata-nfs
   mountSubPath: aai/elasticsearch/data
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -96,3 +97,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 1
+      memory: 2Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-gizmo/templates/deployment.yaml b/kubernetes/aai/charts/aai-gizmo/templates/deployment.yaml
index 0fb8552..d36ae2f 100644
--- a/kubernetes/aai/charts/aai-gizmo/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-gizmo/templates/deployment.yaml
@@ -89,7 +89,7 @@
             name: {{ include "common.fullname" . }}-logback-config
             subPath: logback.xml
           resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
diff --git a/kubernetes/aai/charts/aai-gizmo/values.yaml b/kubernetes/aai/charts/aai-gizmo/values.yaml
index 50c9d77..d34ff2b 100644
--- a/kubernetes/aai/charts/aai-gizmo/values.yaml
+++ b/kubernetes/aai/charts/aai-gizmo/values.yaml
@@ -24,7 +24,7 @@
 
 # application image
 image: onap/gizmo:1.3-STAGING-latest
-
+flavor: small
 # application configuration
 config:
   keyStorePassword: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10
@@ -59,4 +59,18 @@
 ingress:
   enabled: false
 
-resources: {}
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 1
+      memory: 2Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-graphadmin/templates/deployment.yaml b/kubernetes/aai/charts/aai-graphadmin/templates/deployment.yaml
index 9b0ec63..69aeb32 100644
--- a/kubernetes/aai/charts/aai-graphadmin/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-graphadmin/templates/deployment.yaml
@@ -123,7 +123,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/kubernetes/aai/charts/aai-graphadmin/values.yaml b/kubernetes/aai/charts/aai-graphadmin/values.yaml
index 6b7997f..3b7bd60 100644
--- a/kubernetes/aai/charts/aai-graphadmin/values.yaml
+++ b/kubernetes/aai/charts/aai-graphadmin/values.yaml
@@ -31,7 +31,7 @@
 image: onap/aai-graphadmin:1.0-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 # default number of instances
 replicaCount: 1
 
@@ -107,7 +107,6 @@
 ingress:
   enabled: false
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -125,3 +124,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 2
+      memory: 4Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml b/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml
index fe989b9..cee0818 100644
--- a/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-modelloader/templates/deployment.yaml
@@ -59,6 +59,8 @@
         ports:
         - containerPort: {{ .Values.service.internalPort }}
         - containerPort: {{ .Values.service.internalPort2 }}
+        resources:
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
 
       # side car containers
       - name: filebeat-onap
diff --git a/kubernetes/aai/charts/aai-modelloader/values.yaml b/kubernetes/aai/charts/aai-modelloader/values.yaml
index 977860f..e406443 100644
--- a/kubernetes/aai/charts/aai-modelloader/values.yaml
+++ b/kubernetes/aai/charts/aai-modelloader/values.yaml
@@ -24,7 +24,7 @@
 image: onap/model-loader:1.3-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 # application configuration
 config: {}
 
@@ -61,7 +61,6 @@
 ingress:
   enabled: false
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -79,3 +78,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 1
+      memory: 2Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-resources/templates/deployment.yaml b/kubernetes/aai/charts/aai-resources/templates/deployment.yaml
index 7df214f..065e130 100644
--- a/kubernetes/aai/charts/aai-resources/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-resources/templates/deployment.yaml
@@ -520,7 +520,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/kubernetes/aai/charts/aai-resources/values.yaml b/kubernetes/aai/charts/aai-resources/values.yaml
index 943ace8..e9a0063 100644
--- a/kubernetes/aai/charts/aai-resources/values.yaml
+++ b/kubernetes/aai/charts/aai-resources/values.yaml
@@ -25,7 +25,7 @@
 image: onap/aai-resources:1.3-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 # default number of instances
 replicaCount: 1
 
@@ -79,7 +79,6 @@
 ingress:
   enabled: false
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -97,3 +96,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 2
+      memory: 4Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml b/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml
index dffc9cf..e486143 100644
--- a/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-search-data/templates/deployment.yaml
@@ -93,7 +93,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/kubernetes/aai/charts/aai-search-data/values.yaml b/kubernetes/aai/charts/aai-search-data/values.yaml
index 08bdbdb..bfde398 100644
--- a/kubernetes/aai/charts/aai-search-data/values.yaml
+++ b/kubernetes/aai/charts/aai-search-data/values.yaml
@@ -26,7 +26,7 @@
 image: onap/search-data-service:1.3-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 # application configuration
 config:
   elasticsearchHttpPort: 9200
@@ -61,7 +61,6 @@
 ingress:
   enabled: false
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -79,3 +78,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 1
+      memory: 2Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-sparky-be/templates/deployment.yaml b/kubernetes/aai/charts/aai-sparky-be/templates/deployment.yaml
index 48235bc..a6414dd 100644
--- a/kubernetes/aai/charts/aai-sparky-be/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-sparky-be/templates/deployment.yaml
@@ -117,7 +117,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/kubernetes/aai/charts/aai-sparky-be/values.yaml b/kubernetes/aai/charts/aai-sparky-be/values.yaml
index 50c624d..47b5a1d 100644
--- a/kubernetes/aai/charts/aai-sparky-be/values.yaml
+++ b/kubernetes/aai/charts/aai-sparky-be/values.yaml
@@ -31,7 +31,7 @@
 image: onap/sparky-be:1.3-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 dockerhubRepository: registry.hub.docker.com
 ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
 # application configuration
@@ -82,7 +82,6 @@
 ingress:
   enabled: false
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -100,3 +99,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 2
+      memory: 4Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
diff --git a/kubernetes/aai/charts/aai-spike/templates/deployment.yaml b/kubernetes/aai/charts/aai-spike/templates/deployment.yaml
index edf6ce8..a6801e1 100644
--- a/kubernetes/aai/charts/aai-spike/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-spike/templates/deployment.yaml
@@ -103,7 +103,7 @@
           - mountPath: /var/log/onap
             name: {{ include "common.fullname" . }}-logs
           resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
diff --git a/kubernetes/aai/charts/aai-spike/values.yaml b/kubernetes/aai/charts/aai-spike/values.yaml
index 6429d3f..4fc3a0b 100644
--- a/kubernetes/aai/charts/aai-spike/values.yaml
+++ b/kubernetes/aai/charts/aai-spike/values.yaml
@@ -25,7 +25,7 @@
 
 # application image
 image: onap/spike:1.0-STAGING-latest
-
+flavor: small
 # application configuration
 config:
   keyStorePassword: OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10
@@ -60,7 +60,21 @@
 ingress:
   enabled: false
 
-resources: {}
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 2
+      memory: 4Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi
 
 # XML bean configuration
 event:
diff --git a/kubernetes/aai/charts/aai-traversal/templates/deployment.yaml b/kubernetes/aai/charts/aai-traversal/templates/deployment.yaml
index 3cedaec..fb07427 100644
--- a/kubernetes/aai/charts/aai-traversal/templates/deployment.yaml
+++ b/kubernetes/aai/charts/aai-traversal/templates/deployment.yaml
@@ -352,7 +352,7 @@
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 10 }}
+{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}
diff --git a/kubernetes/aai/charts/aai-traversal/values.yaml b/kubernetes/aai/charts/aai-traversal/values.yaml
index a3410ad..83bd1a9 100644
--- a/kubernetes/aai/charts/aai-traversal/values.yaml
+++ b/kubernetes/aai/charts/aai-traversal/values.yaml
@@ -26,7 +26,7 @@
 image: onap/aai-traversal:1.3-STAGING-latest
 pullPolicy: Always
 restartPolicy: Always
-
+flavor: small
 # application configuration
 config:
 
@@ -75,7 +75,6 @@
 ingress:
   enabled: false
 
-resources: {}
   # We usually recommend not to specify default resources and to leave this as a conscious
   # choice for the user. This also increases chances charts run on environments with little
   # resources, such as Minikube. If you do want to specify resources, uncomment the following
@@ -93,3 +92,18 @@
 #  requests:
 #    cpu: 2
 #    memory: 4Gi
+resources:
+  small:
+    limits:
+      cpu: 2
+      memory: 4Gi
+    requests:
+      cpu: 2
+      memory: 4Gi
+  large:
+    limits:
+      cpu: 4
+      memory: 8Gi
+    requests:
+      cpu: 4
+      memory: 8Gi