[DCAEGEN2] Use common secret template for cloudify password 99/111599/14
authorSchmalzried, Terry (ts862m) <ts862m@att.com>
Sat, 22 Aug 2020 00:42:33 +0000 (20:42 -0400)
committerJack Lucas <jflos@sonoris.net>
Fri, 25 Sep 2020 14:58:40 +0000 (10:58 -0400)
Link all references to cloudify password to ensure that it can be
automatically generated.
Set generated password strength to "basic" to work around
problem with Cloudify (DCAEGEN2-2450).

Issue-ID: DCAEGEN2-1975
Issue-ID: DCAEGEN2-2450
Change-Id: I53e154de854d33be686e830be8a827741bb3ec7e
Signed-off-by: Schmalzried, Terry (ts862m) <ts862m@att.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: vv770d <vv770d@att.com>
17 files changed:
kubernetes/dcaegen2/components/dcae-bootstrap/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-bootstrap/templates/secret.yaml
kubernetes/dcaegen2/components/dcae-bootstrap/values.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/secret.yaml
kubernetes/dcaegen2/components/dcae-cloudify-manager/values.yaml
kubernetes/dcaegen2/components/dcae-dashboard/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-dashboard/templates/secret.yaml
kubernetes/dcaegen2/components/dcae-dashboard/values.yaml
kubernetes/dcaegen2/components/dcae-deployment-handler/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-deployment-handler/templates/secrets.yaml [new file with mode: 0644]
kubernetes/dcaegen2/components/dcae-deployment-handler/values.yaml
kubernetes/dcaegen2/components/dcae-policy-handler/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-policy-handler/templates/secrets.yaml [new file with mode: 0644]
kubernetes/dcaegen2/components/dcae-policy-handler/values.yaml
kubernetes/dcaegen2/templates/secrets.yaml [new file with mode: 0644]
kubernetes/dcaegen2/values.yaml

index afacc26..4d10bcc 100644 (file)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -128,10 +128,7 @@ spec:
             - name: CMADDR
               value: {{ .Values.config.address.cm.host }}
             - name: CMPASS
