Merge "[COMMON][CASSANDRA] Use Startup probes"
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Thu, 6 May 2021 22:18:45 +0000 (22:18 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 6 May 2021 22:18:45 +0000 (22:18 +0000)
kubernetes/common/cert-wrapper/resources/import-custom-certs.sh
kubernetes/common/certInitializer/templates/_certInitializer.yaml
kubernetes/common/certInitializer/values.yaml
kubernetes/common/music/values.yaml
kubernetes/policy/components/policy-clamp-be/resources/config/create-db-tables.sh
kubernetes/portal/components/portal-app/values.yaml
kubernetes/portal/components/portal-sdk/values.yaml

index d955ecd..ec1ce94 100755 (executable)
@@ -17,6 +17,7 @@
 */}}
 
 CERTS_DIR=${CERTS_DIR:-/certs}
+MORE_CERTS_DIR=${MORE_CERTS_DIR:-/more_certs}
 WORK_DIR=${WORK_DIR:-/updatedTruststore}
 ONAP_TRUSTSTORE=${ONAP_TRUSTSTORE:-truststoreONAPall.jks}
 JRE_TRUSTSTORE=${JRE_TRUSTSTORE:-$JAVA_HOME/lib/security/cacerts}
@@ -47,6 +48,13 @@ for f in $CERTS_DIR/*; do
   fi
 done
 
+for f in $MORE_CERTS_DIR/*; do
+  if [ ${f: -4} == ".pem" ]
+    then
+      cp $f $WORK_DIR/.
+  fi
+done
+
 # Prepare truststore output file
 if [ "$AAF_ENABLED" = "true" ]
   then
index 414192e..3b165a4 100644 (file)
   volumeMounts:
     - mountPath: /certs
       name: aaf-agent-certs
+    - mountPath: /more_certs
+      name: provided-custom-certs
     - mountPath: /root/import-custom-certs.sh
       name: aaf-agent-certs
       subPath: import-custom-certs.sh
   configMap:
     name: {{ tpl $subchartDot.Values.certsCMName $subchartDot }}
     defaultMode: 0700
+{{- if $dot.Values.global.importCustomCertsEnabled }}
+- name: provided-custom-certs
+{{-   if $dot.Values.global.customCertsSecret }}
+  secret:
+    secretName: {{ $dot.Values.global.customCertsSecret }}
+{{-   else }}
+{{-     if $dot.Values.global.customCertsConfigMap }}
+  configMap:
+    name: {{ $dot.Values.global.customCertsConfigMap }}
+{{-     else }}
+  emptyDir:
+    medium: Memory
+{{-     end }}
+{{-   end }}
+{{- end }}
 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
   configMap:
     name: {{ include "common.fullname" $subchartDot }}-add-config
index 52b2765..74a2b37 100644 (file)
 global:
   aafAgentImage: onap/aaf/aaf_agent:2.1.20
   aafEnabled: true
+  # Give the name of a config map where certInitializer will onboard all certs
+  # given (certs must be in pem format)
+  customCertsConfigMap:
+  # Give the name of a secret where certInitializer will onboard all certs given
+  # (certs must be in pem format)
+  # this one superseedes previous one (so if both are given, only certs from
+  # secret will be onboarded).
+  customCertsSecret:
+
 
 pullPolicy: Always
 
@@ -37,7 +46,6 @@ readinessCheck:
     - aaf-cm
     - aaf-service
 
-aafDeployFqi: "changeme"
 fqdn: ""
 app_ns: "org.osaaf.aaf"
 fqi: ""
index 25cab91..f578949 100644 (file)
@@ -164,5 +164,4 @@ certInitializer:
   credsPath: /opt/app/osaaf/local
   appMountPath: /opt/app/aafcertman
   aaf_add_config: >
-    cd {{ .Values.credsPath }};
-    /opt/app/aaf_config/bin/agent.sh local showpass {{.Values.fqi}} {{ .Values.fqdn }} | grep cadi_keystore_password_jks= | cut -d= -f 2 > {{ .Values.credsPath }}/.pass 2>&1;
+    echo "$cadi_keystore_password_jks" > {{ .Values.credsPath }}/.pass;
index 329479f..ad9984c 100755 (executable)
@@ -16,4 +16,4 @@
 # limitations under the License.
 */}}
 
-mysql -h"${MYSQL_HOST}" -P"${MYSQL_PORT}" -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" policyclamp < /dbcmd-config/policy-clamp-create-tables.sql
+mysql -h"${MYSQL_HOST}" -P"${MYSQL_PORT}" -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" -f policyclamp < /dbcmd-config/policy-clamp-create-tables.sql
index 0a81810..b46876c 100644 (file)
@@ -77,10 +77,9 @@ certInitializer:
   permission_group: 999
   keystoreFile: "org.onap.portal.p12"
   truststoreFile: "org.onap.portal.trust.jks"
-  aaf_add_config: >
-    /opt/app/aaf_config/bin/agent.sh;
-    /opt/app/aaf_config/bin/agent.sh local showpass \
-    {{.Values.fqi}} {{ .Values.fqdn }} > {{ .Values.credsPath }}/mycreds.prop
+  aaf_add_config: |
+    echo "cadi_truststore_password=$cadi_truststore_password" > {{ .Values.credsPath }}/mycreds.prop
+    echo "cadi_keystore_password_p12=$cadi_keystore_password_p12" >> {{ .Values.credsPath }}/mycreds.prop
 
 # default number of instances
 replicaCount: 1
index 11ce5a6..7631c3a 100644 (file)
@@ -78,10 +78,9 @@ certInitializer:
   permission_group: 999
   keystoreFile: "org.onap.portal.p12"
   truststoreFile: "org.onap.portal.trust.jks"
-  aaf_add_config: >
-    /opt/app/aaf_config/bin/agent.sh;
-    /opt/app/aaf_config/bin/agent.sh local showpass \
-    {{.Values.fqi}} {{ .Values.fqdn }} > {{ .Values.credsPath }}/mycreds.prop
+  aaf_add_config: |
+    echo "cadi_truststore_password=$cadi_truststore_password" > {{ .Values.credsPath }}/mycreds.prop
+    echo "cadi_keystore_password_p12=$cadi_keystore_password_p12" >> {{ .Values.credsPath }}/mycreds.prop
 
 # flag to enable debugging - application support required
 debugEnabled: false