[DCAEGEN2] Updates to bootstrap and cm-container

Update cm-container to 4.1.0
Update bootstrap to 3.0.0
Move plugin configuration from bootstrap to cm-container
Remove unneeded inputs files

Issue-ID: DCAEGEN2-2542
Issue-ID: DCAEGEN2-2582
Issue-ID: DCAEGEN2-2543
Issue-ID: DCAEGEN2-2383
Signed-off-by: Jack Lucas <jflos@sonoris.net>
Change-Id: I30a3f549d9811adedc8472fd410038eaa068e771
diff --git a/kubernetes/dcaegen2/components/dcae-cloudify-manager/requirements.yaml b/kubernetes/dcaegen2/components/dcae-cloudify-manager/requirements.yaml
index af43e0f..c06e459 100644
--- a/kubernetes/dcaegen2/components/dcae-cloudify-manager/requirements.yaml
+++ b/kubernetes/dcaegen2/components/dcae-cloudify-manager/requirements.yaml
@@ -1,5 +1,6 @@
 # Copyright © 2017 Amdocs, Bell Canada
 # Modifications Copyright © 2018 AT&T
+# Copyright (c) 2021 J. F. Lucas.  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.
@@ -19,4 +20,7 @@
     repository: '@local'
   - name: repositoryGenerator
     version: ~7.x-0
+    repository: '@local'
+  - name: cmpv2Config
+    version: ~7.x-0
     repository: '@local'
\ No newline at end of file
diff --git a/kubernetes/dcaegen2/components/dcae-cloudify-manager/resources/config/plugins/dmaap-plugin.json b/kubernetes/dcaegen2/components/dcae-cloudify-manager/resources/config/plugins/dmaap-plugin.json
new file mode 100644
index 0000000..44a3454
--- /dev/null
+++ b/kubernetes/dcaegen2/components/dcae-cloudify-manager/resources/config/plugins/dmaap-plugin.json
@@ -0,0 +1,7 @@
+{
+    "dmaap": {
+        "username": "notused",
+        "password": "doesnotmatter",
+        "owner": "dcaecm"
+    }
+}
\ No newline at end of file
diff --git a/kubernetes/dcaegen2/components/dcae-cloudify-manager/resources/config/plugins/k8s-plugin.json b/kubernetes/dcaegen2/components/dcae-cloudify-manager/resources/config/plugins/k8s-plugin.json
new file mode 100644
index 0000000..c967774
--- /dev/null
+++ b/kubernetes/dcaegen2/components/dcae-cloudify-manager/resources/config/plugins/k8s-plugin.json
@@ -0,0 +1,59 @@
+{{/*
+#============LICENSE_START========================================================
+#=================================================================================
+# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
+# Modifications Copyright © 2018 Amdocs, Bell Canada
+# Modifications (c) 2020 Nokia. 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.
+# 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.
+# ============LICENSE_END=========================================================
+*/}}
+{
+  "namespace": "{{ if .Values.dcae_ns }}{{ .Values.dcae_ns}}{{ else }}{{include "common.namespace" . }}{{ end}}",
+  "consul_dns_name": "{{ .Values.config.address.consul.host }}.{{ include "common.namespace" . }}",
+  "default_k8s_location": "{{ .Values.default_k8s_location }}",
+  "image_pull_secrets": [
+    "{{ include "common.namespace" . }}-docker-registry-key"
+  ],
+  "filebeat": {
+    "log_path": "/var/log/onap",
+    "data_path": "/usr/share/filebeat/data",
+    "config_path": "/usr/share/filebeat/filebeat.yml",
+    "config_subpath": "filebeat.yml",
+    "image": "{{  include "repositoryGenerator.image.logging" . }}",
+    "config_map": "{{ include "common.release" . }}-dcae-filebeat-configmap"
+  },
+  "tls": {
+    "cert_path": "/opt/app/osaaf",
+    "image": "{{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}",
+    "component_cert_dir": "/opt/dcae/cacert",
+    "component_ca_cert_path": "/opt/dcae/cacert/cacert.pem",
+    "ca_cert_configmap": "{{ include "common.fullname" . }}-dcae-cacert"
+  },
+  "external_cert": {
+    "image_tag": "{{ include "repositoryGenerator.repository" . }}/{{ .Values.cmpv2Config.global.platform.certServiceClient.image }}",
+    "request_url": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.requestURL }}",
+    "timeout": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.requestTimeout }}",
+    "country": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.cmpv2Country }}",
+    "organization": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.cmpv2Organization }}",
+    "state": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.cmpv2State }}",
+    "organizational_unit": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.cmpv2OrganizationalUnit }}",
+    "location": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.cmpv2Location }}",
+    "cert_secret_name": "{{ .Values.cmpv2Config.global.platform.certServiceClient.secretName }}",
+    "keystore_password": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.keystorePassword }}",
+    "truststore_password": "{{ .Values.cmpv2Config.global.platform.certServiceClient.envVariables.truststorePassword }}"
+  },
+  "cert_post_processor": {
+    "image_tag": "{{ include "repositoryGenerator.repository" . }}/{{ .Values.cmpv2Config.global.platform.certPostProcessor.image }}"
+  }
+}
diff --git a/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/configmap.yaml b/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/configmap.yaml
index 6ec98b5..806b06e 100644
--- a/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/configmap.yaml
+++ b/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/configmap.yaml
@@ -3,6 +3,7 @@
 # ================================================================================
 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