-              valueFrom:
-                secretKeyRef:
-                  name: {{ include "common.name" . }}-cmpass
-                  key: password
+              {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cm-pass" "key" "password") | indent 14}}
             - name: CMPROTO
               value: {{ .Values.config.address.cm.proto }}
             - name: CMPORT
index 44395e4..6489659 100644 (file)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-apiVersion: v1
-kind: Secret
-metadata:
-  name: {{ include "common.name" . }}-cmpass
-  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:
-  password: YWRtaW4=
----
 {{ include "common.secretFast" . }}
index 6a1ed17..0da5134 100644 (file)
@@ -36,6 +36,10 @@ secrets:
     externalSecret: '{{ ternary "" (tpl (default "" .Values.postgres.config.pgRootPasswordExternalSecret) .) (hasSuffix "dcae-bootstrap-pg-root-pass" .Values.postgres.config.pgRootPasswordExternalSecret) }}'
     password: '{{ .Values.postgres.config.pgRootpassword }}'
     policy: generate
+  - uid: 'cm-pass'
+    type: password
+    externalSecret: '{{ tpl (default "" .Values.config.cloudifyManagerPasswordExternalSecret) . }}'
+    password: '{{ .Values.config.cloudifyManagerPassword }}'
 
 config:
   logstashServiceName: log-ls
index 539d202..8f379af 100644 (file)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -144,6 +144,9 @@ spec:
             name: cm-persistent
           - mountPath: /opt/onap/certs
             name: tls-info
+          - mountPath: /opt/onap/cm-secrets
+            name: cm-secrets
+            readOnly: true
           securityContext:
             privileged: True
       volumes:
@@ -171,5 +174,8 @@ spec:
         {{- end }}
         - emptyDir: {}
           name: tls-info
+        - name: cm-secrets
+          secret:
+            secretName: {{ include "common.secret.getSecretNameFast" (dict "global" . "uid" "cm-pass") }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index dee9200..876b971 100644 (file)
@@ -41,3 +41,5 @@ metadata:
   annotations:
     kubernetes.io/service-account.name: default
 type: kubernetes.io/service-account-token
+---
+{{ include "common.secretFast" . }}
index 1010152..a2ee160 100644 (file)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,7 +31,15 @@ global:
     user: docker
     password: docker
 
+secrets:
+  - uid: 'cm-pass'
+    type: password
+    externalSecret: '{{ tpl (default "" .Values.config.cloudifyManagerPasswordExternalSecret) . }}'
+    password: '{{ .Values.config.cloudifyManagerPassword }}'
+    policy: required
+
 config:
+  cloudifyManagerPassword: "override me"
   logstashServiceName: log-ls
   logstashPort: 5044
   # Addresses of other ONAP entities
index 25e595f..404927c 100644 (file)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ spec:
             - name: postgres_port
               value: "{{ .Values.postgres.config.pgPort }}"
             - name: cloudify_password
-              value: admin
+              {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cm-pass" "key" "password") | indent 14 }}
             - name: dhandler_url
               value: {{ .Values.config.dhandler_url }}
             - name: cfy_url
index b143034..34932b7 100644 (file)
@@ -1,16 +1,17 @@
 {{/*
 # Copyright © 2020 Samsung Electronics
-# #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# #
-#       http://www.apache.org/licenses/LICENSE-2.0
-# #
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 */}}
+
 {{ include "common.secretFast" . }}
index 7aa9b68..a86a1ee 100644 (file)
@@ -34,8 +34,14 @@ secrets:
     login: '{{ .Values.postgres.config.pgUserName }}'
     password: '{{ .Values.postgres.config.pgUserPassword }}'
     passwordPolicy: generate
+  - uid: 'cm-pass'
+    type: password
+    externalSecret: '{{ tpl (default "" .Values.config.cloudifyManagerPasswordExternalSecret) . }}'
+    password: '{{ .Values.config.cloudifyManagerPassword }}'
+    policy: required
 
 config:
+  cloudifyManagerPassword: "override me"
   logstashServiceName: log-ls
   logstashPort: 5044
   dhandler_url: https://deployment-handler:8443
index 1a28bc4..88ec5cb 100755 (executable)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2020 Nokia
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -124,7 +124,7 @@ spec:
             - name: CLOUDIFY_USER
               value: admin
             - name: CLOUDIFY_PASSWORD
-              value: admin
+              {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cm-pass" "key" "password") | indent 14 }}
             - name: CONFIG_BINDING_SERVICE
               value: config-binding-service
             - name: NODE_EXTRA_CA_CERTS
diff --git a/kubernetes/dcaegen2/components/dcae-deployment-handler/templates/secrets.yaml b/kubernetes/dcaegen2/components/dcae-deployment-handler/templates/secrets.yaml
new file mode 100644 (file)
index 0000000..34932b7
--- /dev/null
@@ -0,0 +1,17 @@
+{{/*
+# Copyright © 2020 Samsung Electronics
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+{{ include "common.secretFast" . }}
index f281f6b..7e340db 100644 (file)
@@ -31,7 +31,15 @@ global:
     user: docker
     password: docker
 
+secrets:
+  - uid: 'cm-pass'
+    type: password
+    externalSecret: '{{ tpl (default "" .Values.config.cloudifyManagerPasswordExternalSecret) . }}'
+    password: '{{ .Values.config.cloudifyManagerPassword }}'
+    policy: required
+
 config:
+  cloudifyManagerPassword: "override me"
   logstashServiceName: log-ls
   logstashPort: 5044
   # Addresses of other ONAP entities
index a29e334..61084fa 100644 (file)
@@ -1,6 +1,6 @@
 #============LICENSE_START========================================================
 # ================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -117,7 +117,7 @@ spec:
             - name: CLOUDIFY_USER
               value: admin
             - name: CLOUDIFY_PASSWORD
-              value: admin
+              {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cm-pass" "key" "password") | indent 14 }}
             - name: CONFIG_BINDING_SERVICE
               value: config-binding-service
             - name: POD_IP
diff --git a/kubernetes/dcaegen2/components/dcae-policy-handler/templates/secrets.yaml b/kubernetes/dcaegen2/components/dcae-policy-handler/templates/secrets.yaml
new file mode 100644 (file)
index 0000000..34932b7
--- /dev/null
@@ -0,0 +1,17 @@
+{{/*
+# Copyright © 2020 Samsung Electronics
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+{{ include "common.secretFast" . }}
index 2d09308..4a587d8 100644 (file)
@@ -31,7 +31,15 @@ global:
     user: docker
     password: docker
 
+secrets:
+  - uid: 'cm-pass'
+    type: password
+    externalSecret: '{{ tpl (default "" .Values.config.cloudifyManagerPasswordExternalSecret) . }}'
+    password: '{{ .Values.config.cloudifyManagerPassword }}'
+    policy: required
+
 config:
+  cloudifyManagerPassword: "override me"
   logstashServiceName: log-ls
   logstashPort: 5044
   # Addresses of other ONAP entities
diff --git a/kubernetes/dcaegen2/templates/secrets.yaml b/kubernetes/dcaegen2/templates/secrets.yaml
new file mode 100644 (file)
index 0000000..34932b7
--- /dev/null
@@ -0,0 +1,17 @@
+{{/*
+# Copyright © 2020 Samsung Electronics
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/}}
+
+{{ include "common.secretFast" . }}
index 939bd11..1918a8f 100644 (file)
@@ -1,5 +1,6 @@
 # Copyright © 2018 Amdocs, Bell Canada
 # Modifications Copyright © 2018-2019 AT&T
+# Modifications Copyright © 2020 Samsung Electronics
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -25,22 +26,47 @@ global:
   busyboxRepository: docker.io
   busyboxImage: library/busybox:1.30
 
+#################################################################
+# Secrets metaconfig
+#################################################################
+secrets:
+- name: &cmPassSecretName '{{ include "common.release" . }}-dcaegen2-cm-pass'
+  type: password
+  externalSecret: '{{ tpl (default "" .Values.config.cloudifyManagerPasswordExternalSecret) . }}'
+  password: '{{ .Values.config.cloudifyManagerPassword }}'
+
+config: {}
+
+# To work around DCAEGEN2-2450, set password strength to "basic"
+# to ensure password contains only alphanumerics
+passwordStrengthOverride: basic
+
 # Enable all DCAE components by default
 dcae-bootstrap:
   enabled: true
+  config:
+    cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-cloudify-manager:
   enabled: true
+  config:
+    cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-config-binding-service:
   enabled: true
 dcae-dashboard:
   enabled: true
+  config:
+    cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-deployment-handler:
   enabled: true
+  config:
+    cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-healthcheck:
   enabled: true
 dcae-inventory-api:
   enabled: true
 dcae-policy-handler:
   enabled: true
+  config:
+    cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-servicechange-handler:
   enabled: true