[COMMON] Harmonize resource settings
[oom.git] / kubernetes / so / values.yaml
index 4a361c6..e169dd3 100755 (executable)
@@ -21,16 +21,17 @@ global:
   nodePortPrefixExt: 304
   centralizedLoggingEnabled: true
   mariadbGalera:
+    # flag to enable the DB creation via mariadb-operator
+    useOperator: true
     nameOverride: mariadb-galera
-    serviceName: mariadb-galera
     servicePort: '3306'
     service: mariadb-galera
     internalPort: '3306'
-    # mariadbRootPassword: secretpassword
-    # rootPasswordExternalSecret: some secret
-    #This flag allows SO to instantiate its own mariadb-galera cluster,
-    #serviceName and nameOverride should be so-mariadb-galera if this flag is enabled
+    # This flag allows SO to instantiate its own mariadb-galera cluster,
+    # serviceName and nameOverride should be so-mariadb-galera if this flag is enabled
     localCluster: false
+    # (optional) if localCluster=false and an external secret is used set this variable
+    #userRootSecret: <secretName>
   persistence:
     mountPath: /dockerdata-nfs
   #This configuration specifies Service and port for SDNC OAM interface
@@ -63,11 +64,24 @@ secrets:
   - uid: db-root-pass
     name: &dbRootPassSecretName '{{ include "common.release" . }}-so-db-root-pass'
     type: password
-    externalSecret: '{{ .Values.global.mariadbGalera.localCluster | ternary
-      .Values.global.mariadbGalera.rootPasswordExternalSecret
-      (default (include "common.mariadb.secret.rootPassSecretName"
-        (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride))
-        .Values.global.mariadbGalera.rootPasswordExternalSecret)  }}'
+    # If we're using shared mariadb, we need to use the secret name (second
+    # part).
+    # If not, we do the same trick than for user db secret hat allows you
+    # override this secret using external one with the same field that is used
+    # to pass this to subchart.
+    externalSecret: '{{ .Values.global.mariadbGalera.localCluster |
+      ternary (( hasSuffix "so-db-root-pass" (index .Values "mariadb-galera" "rootUser" "externalSecret")) |
+               ternary
+                  ""
+                  (tpl (default "" (index .Values "mariadb-galera" "rootUser" "externalSecret")) .)
+               )
+               ( (not (empty (default "" .Values.global.mariadbGalera.userRootSecret))) |
+                 ternary
+                   .Values.global.mariadbGalera.userRootSecret
+                   (include "common.mariadb.secret.rootPassSecretName"
+                     (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride)
+                   )
+               ) }}'
     password: '{{ .Values.global.mariadbGalera.mariadbRootpassword }}'
   - uid: db-backup-creds
     name: &dbBackupCredsSecretName '{{ include "common.release" . }}-so-db-backup-creds'
@@ -139,7 +153,7 @@ dbCreds:
   userName: so_user
   adminName: so_admin
 
-image: onap/so/api-handler-infra:1.12.1
+image: onap/so/api-handler-infra:1.12.2
 
 server:
   aai:
@@ -550,18 +564,18 @@ flavor: small
 resources:
   small:
     limits:
-      cpu: 2000m
-      memory: 4Gi
+      cpu: "1"
+      memory: "4Gi"
     requests:
-      cpu: 500m
-      memory: 1Gi
+      cpu: "0.5"
+      memory: "1Gi"
   large:
     limits:
-      cpu: 4000m
-      memory: 8Gi
+      cpu: "2"
+      memory: "8Gi"
     requests:
-      cpu: 1000m
-      memory: 2Gi
+      cpu: "1"
+      memory: "2Gi"
   unlimited: {}
 
 nodeSelector: {}
@@ -579,11 +593,18 @@ config:
 #                                                       --set so.global.mariadbGalera.localCluster=true \
 #                                                       --set so.global.mariadbGalera.nameOverride=so-mariadb-galera \
 #                                                       --set so.global.mariadbGalera.serviceName=so-mariadb-galera
-mariadb-galera:
+mariadb-galera: &mariadbGalera
   rootUser:
     externalSecret: *dbRootPassSecretName
   nameOverride: &so-mariadb so-mariadb-galera
   replicaCount: 1
+  service:
+    name: *so-mariadb
+    portName: *so-mariadb
+    internalPort: 3306
+  mariadbOperator:
+    galera:
+      enabled: false
   persistence:
     mountSubPath: so/mariadb-galera/data
     enabled: true
@@ -631,17 +652,23 @@ mso:
     auth: basic bXNvX2FkbWlufHBhc3N3b3JkMSQ=
 
 so-bpmn-infra:
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
   logConfigMapNamePrefix: '{{ include "common.release" . }}-so'
 
 so-catalog-db-adapter:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
 
 so-cnf-adapter:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
   server:
@@ -652,24 +679,41 @@ so-cnf-adapter:
 
 so-cnfm-lcm:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
 
 so-etsi-nfvo-ns-lcm:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
 
 so-mariadb:
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     rootPasswordExternalSecretLocalDb: *dbRootPassSecretName
-    rootPasswordExternalSecret: '{{ ternary .Values.db.rootPasswordExternalSecretLocalDb (include "common.mariadb.secret.rootPassSecretName" (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride)) .Values.global.mariadbGalera.localCluster }}'
+    #rootPasswordExternalSecretLocalDb: *dbRootPassSecretName
+    rootPasswordExternalSecret: '{{ .Values.global.mariadbGalera.localCluster |
+      ternary (tpl .Values.db.rootPasswordExternalSecretLocalDb .)
+               ( (not (empty (default "" .Values.global.mariadbGalera.userRootSecret))) |
+                 ternary
+                   .Values.global.mariadbGalera.userRootSecret
+                   (include "common.mariadb.secret.rootPassSecretName"
+                     (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride)
+                   )
+               ) }}'
     backupCredsExternalSecret: *dbBackupCredsSecretName
     userCredsExternalSecret: *dbUserCredsSecretName
     adminCredsExternalSecret: *dbAdminCredsSecretName
 
 so-admin-cockpit:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
 
@@ -678,11 +722,15 @@ so-nssmf-adapter:
   server:
     actuatorCredsExternalSecret: *actuator-secrets
     bpelCredsExternalSecret: *bpel-secrets
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
 
 so-oof-adapter:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
   mso:
@@ -694,21 +742,29 @@ so-oof-adapter:
 
 so-openstack-adapter:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
   logConfigMapNamePrefix: '{{ include "common.release" . }}-so'
 
 so-request-db-adapter:
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
 
 so-sdc-controller:
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
   logConfigMapNamePrefix: '{{ include "common.release" . }}-so'
 
 so-sdnc-adapter:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets
   mso:
@@ -720,6 +776,8 @@ so-ve-vnfm-adapter:
 
 so-etsi-sol005-adapter:
   enabled: true
+  mariadb-galera:
+    <<: *mariadbGalera
   db:
     <<: *dbSecrets