[DCAEGEN2] Updates for R10 31/125731/3
authorJack Lucas <jflos@sonoris.net>
Mon, 1 Nov 2021 20:54:12 +0000 (16:54 -0400)
committerJack Lucas <jflos@sonoris.net>
Fri, 19 Nov 2021 15:05:00 +0000 (10:05 -0500)
By default, disable all dcaegen2 components except
config-binding-service, healthcheck,
and ves-openapi-manager.

Fix DNS name for the ONAP consul instance.

Move mongodb dependency from dcae-bootstrap to dcae-tcagen2.

Fix the generation of the JSON list of expected components for the
healthcheck services. (Previously could have a spurious leading
",")

Update healthcheck-container version to 2.3.0 for
logging enhancements and updated base image.

Issue-ID: DCAEGEN2-2968
Issue-ID: DCAEGEN2-2958
Issue-ID: DCAEGEN2-2983
Signed-off-by: Jack Lucas <jflos@sonoris.net>
Change-Id: I4bcce1d3e43e2e5c7cc2c3179870de72b55d5d2e

kubernetes/dcaegen2-services/common/dcaegen2-services-common/templates/_deployment.tpl
kubernetes/dcaegen2-services/components/dcae-ms-healthcheck/values.yaml
kubernetes/dcaegen2-services/components/dcae-tcagen2/requirements.yaml
kubernetes/dcaegen2-services/components/dcae-tcagen2/values.yaml
kubernetes/dcaegen2-services/resources/expected-components.json
kubernetes/dcaegen2/components/dcae-bootstrap/requirements.yaml
kubernetes/dcaegen2/components/dcae-bootstrap/values.yaml
kubernetes/dcaegen2/components/dcae-config-binding-service/templates/deployment.yaml
kubernetes/dcaegen2/components/dcae-healthcheck/values.yaml
kubernetes/dcaegen2/resources/expected-components.json
kubernetes/dcaegen2/values.yaml

index dd0bf4b..aac0f4b 100644 (file)
@@ -272,6 +272,9 @@ spec:
         args:
         - --key-yaml
         - "{{ include "common.name" . }}|/app-config/application_config.yaml"
+        env:
+        - name: CONSUL_HOST
+          value: {{ .Values.consulHost | default "consul-server-ui" }}.{{ include "common.namespace" . }}
         resources: {{ include "common.resources" . | nindent 2 }}
         volumeMounts:
           - mountPath: /app-config
index 8ec60a7..58ae706 100644 (file)
@@ -43,7 +43,7 @@ readiness:
   initialDelaySeconds: 10
   periodSeconds: 10
 # application image
-image: onap/org.onap.dcaegen2.deployments.healthcheck-container:2.2.0
+image: onap/org.onap.dcaegen2.deployments.healthcheck-container:2.3.0
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 48673fe..a5ab9d6 100644 (file)
@@ -33,3 +33,6 @@ dependencies:
   - name: serviceAccount
     version: ~9.x-0
     repository: '@local'
+  - name: mongo
+    version: ~9.x-0
+    repository: '@local'
\ No newline at end of file
index e7707dc..2ba8edb 100644 (file)
@@ -86,6 +86,21 @@ service:
     - port: 9091
       name: http
 
+# mongoDB overrides
+mongo:
+  nameOverride: dcae-mongo
+  config:
+    dbName: dcaecommondb
+  service:
+    name: dcae-mongohost
+    internalPort: 27017
+  nfsprovisionerPrefix: dcaemongo
+  sdnctlPrefix: tcagen2
+  persistence:
+    mountSubPath: dcae/mongo/data
+    enabled: true
+  disableNfsProvisioner: true
+
 # Policy configuraiton properties
 # if enabled, policy-sync side car will be deployed
 #dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1
index 948c479..f654ac8 100644 (file)
@@ -1,28 +1,52 @@
 {{/*
-#============LICENSE_START========================================================
-================================================================================
-# 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.
-# 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=========================================================
+  ============LICENSE_START========================================================
+  =================================================================================
+  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.
+  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=========================================================
 */}}
-[
-{{- $ctx := . }}
-{{- $components := tuple "dcae-hv-ves-collector" "dcae-prh" "dcae-tcagen2" "dcae-ves-collector" }}
-{{- range $i, $v := $components }}
-{{- if index $ctx.Values . "enabled" }}
-{{- if $i }},{{ end }}
-{{ $v | quote | indent 2 }}
+
+{{/*
+
+  This template generates a JSON file with an array containing the names of the
+  components that the healthcheck container always expects to see--that is, the
+  components that are enabled in the top-level values.yaml file.
+
+  The code loops through the list of components ($components) and checks each component's
+  entry in the values.yaml file is set to "enabled".  It adds the name of each enabled
+  component to the list.
+
+  There is a bit of Helm trickery here--the code uses a dict ($enabled), because that's
+  apparently the only way to create a variable outside of a range loop that can be updated
+  from within the range loop.  The code here generates a list of the components that are
+  enabled in values.yaml, and stores it into the list called "enabled" in the dictionary
+  $enabled.
+
+  Note also the assignment to an otherwise unused variable ($x) in the loop.  Without that
+  assignment, the updated value of the $enabled.enabled list would be rendered into the
+  file each time an enabled component is found.
+
+*/}}
+
+{{- $ctx := . -}}
+{{- $components := list "dcae-hv-ves-collector" "dcae-prh" "dcae-tcagen2" "dcae-ves-collector" -}}
+{{- $enabled := dict "enabled" list -}}
+{{- range $components -}}
+  {{- if index $ctx.Values . "enabled" -}}
+    {{- $x:= . | append $enabled.enabled  | set $enabled "enabled" -}}
+  {{- end -}}
 {{- end -}}
-{{- end }}
-]
+{{- $enabled.enabled | toJson }}
+
+
index 4dcaff6..aa47c66 100644 (file)
@@ -27,9 +27,6 @@ dependencies:
     version: ~9.x-0
     repository: '@local'
     alias: postgres
