Merge "[AAF] Give `identities.dat` to working deployments"
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Wed, 17 Feb 2021 11:01:28 +0000 (11:01 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 17 Feb 2021 11:01:28 +0000 (11:01 +0000)
18 files changed:
kubernetes/common/cassandra/templates/statefulset.yaml
kubernetes/common/common/templates/_service.tpl
kubernetes/dcaegen2/components/dcae-bootstrap/values.yaml
kubernetes/dcaemod/components/dcaemod-onboarding-api/values.yaml
kubernetes/dcaemod/components/dcaemod-runtime-api/values.yaml
kubernetes/nbi/values.yaml
kubernetes/policy/components/policy-xacml-pdp/resources/config/xacml.properties
kubernetes/portal/components/portal-cassandra/templates/deployment.yaml
kubernetes/portal/components/portal-cassandra/values.yaml
kubernetes/sdnc/resources/config/conf/org.opendaylight.daexim.cfg [new file with mode: 0644]
kubernetes/sdnc/templates/statefulset.yaml
kubernetes/sdnc/values.yaml
kubernetes/vid/requirements.yaml
kubernetes/vid/resources/certs/org.onap.vid.jks [deleted file]
kubernetes/vid/resources/certs/org.onap.vid.trust.jks [deleted file]
kubernetes/vid/templates/deployment.yaml
kubernetes/vid/templates/secrets.yaml
kubernetes/vid/values.yaml

index 471f88f..953c89d 100644 (file)
@@ -100,6 +100,14 @@ spec:
             value: {{ default "GossipingPropertyFileSnitch" .Values.config.endpoint_snitch | quote }}
           - name: CASSANDRA_AUTHENTICATOR
             value: {{ default "PasswordAuthenticator" .Values.config.authenticator | quote }}
+          {{- if include "common.onServiceMesh" . }}
+          - name: CASSANDRA_LISTEN_ADDRESS
+            value: "127.0.0.1"
+          - name: CASSANDRA_BROADCAST_ADDRESS
+            valueFrom:
+              fieldRef:
+                fieldPath: status.podIP
+          {{- end }}
           - name: POD_IP
             valueFrom:
               fieldRef:
index dddd634..9c3010c 100644 (file)
@@ -128,7 +128,7 @@ labels: {{- include "common.labels" (dict "labels" $labels "dot" $dot) | nindent
   name: {{ $port.name }}
 {{-       end }}
 {{-       if (eq $serviceType "NodePort") }}
-  nodePort: {{ include "common.nodePortPrefix" (dict "dot" $dot "portNodePortExt" $port.useNodePortExt) }}{{ $port.nodePort }}
+  nodePort: {{ include "common.nodePortPrefix" (dict "dot" $dot "useNodePortExt" $port.useNodePortExt) }}{{ $port.nodePort }}
 {{-       end }}
 {{-     else }}
 - port: {{ default $port.port $port.plain_port }}
index 3c8da5b..6412bf8 100644 (file)
@@ -115,7 +115,7 @@ componentImages:
   tcagen2: onap/org.onap.dcaegen2.analytics.tca-gen2.dcae-analytics-tca-web:1.2.1
   ves: onap/org.onap.dcaegen2.collectors.ves.vescollector:1.7.9
   snmptrap: onap/org.onap.dcaegen2.collectors.snmptrap:1.4.0
-  prh: onap/org.onap.dcaegen2.services.prh.prh-app-server:1.5.4
+  prh: onap/org.onap.dcaegen2.services.prh.prh-app-server:1.5.5
   hv_ves: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.6.0
   datafile_collector: onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:1.5.0
 
index a9c0029..9401bf5 100644 (file)
@@ -92,7 +92,7 @@ postgres:
       mountInitPath: dcaemod
 
 # application image
-image: onap/org.onap.dcaegen2.platform.mod.onboardingapi:2.12.4
+image: onap/org.onap.dcaegen2.platform.mod.onboardingapi:2.12.5
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 03b5c83..2482748 100644 (file)
@@ -69,7 +69,7 @@ readiness:
   # Should have a proper readiness endpoint or script
 
 # application image
-image: onap/org.onap.dcaegen2.platform.mod.runtime-web:1.2.1
+image: onap/org.onap.dcaegen2.platform.mod.runtime-web:1.2.2
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 53260cb..bc1f19a 100644 (file)
@@ -66,7 +66,7 @@ subChartsOnly:
 
 # application image
 repository: nexus3.onap.org:10001
-image: onap/externalapi/nbi:7.0.2
+image: onap/externalapi/nbi:8.0.0-latest
 pullPolicy: IfNotPresent
 sdc_authorization: Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=
 aai_authorization: Basic QUFJOkFBSQ==
index 0d773b5..d2e9c62 100755 (executable)
@@ -49,6 +49,7 @@ xacml.pip.engines=count-recent-operations,get-operation-outcome
 #
 # JPA Properties
 #
+eclipselink.target-database=MySQL
 javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver
 javax.persistence.jdbc.url=jdbc:mariadb://{{ .Values.db.service.name }}:{{ .Values.db.service.internalPort }}/operationshistory
 javax.persistence.jdbc.user=${SQL_USER}
index 39cd029..20c396f 100644 (file)
@@ -108,11 +108,15 @@ spec:
             value: rack1
           - name: CASSANDRA_ENABLE_RPC
             value: "true"
-          {{- if eq "small" .Values.flavor }}
+          {{- $flavor := include "common.flavor" . }}
+          {{- $heap := pluck $flavor .Values.heap | first }}
+          {{- if (hasKey $heap "max") }}
           - name: MAX_HEAP_SIZE
-            value: {{ .Values.resources.small.heap.max }}
+            value: {{ $heap.max }}
+          {{- end }}
+          {{- if (hasKey $heap "new") }}
           - name: HEAP_NEWSIZE
-            value: {{ .Values.resources.small.heap.new }}
+            value: {{ $heap.new }}
           {{- end }}
         volumeMounts:
         - mountPath: /etc/localtime
index c185155..b06761a 100644 (file)
@@ -112,14 +112,6 @@ flavor: small
 # Segregation for Different environment (Small and Large)
 resources:
   small:
-    # Heap size is tightly correlated to RAM limits.
-    # If limit > 8G, Cassandra should define itself the best value.
-    # If not, you must set up it in a coherent way with limits set
-    # Refer to https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/operations/opsTuneJVM.html#Determiningtheheapsize
-    # for more informations.
-    heap:
-      max: 3G
-      new: 100M
     limits:
       cpu: 500m
       memory: 3.75Gi
@@ -134,3 +126,15 @@ resources:
       cpu: 2
       memory: 6Gi
   unlimited: {}
+
+heap:
+  # Heap size is tightly correlated to RAM limits.
+  # If limit > 8G, Cassandra should define itself the best value.
+  # If not, you must set up it in a coherent way with limits set
+  # Refer to https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/operations/opsTuneJVM.html#Determiningtheheapsize
+  # for more informations.
+  small:
+    max: 3G
+    new: 100M
+  large: {}
+  unlimited: {}
\ No newline at end of file
diff --git a/kubernetes/sdnc/resources/config/conf/org.opendaylight.daexim.cfg b/kubernetes/sdnc/resources/config/conf/org.opendaylight.daexim.cfg
new file mode 100644 (file)
index 0000000..20b794d
--- /dev/null
@@ -0,0 +1,4 @@
+# Daexim directory location
+# absolute path or path relative to Karaf home directory
+# property substitution (interpolation) currently only supported for "${karaf.home}", no others (hard-coded) -- M.
+daexim.dir={{ .Values.persistence.daeximPath }}
\ No newline at end of file
index 51c50e4..7441dac 100644 (file)
@@ -114,7 +114,6 @@ spec:
         args:
         - -c
         - |
-           mkdir {{ .Values.persistence.mdsalPath }}/daexim
            mkdir {{ .Values.persistence.mdsalPath }}/journal
            mkdir {{ .Values.persistence.mdsalPath }}/snapshots
            chown -R {{ .Values.config.odlUid }}:{{ .Values.config.odlGid}} {{ .Values.persistence.mdsalPath }}
@@ -264,6 +263,9 @@ spec:
           - mountPath: {{ .Values.config.odl.etcDir }}/mountpoint-state-provider.properties
             name: properties
             subPath: mountpoint-state-provider.properties
+          - mountPath: {{ .Values.config.odl.etcDir }}/org.opendaylight.daexim.cfg
+            name: properties
+            subPath: org.opendaylight.daexim.cfg
           resources:
 {{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
index efc13e9..5a4d204 100644 (file)
@@ -460,7 +460,7 @@ persistence:
   mountPath: /dockerdata-nfs
   mountSubPath: sdnc/mdsal
   mdsalPath: /opt/opendaylight/mdsal
-  daeximPath: /opt/opendaylight/daexim
+  daeximPath: /opt/opendaylight/mdsal/daexim
   journalPath: /opt/opendaylight/journal
   snapshotsPath: /opt/opendaylight/snapshots
 
index c6554ca..34ad968 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2021 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -19,6 +20,9 @@ dependencies:
     # a part of this chart's package and will not
     # be published independently to a repo (at this point)
     repository: '@local'
+  - name: certInitializer
+    version: ~7.x-0
+    repository: '@local'
   - name: mariadb-galera
     version: ~7.x-0
     repository: '@local'
@@ -30,4 +34,3 @@ dependencies:
   - name: repositoryGenerator
     version: ~7.x-0
     repository: '@local'
-
diff --git a/kubernetes/vid/resources/certs/org.onap.vid.jks b/kubernetes/vid/resources/certs/org.onap.vid.jks
deleted file mode 100644 (file)
index a05f12d..0000000
Binary files a/kubernetes/vid/resources/certs/org.onap.vid.jks and /dev/null differ
diff --git a/kubernetes/vid/resources/certs/org.onap.vid.trust.jks b/kubernetes/vid/resources/certs/org.onap.vid.trust.jks
deleted file mode 100644 (file)
index 4caf7be..0000000
Binary files a/kubernetes/vid/resources/certs/org.onap.vid.trust.jks and /dev/null differ
index 2e74daa..8872863 100644 (file)
@@ -1,6 +1,7 @@
 {{/*
 # Copyright © 2017 Amdocs, Bell Canada
 # Copyright © 2020 Samsung Electronics
+# Copyright © 2021 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -36,7 +37,7 @@ spec:
         app: {{ include "common.name" . }}
         release: {{ include "common.release" . }}
     spec:
-      initContainers:
+      initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
       - command:
         - /app/ready.py
         args:
@@ -55,6 +56,15 @@ spec:
         - name: {{ include "common.name" . }}
           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          {{- if .Values.global.aafEnabled }}
+          command:
+          - sh
+          args:
+          - -c
+          - |
+            export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop | xargs -0)
+            /tmp/vid/localize.sh
+          {{- end }}
           ports:
           - containerPort: {{ .Values.service.internalPort }}
           # disable liveness probe when breakpoints set in debugger
@@ -100,8 +110,6 @@ spec:
               value: "{{ .Values.config.roleaccesscentralized }}"
             - name: VID_CONTACT_US_LINK
               value: "{{ .Values.config.vidcontactuslink }}"
-            - name: VID_KEYSTORE_PASSWORD
-              value: {{ .Values.config.vidkeystorepassword | quote }}
             - name: VID_UEB_URL_LIST
               value: message-router.{{ include "common.namespace" . }}
             - name: VID_MYSQL_HOST
@@ -116,9 +124,13 @@ spec:
               {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "vid-db-user-secret" "key" "password") | indent 14 }}
             - name: VID_MYSQL_MAXCONNECTIONS
               value: "{{ .Values.config.vidmysqlmaxconnections }}"
-          volumeMounts:
-          - mountPath: /opt/app/vid/etc
-            name: vid-certs
+            {{- if .Values.global.aafEnabled }}
+            - name: VID_KEYSTORE_FILENAME
+              value: "{{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.fqi_namespace }}.jks"
+            - name: VID_TRUSTSTORE_FILENAME
+              value: "{{ .Values.certInitializer.credsPath }}/{{ .Values.certInitializer.fqi_namespace }}.trust.jks"
+            {{- end }}
+          volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
           - mountPath: /etc/localtime
             name: localtime
             readOnly: true
@@ -149,10 +161,7 @@ spec:
             name: vid-logs
           - mountPath: /usr/share/filebeat/data
             name: vid-data-filebeat
-      volumes:
-        - name: vid-certs
-          secret:
-            secretName: {{ include "common.fullname" . }}-certs
+      volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: localtime
           hostPath:
             path: /etc/localtime
index 72934ff..670838c 100644 (file)
@@ -1,6 +1,7 @@
 {{/*
 # Copyright © 2017 Amdocs, Bell Canada
 # Copyright © 2020 Samsung Electronics
+# Copyright © 2021 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 */}}
 
 {{ include "common.secretFast" . }}
----
-apiVersion: v1
-kind: Secret
-metadata:
-  name: {{ include "common.fullname" . }}-certs
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.name" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-type: Opaque
-data:
-{{ tpl (.Files.Glob "resources/certs/*").AsSecrets . | indent 2 }}
index 8e8a17a..4510dc6 100644 (file)
@@ -1,5 +1,6 @@
 # Copyright © 2017 Amdocs, Bell Canada
 # Copyright © 2020 Samsung Electronics
+# Copyright © 2021 Orange
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -36,6 +37,53 @@ secrets:
     login: '{{ .Values.config.db.userName }}'
     password: '{{ .Values.config.db.userPassword }}'
 
+#################################################################
+# AAF part
+#################################################################
+certInitializer:
+  nameOverride: vid-cert-initializer
+  aafDeployFqi: deployer@people.osaaf.org
+  aafDeployPass: demo123456!
+  # aafDeployCredsExternalSecret: some secret
+  fqdn: vid
+  fqi: vid@vid.onap.org
+  public_fqdn: vid.onap.org
+  fqi_namespace: "org.onap.vid"
+  cadi_longitude: "0.0"
+  cadi_latitude: "0.0"
+  app_ns: org.osaaf.aaf
+  credsPath: /opt/app/osaaf/local
+  aaf_add_config: |
+    echo "*** retrieving password for keystore and trustore"
+    export $(/opt/app/aaf_config/bin/agent.sh local showpass \
+    {{.Values.fqi}} {{ .Values.fqdn }} | grep '^c' | xargs -0)
+    if [ -z "$cadi_keystore_password" ]
+    then
+      echo "  /!\ certificates retrieval failed"
+      exit 1
+    else
+      echo "*** changing them into shell safe ones"
+      export KEYSTORE_PASSWD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w64 | head -n1)
+      export TRUSTORE_PASSWD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w64 | head -n1)
+      cd {{ .Values.credsPath }}
+      keytool -storepasswd -new "${KEYSTORE_PASSWD}" \
+        -storepass "${cadi_keystore_password_jks}" \
+        -keystore {{ .Values.fqi_namespace }}.jks
+      keytool -storepasswd -new "${TRUSTORE_PASSWD}" \
+        -storepass "${cadi_truststore_password}" \
+        -keystore {{ .Values.fqi_namespace }}.trust.jks
+      echo "*** set key password as same password as keystore password"
+      keytool -keypasswd -new "${KEYSTORE_PASSWD}" \
+        -keystore {{ .Values.fqi_namespace }}.jks \
+        -keypass "${cadi_keystore_password_jks}" \
+        -storepass "${KEYSTORE_PASSWD}" -alias {{ .Values.fqi }}
+      echo "*** save the generated passwords"
+      echo "VID_KEYSTORE_PASSWORD=${KEYSTORE_PASSWD}" > mycreds.prop
+      echo "VID_TRUSTSTORE_PASSWORD=${TRUSTORE_PASSWD}" >> mycreds.prop
+      echo "*** change ownership of certificates to targeted user"
+      chown -R 1000 .
+    fi
+
 subChartsOnly:
   enabled: true
 
@@ -49,7 +97,6 @@ config:
     userName: vidadmin
 #    userCredentialsExternalSecret: some secret
 #    userPassword: password
-  vidkeystorepassword: 'F:.\,csU\&ew8\;tdVitnfo\}O\!g'
   asdcclientrestauth: "Basic dmlkOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU="
   asdcclientrestport: "8443"
   vidaaiport: "8443"