+# Copyright (c) 2021 J. F. Lucas.  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.
@@ -17,7 +18,6 @@
 # limitations under the License.
 # ============LICENSE_END=========================================================
 */}}
-
 apiVersion: v1
 kind: ConfigMap
 metadata:
@@ -29,6 +29,14 @@
 apiVersion: v1
 kind: ConfigMap
 metadata:
+  name: {{ include "common.fullname" . }}-plugins
+  namespace: {{ include "common.namespace" . }}
+data:
+{{ tpl (.Files.Glob "resources/config/plugins/*").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
   name: {{ include "common.release" . }}-dcae-filebeat-configmap
   namespace: {{include "common.namespace" . }}
 data:
diff --git a/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/deployment.yaml b/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/deployment.yaml
index 6c7fa4d..204a3e2 100644
--- a/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/deployment.yaml
+++ b/kubernetes/dcaegen2/components/dcae-cloudify-manager/templates/deployment.yaml
@@ -3,7 +3,7 @@
 # ================================================================================
 # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
-# Copyright (c) 2020 J. F. Lucas.  All rights reserved.
+# Copyright (c) 2020-2021 J. F. Lucas.  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.
@@ -46,6 +46,8 @@
       - ip: "127.0.0.1"
         hostnames:
         - "dcae-cloudify-manager"
+      # Cloudify requires a fixed hostname across restarts
+      hostname: dcae-cloudify-manager
       initContainers:
       - name: {{ include "common.name" . }}-readiness
         image: {{ include "repositoryGenerator.image.readiness" . }}
@@ -55,6 +57,8 @@
         args:
           - --container-name
           - aaf-cm
+          - --container-name
+          - consul-server
           - "-t"
           - "15"
         env:
@@ -71,6 +75,18 @@
           - {{ include "common.namespace" . }}
           - --configmap
           - {{ .Values.multisiteConfigMapName }}
+      - name: init-consul
+        image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.consulLoaderImage }}
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        args:
+        - --key
+        - k8s-plugin|/plugin-configs/k8s-plugin.json
+        - --key
+        - dmaap-plugin|/plugin-configs/dmaap-plugin.json
+        resources: {}
+        volumeMounts:
+          - mountPath: /plugin-configs
+            name: plugin-configs
       - name: init-tls
         env:
           - name: POD_IP
@@ -160,6 +176,9 @@
         - name: {{ include "common.fullname" .}}-kubeconfig
           configMap:
             name: {{ .Values.multisiteConfigMapName }}
+        - name: plugin-configs
+          configMap:
+            name: {{ include "common.fullname" . }}-plugins
         - name: dcae-token
           secret:
             secretName: dcae-token
diff --git a/kubernetes/dcaegen2/components/dcae-cloudify-manager/values.yaml b/kubernetes/dcaegen2/components/dcae-cloudify-manager/values.yaml
index e187e11..891c0e1 100644
--- a/kubernetes/dcaegen2/components/dcae-cloudify-manager/values.yaml
+++ b/kubernetes/dcaegen2/components/dcae-cloudify-manager/values.yaml
@@ -2,7 +2,7 @@
 # ================================================================================
 # Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved.
 # Modifications Copyright © 2018 Amdocs, Bell Canada
-# Copyright (c) 2020 J. F. Lucas.  All rights reserved.
+# Copyright (c) 2020-2021 J. F. Lucas.  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.
@@ -24,6 +24,7 @@
   nodePortPrefix: 302
   persistence: {}
   tlsImage: onap/org.onap.dcaegen2.deployments.tls-init-container:2.1.0
+  consulLoaderImage: onap/org.onap.dcaegen2.deployments.consul-loader-container:1.0.0
   repositoryCred:
     user: docker
     password: docker
@@ -49,7 +50,7 @@
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/org.onap.dcaegen2.deployments.cm-container:3.4.2
+image: onap/org.onap.dcaegen2.deployments.cm-container:4.1.0
 pullPolicy: Always
 
 # name of shared ConfigMap with kubeconfig for multiple clusters
@@ -61,6 +62,9 @@
 # image for cleanup job container
 cleanupImage: onap/org.onap.dcaegen2.deployments.dcae-k8s-cleanup-container:1.0.0
 
+# default location for k8s deployments via Cloudify
+default_k8s_location: central
+
 # probe configuration parameters
 liveness:
   initialDelaySeconds: 10