[SDC] Update pod limits and timeouts 87/113487/4
authorChrisC <christophe.closset@intl.att.com>
Fri, 2 Oct 2020 14:39:13 +0000 (16:39 +0200)
committerChrisC <christophe.closset@intl.att.com>
Mon, 5 Oct 2020 16:00:55 +0000 (18:00 +0200)
Add missing common flavor limits (and revisit some values)
Add fixed limits for single job containers and init containers (no need to have these configurable I think)
Reworked timeouts

Issue-ID: SDC-3282
Signed-off-by: ChrisC <christophe.closset@intl.att.com>
Change-Id: I2eb7122eed370978876ac496a68eebb51421595a

15 files changed:
kubernetes/sdc/components/sdc-be/templates/deployment.yaml
kubernetes/sdc/components/sdc-be/templates/job.yaml
kubernetes/sdc/components/sdc-be/values.yaml
kubernetes/sdc/components/sdc-cs/templates/job.yaml
kubernetes/sdc/components/sdc-cs/values.yaml
kubernetes/sdc/components/sdc-fe/templates/deployment.yaml
kubernetes/sdc/components/sdc-fe/values.yaml
kubernetes/sdc/components/sdc-onboarding-be/templates/deployment.yaml
kubernetes/sdc/components/sdc-onboarding-be/templates/job.yaml
kubernetes/sdc/components/sdc-onboarding-be/values.yaml
kubernetes/sdc/components/sdc-wfd-be/templates/deployment.yaml
kubernetes/sdc/components/sdc-wfd-be/templates/job.yaml
kubernetes/sdc/components/sdc-wfd-be/values.yaml
kubernetes/sdc/components/sdc-wfd-fe/templates/deployment.yaml
kubernetes/sdc/components/sdc-wfd-fe/values.yaml

index e2329d7..d3a47de 100644 (file)
@@ -37,6 +37,13 @@ spec:
               fieldPath: metadata.namespace
         image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       - name: {{ include "common.name" . }}-job-completion
         image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}"
@@ -51,6 +58,13 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- if .Values.global.aafEnabled }}
       - name: {{ include "common.name" . }}-update-config
         image: "{{ .Values.global.envsubstImage }}"
@@ -72,6 +86,13 @@ spec:
             envsubst <${PFILE} >/config-output/${PFILE}
             chmod 0755 /config-output/${PFILE}
           done
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
         volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
         - name: {{ include "common.fullname" . }}-environments
           mountPath: /config-input/
@@ -154,6 +175,13 @@ spec:
             mountPath: /var/log/onap
           - name: {{ include "common.fullname" . }}-data-filebeat
             mountPath: /usr/share/filebeat/data
+          resources:
+            limits:
+              cpu: 100m
+              memory: 100Mi
+            requests:
+              cpu: 3m
+              memory: 20Mi
       volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
       - name: {{ include "common.fullname" . }}-localtime
         hostPath:
index f1bdabb..554b3c3 100644 (file)
@@ -39,12 +39,21 @@ spec:
         args:
         - --container-name
         - sdc-be
+        - "-t"
+        - "35"
         env:
         - name: NAMESPACE
           valueFrom:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       containers:
       - name: {{ include "common.name" . }}-job
         image: "{{ include "common.repository" . }}/{{ .Values.backendInitImage }}"
@@ -61,6 +70,13 @@ spec:
           valueFrom:
             fieldRef:
               fieldPath: status.podIP
+        resources:
+          limits:
+            cpu: 800m
+            memory: 1024Mi
+          requests:
+            cpu: 200m
+            memory: 200Mi
       volumes:
         - name: {{ include "common.fullname" . }}-environments
           configMap:
index c71bb75..b825b70 100644 (file)
@@ -140,15 +140,15 @@ resources:
   small:
     limits:
       cpu: 1
-      memory: 4Gi
+      memory: 2Gi
     requests:
-      cpu: 10m
+      cpu: 100m
       memory: 1Gi
   large:
     limits:
       cpu: 2
-      memory: 8Gi
+      memory: 4Gi
     requests:
-      cpu: 20m
+      cpu: 200m
       memory: 2Gi
   unlimited: {}
index 0c98d67..19dd112 100644 (file)
@@ -45,12 +45,21 @@ spec:
         {{- else }}
         - cassandra
         {{- end }}
+        - "-t"
+        - "15"
         env:
         - name: NAMESPACE
           valueFrom:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       containers:
       - name: {{ include "common.name" . }}-job
         image: "{{ include "common.repository" . }}/{{ .Values.cassandraInitImage }}"
@@ -78,6 +87,13 @@ spec:
           valueFrom:
             fieldRef:
               fieldPath: status.podIP
+        resources:
+          limits:
+            cpu: 800m
+            memory: 1024Mi
+          requests:
+            cpu: 200m
+            memory: 300Mi
       volumes:
       - name: {{ include "common.fullname" . }}-environments
         configMap:
index 4cf6e4d..e80f648 100644 (file)
@@ -104,23 +104,3 @@ persistence:
 
 ingress:
   enabled: false
-
-# Resource Limit flavor -By Default using small
-flavor: small
-# Segregation for Different environment (Small and Large)
-resources:
-  small:
-    limits:
-      cpu: 1
-      memory: 4Gi
-    requests:
-      cpu: 10m
-      memory: 1Gi
-  large:
-    limits:
-      cpu: 2
-      memory: 8Gi
-    requests:
-      cpu: 20m
-      memory: 2Gi
-  unlimited: {}
index 0571f4b..bca3c47 100644 (file)
@@ -43,12 +43,21 @@ spec:
         args:
         - --job-name
         - {{ include "common.release" . }}-sdc-be-config-backend
+        - "-t"
+        - "35"
         env:
         - name: NAMESPACE
           valueFrom:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- if .Values.global.aafEnabled }}
       - name: {{ include "common.name" . }}-update-config
         image: "{{ .Values.global.envsubstImage }}"
@@ -75,6 +84,13 @@ spec:
             mountPath: /config-input/
           - name: sdc-environments-output
             mountPath: /config-output/
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- end }}
       containers:
         - name: {{ include "common.name" . }}
@@ -106,8 +122,7 @@ spec:
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
             timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
-          resources:
-{{ include "common.resources" . | indent 12 }}
+          resources: {{ include "common.resources" . | nindent 12 }}
           env:
           - name: ENVNAME
             value: {{ .Values.env.name }}
@@ -153,6 +168,13 @@ spec:
             mountPath: /var/log/onap
           - name: {{ include "common.fullname" . }}-data-filebeat
             mountPath: /usr/share/filebeat/data
+          resources:
+            limits:
+              cpu: 100m
+              memory: 100Mi
+            requests:
+              cpu: 3m
+              memory: 20Mi
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
index 6501698..1389d05 100644 (file)
@@ -123,16 +123,16 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 1
-      memory: 4Gi
+      cpu: 500m
+      memory: 2Gi
     requests:
-      cpu: 10m
+      cpu: 40m
       memory: 1Gi
   large:
     limits:
-      cpu: 2
-      memory: 8Gi
+      cpu: 1
+      memory: 4Gi
     requests:
-      cpu: 20m
+      cpu: 80m
       memory: 2Gi
   unlimited: {}
index 6f1e2a9..527ddde 100644 (file)
@@ -49,6 +49,13 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- if .Values.global.aafEnabled }}
       - name: {{ include "common.name" . }}-update-config
         image: "{{ .Values.global.envsubstImage }}"
@@ -75,6 +82,13 @@ spec:
             mountPath: /config-input/
           - name: sdc-environments-output
             mountPath: /config-output/
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- end }}
       containers:
         - name: {{ include "common.name" . }}
@@ -99,8 +113,7 @@ spec:
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
             timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
-          resources:
-{{ include "common.resources" . | indent 12 }}
+          resources: {{ include "common.resources" . | nindent 12 }}
           env:
           - name: ENVNAME
             value: {{ .Values.env.name }}