-  - name: mongo
-    version: ~9.x-0
-    repository: '@local'
   - name: repositoryGenerator
     version: ~9.x-0
     repository: '@local'
index b012ee4..5b568c6 100644 (file)
@@ -89,20 +89,6 @@ postgres:
     mountSubPath: dcae/data
     mountInitPath: dcae
 
-mongo:
-  nameOverride: dcae-mongo
-  config:
-    dbName: dcaecommondb
-  service:
-    name: dcae-mongohost
-    internalPort: 27017
-  nfsprovisionerPrefix: dcaemongo
-  sdnctlPrefix: tcagen2
-  persistence:
-    mountSubPath: dcae/mongo/data
-    enabled: true
-  disableNfsProvisioner: true
-
 # application image
 image: onap/org.onap.dcaegen2.deployments.k8s-bootstrap-container:3.3.5
 default_k8s_location: central
index c7e1d70..171fc7c 100644 (file)
@@ -2,6 +2,7 @@
 #============LICENSE_START========================================================
 # ================================================================================
 # Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
+# 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.
@@ -106,7 +107,7 @@ spec:
             mountPath: /opt/tls
           env:
             - name: CONSUL_HOST
-              value: consul.{{ include "common.namespace" . }}
+              value: consul-server-ui.{{ include "common.namespace" . }}
             - name: USE_HTTPS
               value: "1"
             - name: HTTPS_CERT_PATH
@@ -154,7 +155,7 @@ spec:
             mountPath: /opt/logs
           env:
             - name: CONSUL_HOST
-              value: consul.{{ include "common.namespace" . }}
+              value: consul-server-ui.{{ include "common.namespace" . }}
         - name: {{ include "common.name" . }}-fb-onap-i
           image: {{ include "repositoryGenerator.image.logging" . }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
index 1c6cff0..8134e0d 100644 (file)
@@ -42,7 +42,7 @@ readiness:
   initialDelaySeconds: 10
   periodSeconds: 10
 # application image
-image: onap/org.onap.dcaegen2.deployments.healthcheck-container:2.2.0
+image: onap/org.onap.dcaegen2.deployments.healthcheck-container:2.3.0
 
 # Resource Limit flavor -By Default using small
 flavor: small
index 6b3a221..50c3184 100644 (file)
@@ -1,10 +1,51 @@
-[
-{{- $ctx := . }}
-{{- $components := tuple "dcae-cloudify-manager" "dcae-config-binding-service" "dcae-dashboard" "dcae-deployment-handler" "dcae-inventory-api" "dcae-policy-handler" "dcae-servicechange-handler" "dcae-ves-openapi-manager" }}
-{{- range $i, $v := $components }}
-{{- if index $ctx.Values . "enabled" }}
-{{- if $i }},{{ end }}
-{{ $v | quote | indent 2 }}
+{{/*
+  ============LICENSE_START========================================================
+  =================================================================================
+  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.
+  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=========================================================
+*/}}
+
+{{/*
+
+  This template generates a JSON file with an array containing the names of the
+  components that the healthcheck container always expects to see--that is, the
+  components that are enabled in the top-level values.yaml file.
+
+  The code loops through the list of components ($components) and checks each component's
+  entry in the values.yaml file is set to "enabled".  It adds the name of each enabled
+  component to the list.
+
+  There is a bit of Helm trickery here--the code uses a dict ($enabled), because that's
+  apparently the only way to create a variable outside of a range loop that can be updated
+  from within the range loop.  The code here generates a list of the components that are
+  enabled in values.yaml, and stores it into the list called "enabled" in the dictionary
+  $enabled.
+
+  Note also the assignment to an otherwise unused variable ($x) in the loop.  Without that
+  assignment, the updated value of the $enabled.enabled list would be rendered into the
+  file each time an enabled component is found.
+
+*/}}
+
+{{- $ctx := . -}}
+{{- $components := list "dcae-cloudify-manager" "dcae-config-binding-service" "dcae-dashboard" "dcae-deployment-handler" "dcae-inventory-api" "dcae-policy-handler" "dcae-servicechange-handler" "dcae-ves-openapi-manager" -}}
+{{- $enabled := dict "enabled" list -}}
+{{- range $components -}}
+  {{- if index $ctx.Values . "enabled" -}}
+    {{- $x:= . | append $enabled.enabled  | set $enabled "enabled" -}}
+  {{- end -}}
 {{- end -}}
-{{- end }}
-]
+{{- $enabled.enabled | toJson }}
+
index 17b077b..7ce58ba 100644 (file)
@@ -40,32 +40,32 @@ passwordStrengthOverride: basic
 
 # Enable all DCAE components by default
 dcae-bootstrap:
-  enabled: true
+  enabled: false
   config:
     cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-cloudify-manager:
-  enabled: true
+  enabled: false
   config:
     cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-config-binding-service:
   enabled: true
 dcae-dashboard:
-  enabled: true
+  enabled: false
   config:
     cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-deployment-handler:
-  enabled: true
+  enabled: false
   config:
     cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-healthcheck:
   enabled: true
 dcae-inventory-api:
-  enabled: true
+  enabled: false
 dcae-policy-handler:
-  enabled: true
+  enabled: false
   config:
     cloudifyManagerPasswordExternalSecret: *cmPassSecretName
 dcae-servicechange-handler:
-  enabled: true
+  enabled: false
 dcae-ves-openapi-manager:
   enabled: true