@@ -155,6 +168,13 @@ spec:
             mountPath: /var/log/onap
           - name: {{ include "common.fullname" . }}-data-filebeat
             mountPath: /usr/share/filebeat/data
+          resources:
+            limits:
+              cpu: 100m
+              memory: 100Mi
+            requests:
+              cpu: 3m
+              memory: 20Mi
       volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
       - name: {{ include "common.fullname" . }}-localtime
         hostPath:
index 936c7c4..c3003e2 100644 (file)
@@ -41,12 +41,21 @@ spec:
         args:
         - --job-name
         - {{ include "common.release" . }}-sdc-cs-config-cassandra
+        - "-t"
+        - "20"
         env:
         - name: NAMESPACE
           valueFrom:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       containers:
       - name: {{ include "common.name" . }}-job
         image: "{{ include "common.repository" . }}/{{ .Values.onboardingInitImage }}"
@@ -72,6 +81,13 @@ spec:
             secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: cs_password}
         - name: CS_HOST_IP
           value: "{{ .Values.global.cassandra.serviceName }}"
+        resources:
+          limits:
+            cpu: 800m
+            memory: 1024Mi
+          requests:
+            cpu: 200m
+            memory: 200Mi
       volumes:
       - name: {{ include "common.fullname" . }}-environments
         configMap:
index ff10a64..6ec08db 100644 (file)
@@ -155,16 +155,16 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 1
-      memory: 4Gi
+      cpu: 500m
+      memory: 2Gi
     requests:
-      cpu: 10m
+      cpu: 40m
       memory: 1Gi
   large:
     limits:
-      cpu: 2
-      memory: 8Gi
+      cpu: 1
+      memory: 4Gi
     requests:
-      cpu: 20m
+      cpu: 80m
       memory: 2Gi
   unlimited: {}
index b188cda..c61c41f 100644 (file)
@@ -50,6 +50,13 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{ end }}
       containers:
         - name: {{ include "common.name" . }}
@@ -123,6 +130,7 @@ spec:
           - name: SERVER_SSL_TRUSTSTORE_TYPE
             value: "{{ .Values.config.serverSSLTrustStoreType }}"
           volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
+          resources: {{ include "common.resources" . | nindent 12 }}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 9235cb4..be7d519 100644 (file)
@@ -34,37 +34,47 @@ spec:
     spec:
       restartPolicy: Never
       initContainers:
-      - name: {{ include "common.name" . }}-init-readiness
-        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        command:
-        - /app/ready.py
-        args:
-        - --job-name
-        - {{ include "common.release" . }}-sdc-cs-config-cassandra
-        env:
-        - name: NAMESPACE
-          valueFrom:
-            fieldRef:
-              apiVersion: v1
-              fieldPath: metadata.namespace
+        - name: {{ include "common.name" . }}-init-readiness
+          image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          command:
+          - /app/ready.py
+          args:
+          - --job-name
+          - {{ include "common.release" . }}-sdc-cs-config-cassandra
+          - "-t"
+          - "20"
+          env:
+          - name: NAMESPACE
+            valueFrom:
+              fieldRef:
+                apiVersion: v1
+                fieldPath: metadata.namespace
+          resources:
+            limits:
+              cpu: 100m
+              memory: 100Mi
+            requests:
+              cpu: 3m
+              memory: 20Mi
       containers:
-      - name: {{ include "common.name" . }}-job
-        image: "{{ include "common.repository" . }}/{{ .Values.configInitImage }}"
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        env:
-        - name: CS_HOST
-          value: "{{ .Values.global.cassandra.serviceName }}"
-        - name: CS_PORT
-          value: "{{ .Values.config.cassandraClientPort }}"
-        - name: CS_AUTHENTICATE
-          value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
-        - name: CS_USER
-          valueFrom:
-            secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
-        - name: CS_PASSWORD
-          valueFrom:
-            secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
+        - name: {{ include "common.name" . }}-job
+          image: "{{ include "common.repository" . }}/{{ .Values.configInitImage }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          env:
+          - name: CS_HOST
+            value: "{{ .Values.global.cassandra.serviceName }}"
+          - name: CS_PORT
+            value: "{{ .Values.config.cassandraClientPort }}"
+          - name: CS_AUTHENTICATE
+            value: "{{ .Values.config.cassandraAuthenticationEnabled }}"
+          - name: CS_USER
+            valueFrom:
+              secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user}
+          - name: CS_PASSWORD
+            valueFrom:
+              secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password}
+          resources: {{ include "common.resources" . | nindent 12 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
 {{ end }}
index 6147b06..893a1b9 100644 (file)
@@ -123,21 +123,22 @@ ingress:
   config:
     ssl: "redirect"
 
-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
-  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
-  #
-  # Example:
-  # Configure resource requests and limits
-  # ref: http://kubernetes.io/docs/user-guide/compute-resources/
-  # Minimum memory for development is 2 CPU cores and 4GB memory
-  # Minimum memory for production is 4 CPU cores and 8GB memory
-#resources:
-#  limits:
-#    cpu: 2
-#    memory: 4Gi
-#  requests:
-#    cpu: 2
-#    memory: 4Gi
+# Resource Limit flavor -By Default using small
+# Segregation for Different environment (Small and Large)
+flavor: small
+resources:
+  small:
+    limits:
+      cpu: 500m
+      memory: 2Gi
+    requests:
+      cpu: 40m
+      memory: 1Gi
+  large:
+    limits:
+      cpu: 1
+      memory: 4Gi
+    requests:
+      cpu: 80m
+      memory: 2Gi
+  unlimited: {}
index ad10480..c423da9 100644 (file)
@@ -48,6 +48,13 @@ spec:
               fieldPath: metadata.namespace
         image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- if .Values.global.aafEnabled }}
       - name: {{ include "common.fullname" . }}-move-cert
         command:
@@ -63,6 +70,13 @@ spec:
         volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
           - name: sdc-certs
             mountPath: /sdc-certs
+        resources:
+          limits:
+            cpu: 100m
+            memory: 100Mi
+          requests:
+            cpu: 3m
+            memory: 20Mi
       {{- end }}
       containers:
         - name: {{ include "common.name" . }}
@@ -123,8 +137,7 @@ spec:
             mountPath: /var/lib/jetty/etc/{{ .Values.certInitializer.truststoreFile }}
             subPath: {{ .Values.certInitializer.truststoreFile }}
           {{ end }}
-          resources:
-{{ include "common.resources" . | indent 12 }}
+          resources: {{ include "common.resources" . | nindent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
@@ -145,6 +158,13 @@ spec:
             mountPath: /var/log/onap
           - name: {{ include "common.fullname" . }}-data-filebeat
             mountPath: /usr/share/filebeat/data
+          resources:
+            limits:
+              cpu: 100m
+              memory: 100Mi
+            requests:
+              cpu: 3m
+              memory: 20Mi
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: {{ include "common.fullname" . }}-localtime
           hostPath:
index 5680492..e881398 100644 (file)
@@ -114,21 +114,22 @@ ingress:
     nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
     nginx.ingress.kubernetes.io/rewrite-target: "/workflows/"
 
-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
-  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
-  #
-  # Example:
-  # Configure resource requests and limits
-  # ref: http://kubernetes.io/docs/user-guide/compute-resources/
-  # Minimum memory for development is 2 CPU cores and 4GB memory
-  # Minimum memory for production is 4 CPU cores and 8GB memory
-#resources:
-#  limits:
-#    cpu: 2
-#    memory: 4Gi
-#  requests:
-#    cpu: 2
-#    memory: 4Gi
+# Resource Limit flavor -By Default using small
+# Segregation for Different environment (Small and Large)
+flavor: small
+resources:
+  small:
+    limits:
+      cpu: 500m
+      memory: 2Gi
+    requests:
+      cpu: 40m
+      memory: 1Gi
+  large:
+    limits:
+      cpu: 1
+      memory: 4Gi
+    requests:
+      cpu: 80m
+      memory: 2Gi
+  unlimited: {}