From 671f59b6b2e915ed7e5ac3a3b82b88a1395c7c70 Mon Sep 17 00:00:00 2001 From: dglFromAtt Date: Wed, 13 Mar 2019 15:50:40 +0000 Subject: [PATCH] Attempt2: Post-install jobs for DMaaP Provisioning This was originally committed under 81992 but got a merge conflict. I messed up resolving it so I abandoned 81992 and created this new commit. patchset2: replaced Release.Name for common.fullname in one of the charts patchset3: at Borislav's request, changed other references to common.fullname so the approach is consistent throughout the configmaps used for initialization. Along the way, hit a limit of 53 chars on some resource name. So changed the directory from the verbose dmaap-bus-controller to the more terse dbc. Change-Id: I1078003de094fee95c681f7fdaecb567235b7b3e Signed-off-by: dglFromAtt Issue-ID: DMAAP-904 Signed-off-by: dglFromAtt --- kubernetes/dmaap/Chart.yaml | 2 +- kubernetes/dmaap/Makefile | 7 +- .../{dmaap-bus-controller => dbc}/.helmignore | 0 .../{dmaap-bus-controller => dbc}/Chart.yaml | 4 +- .../{dmaap-bus-controller => dbc}/README.md | 0 .../requirements.yaml | 0 .../resources/config/buscontroller.env | 0 .../resources/config/dmaapbc.properties | 0 .../resources/dcaeLocations/san-francisco.json | 0 .../resources/dmaap/onap.json | 0 .../resources/mr_clusters/san-francisco.json | 0 .../templates/NOTES.txt | 0 .../templates/configmap.yaml | 43 +------------ .../templates/deployment.yaml | 26 -------- .../components/dbc/templates/post-install-job.yaml | 67 +++++++++++++++++++ .../templates/service.yaml | 0 .../{dmaap-bus-controller => dbc}/values.yaml | 9 ++- .../resources/config/log/filebeat/filebeat.yml | 60 +++++++++++++++++ .../dmaap-dr-node/resources/dr_nodes/central.yaml | 6 ++ .../dmaap-dr-node/resources/dr_nodes/edge.yaml | 6 ++ .../dmaap-dr-node/templates/configmap.yaml | 21 ++++++ .../dmaap-dr-node/templates/post-install-job.yaml | 62 ++++++++++++++++++ .../dmaap-dr-node/templates/statefulset.yaml | 4 +- .../resources/config/log/filebeat/filebeat.yml | 60 +++++++++++++++++ .../resources/feeds/DefaultPM.json | 0 .../resources/feeds/README | 0 .../dmaap-dr-prov/templates/configmap.yaml | 47 ++++++++++++++ .../dmaap-dr-prov/templates/deployment.yaml | 4 +- .../dmaap-dr-prov/templates/post-install-job.yaml | 75 ++++++++++++++++++++++ .../message-router/resources/topics/MMagent.json | 19 ++++++ .../resources/topics/PNF_READY.json | 0 .../resources/topics/PNF_REGISTRATION.json | 0 .../resources/topics/README | 0 .../message-router/templates/configmap.yaml | 27 ++++++++ .../message-router/templates/post-install-job.yaml | 66 +++++++++++++++++++ kubernetes/dmaap/requirements.yaml | 4 +- kubernetes/dmaap/templates/configmap.yaml | 2 +- kubernetes/dmaap/values.yaml | 5 +- 38 files changed, 542 insertions(+), 84 deletions(-) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/.helmignore (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/Chart.yaml (93%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/README.md (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/requirements.yaml (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/resources/config/buscontroller.env (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/resources/config/dmaapbc.properties (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/resources/dcaeLocations/san-francisco.json (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/resources/dmaap/onap.json (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/resources/mr_clusters/san-francisco.json (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/templates/NOTES.txt (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/templates/configmap.yaml (57%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/templates/deployment.yaml (74%) create mode 100644 kubernetes/dmaap/components/dbc/templates/post-install-job.yaml rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/templates/service.yaml (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dbc}/values.yaml (93%) create mode 100644 kubernetes/dmaap/components/dmaap-dr-node/resources/config/log/filebeat/filebeat.yml create mode 100644 kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/central.yaml create mode 100644 kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/edge.yaml create mode 100644 kubernetes/dmaap/components/dmaap-dr-node/templates/post-install-job.yaml create mode 100644 kubernetes/dmaap/components/dmaap-dr-prov/resources/config/log/filebeat/filebeat.yml rename kubernetes/dmaap/components/{dmaap-bus-controller => dmaap-dr-prov}/resources/feeds/DefaultPM.json (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => dmaap-dr-prov}/resources/feeds/README (100%) create mode 100644 kubernetes/dmaap/components/dmaap-dr-prov/templates/post-install-job.yaml create mode 100644 kubernetes/dmaap/components/message-router/resources/topics/MMagent.json rename kubernetes/dmaap/components/{dmaap-bus-controller => message-router}/resources/topics/PNF_READY.json (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => message-router}/resources/topics/PNF_REGISTRATION.json (100%) rename kubernetes/dmaap/components/{dmaap-bus-controller => message-router}/resources/topics/README (100%) create mode 100644 kubernetes/dmaap/components/message-router/templates/post-install-job.yaml diff --git a/kubernetes/dmaap/Chart.yaml b/kubernetes/dmaap/Chart.yaml index e3d629bb9a..810e863128 100644 --- a/kubernetes/dmaap/Chart.yaml +++ b/kubernetes/dmaap/Chart.yaml @@ -16,4 +16,4 @@ apiVersion: v1 description: ONAP DMaaP components name: dmaap -version: 4.0.0 +version: 4.0.1 diff --git a/kubernetes/dmaap/Makefile b/kubernetes/dmaap/Makefile index 847366d52c..e952a2b632 100644 --- a/kubernetes/dmaap/Makefile +++ b/kubernetes/dmaap/Makefile @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -make-dmaap: make-bus-controller make-message-router make-dmaap-dr-node make-dmaap-dr-prov +make-dmaap: make-dbc make-message-router make-dmaap-dr-node make-dmaap-dr-prov -make-bus-controller: - cd components && helm dep up dmaap-bus-controller && helm lint dmaap-bus-controller +make-dbc: + cd components && helm dep up dbc && helm lint dbc make-message-router: cd components && helm dep up message-router && helm lint message-router @@ -28,3 +28,4 @@ make-dmaap-dr-prov: clean: @find . -type f -name '*.tgz' -delete + @find . -type f -name '*.lock' -delete diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/.helmignore b/kubernetes/dmaap/components/dbc/.helmignore similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/.helmignore rename to kubernetes/dmaap/components/dbc/.helmignore diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/Chart.yaml b/kubernetes/dmaap/components/dbc/Chart.yaml similarity index 93% rename from kubernetes/dmaap/components/dmaap-bus-controller/Chart.yaml rename to kubernetes/dmaap/components/dbc/Chart.yaml index fc2ba21e29..bd07b7a102 100644 --- a/kubernetes/dmaap/components/dmaap-bus-controller/Chart.yaml +++ b/kubernetes/dmaap/components/dbc/Chart.yaml @@ -14,6 +14,6 @@ # limitations under the License. apiVersion: v1 -description: a Helm chart to deploy ONAP DMaaP Bus Controller (aka dmaap-prov) in Kubernetes -name: dmaap-bus-controller +description: a Helm chart to deploy ONAP DMaaP Bus Controller (aka dmaap-bc) in Kubernetes +name: dbc version: 4.0.0 diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/README.md b/kubernetes/dmaap/components/dbc/README.md similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/README.md rename to kubernetes/dmaap/components/dbc/README.md diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/requirements.yaml b/kubernetes/dmaap/components/dbc/requirements.yaml similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/requirements.yaml rename to kubernetes/dmaap/components/dbc/requirements.yaml diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/config/buscontroller.env b/kubernetes/dmaap/components/dbc/resources/config/buscontroller.env similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/config/buscontroller.env rename to kubernetes/dmaap/components/dbc/resources/config/buscontroller.env diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/config/dmaapbc.properties b/kubernetes/dmaap/components/dbc/resources/config/dmaapbc.properties similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/config/dmaapbc.properties rename to kubernetes/dmaap/components/dbc/resources/config/dmaapbc.properties diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/dcaeLocations/san-francisco.json b/kubernetes/dmaap/components/dbc/resources/dcaeLocations/san-francisco.json similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/dcaeLocations/san-francisco.json rename to kubernetes/dmaap/components/dbc/resources/dcaeLocations/san-francisco.json diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/dmaap/onap.json b/kubernetes/dmaap/components/dbc/resources/dmaap/onap.json similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/dmaap/onap.json rename to kubernetes/dmaap/components/dbc/resources/dmaap/onap.json diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/mr_clusters/san-francisco.json b/kubernetes/dmaap/components/dbc/resources/mr_clusters/san-francisco.json similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/mr_clusters/san-francisco.json rename to kubernetes/dmaap/components/dbc/resources/mr_clusters/san-francisco.json diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/templates/NOTES.txt b/kubernetes/dmaap/components/dbc/templates/NOTES.txt similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/templates/NOTES.txt rename to kubernetes/dmaap/components/dbc/templates/NOTES.txt diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/templates/configmap.yaml b/kubernetes/dmaap/components/dbc/templates/configmap.yaml similarity index 57% rename from kubernetes/dmaap/components/dmaap-bus-controller/templates/configmap.yaml rename to kubernetes/dmaap/components/dbc/templates/configmap.yaml index ead7562a59..1066c946af 100644 --- a/kubernetes/dmaap/components/dmaap-bus-controller/templates/configmap.yaml +++ b/kubernetes/dmaap/components/dbc/templates/configmap.yaml @@ -29,7 +29,7 @@ data: apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.fullname" . }}-dmaap + name: {{ include "common.fullname" . }}-dbc-dmaap namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} @@ -42,7 +42,7 @@ data: apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "common.fullname" . }}-dcaelocations + name: {{ include "common.fullname" . }}-dbc-dcaelocations namespace: {{ include "common.namespace" . }} labels: app: {{ include "common.name" . }} @@ -51,42 +51,3 @@ metadata: heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/dcaeLocations/*.json").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.fullname" . }}-mrclusters - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/mr_clusters/*.json").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.fullname" . }}-topics - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/topics/*.json").AsConfig . | indent 2 }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.fullname" . }}-feeds - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -data: -{{ tpl (.Files.Glob "resources/feeds/*.json").AsConfig . | indent 2 }} diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/templates/deployment.yaml b/kubernetes/dmaap/components/dbc/templates/deployment.yaml similarity index 74% rename from kubernetes/dmaap/components/dmaap-bus-controller/templates/deployment.yaml rename to kubernetes/dmaap/components/dbc/templates/deployment.yaml index 4d009e9698..0ecdc1c0e8 100644 --- a/kubernetes/dmaap/components/dmaap-bus-controller/templates/deployment.yaml +++ b/kubernetes/dmaap/components/dbc/templates/deployment.yaml @@ -82,17 +82,6 @@ spec: - name: {{ include "common.name" . }}-config mountPath: /opt/app/config/conf/ -# NOTE: the basename of the subdirectory is important - it matches the DBCL API URI - - name: {{ include "common.name" . }}-dmaap - mountPath: /opt/app/config/dmaap/ - - name: {{ include "common.name" . }}-dcaelocations - mountPath: /opt/app/config/dcaeLocations/ - - name: {{ include "common.name" . }}-mrclusters - mountPath: /opt/app/config/mr_clusters/ - - name: {{ include "common.name" . }}-topics - mountPath: /opt/app/config/topics/ - - name: {{ include "common.name" . }}-feeds - mountPath: /opt/app/config/feeds/ resources: {{ include "common.resources" . | indent 12 }} {{- if .Values.nodeSelector }} @@ -110,20 +99,5 @@ spec: - name: {{ include "common.name" . }}-config configMap: name: {{ include "common.fullname" . }}-config - - name: {{ include "common.name" . }}-dmaap - configMap: - name: {{ include "common.fullname" . }}-dmaap - - name: {{ include "common.name" . }}-dcaelocations - configMap: - name: {{ include "common.fullname" . }}-dcaelocations - - name: {{ include "common.name" . }}-mrclusters - configMap: - name: {{ include "common.fullname" . }}-mrclusters - - name: {{ include "common.name" . }}-topics - configMap: - name: {{ include "common.fullname" . }}-topics - - name: {{ include "common.name" . }}-feeds - configMap: - name: {{ include "common.fullname" . }}-feeds imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dmaap/components/dbc/templates/post-install-job.yaml b/kubernetes/dmaap/components/dbc/templates/post-install-job.yaml new file mode 100644 index 0000000000..1272c53695 --- /dev/null +++ b/kubernetes/dmaap/components/dbc/templates/post-install-job.yaml @@ -0,0 +1,67 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "common.fullname" . }}-post-install + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + "helm.sh/hook": post-install + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{.Release.Name}}" + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + spec: + restartPolicy: Never + + containers: + - name: post-install-job + image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}" + env: + - name: DELAY + value: "0" + - name: REQUESTID + value: "{{.Chart.Name}}-post-install" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + +# NOTE: on the following several configMaps, careful to include / at end +# since there may be more than one file in each mountPath +# NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI + - name: {{ include "common.fullname" . }}-dbc-dmaap + mountPath: /opt/app/config/dmaap/ + - name: {{ include "common.fullname" . }}-dbc-dcaelocations + mountPath: /opt/app/config/dcaeLocations/ + resources: +{{ include "common.resources" . | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-dbc-dmaap + configMap: + name: {{ include "common.fullname" . }}-dbc-dmaap + - name: {{ include "common.fullname" . }}-dbc-dcaelocations + configMap: + name: {{ include "common.fullname" . }}-dbc-dcaelocations + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/templates/service.yaml b/kubernetes/dmaap/components/dbc/templates/service.yaml similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/templates/service.yaml rename to kubernetes/dmaap/components/dbc/templates/service.yaml diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/values.yaml b/kubernetes/dmaap/components/dbc/values.yaml similarity index 93% rename from kubernetes/dmaap/components/dmaap-bus-controller/values.yaml rename to kubernetes/dmaap/components/dbc/values.yaml index aab6c237f3..2d791df6c6 100644 --- a/kubernetes/dmaap/components/dmaap-bus-controller/values.yaml +++ b/kubernetes/dmaap/components/dbc/values.yaml @@ -30,13 +30,16 @@ pullPolicy: Always # application images repository: nexus3.onap.org:10001 - -image: onap/dmaap/buscontroller:1.0.23 +image: onap/dmaap/dmaap-bc:1.1.1 # application configuration dmaapMessageRouterService: message-router -aafURL: https://aaf-onap-test.osaaf.org:8095/proxy/ +# change the following value to point to Windriver instance maintained +# but AAF team. +# e.g. +#aafURL: https://aaf-onap-test.osaaf.org:8095/proxy/ +aafURL: https://aaf-service:8100/ topicMgrUser: dmaap-bc-topic-mgr@dmaap-bc-topic-mgr.onap.org topicMgrPwd: demo123456! adminUser: aaf_admin@people.osaaf.org diff --git a/kubernetes/dmaap/components/dmaap-dr-node/resources/config/log/filebeat/filebeat.yml b/kubernetes/dmaap/components/dmaap-dr-node/resources/config/log/filebeat/filebeat.yml new file mode 100644 index 0000000000..f1cf7394b6 --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-node/resources/config/log/filebeat/filebeat.yml @@ -0,0 +1,60 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 The Nordix Foundation. 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +filebeat.prospectors: +#it is mandatory, in our case it's log +- input_type: log + #This is the canolical path as mentioned in logback.xml, *.* means it will monitor all files in the directory. + paths: + - /var/log/onap/*/*/*/*.log + - /var/log/onap/*/*/*.log + - /var/log/onap/*/*.log + - /opt/app/datartr/logs/*.log + #Files older than this should be ignored.In our case it will be 48 hours i.e. 2 days. It is a helping flag for clean_inactive + ignore_older: 48h + # Remove the registry entry for a file that is more than the specified time. In our case it will be 96 hours, i.e. 4 days. It will help to keep registry records with in limit + clean_inactive: 96h + + +# Name of the registry file. If a relative path is used, it is considered relative to the +# data path. Else full qualified file name. +#filebeat.registry_file: ${path.data}/registry + + +output.logstash: + #List of logstash server ip addresses with port number. + #But, in our case, this will be the loadbalancer IP address. + #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] + #If enable will do load balancing among available Logstash, automatically. + loadbalance: true + + #The list of root certificates for server verifications. + #If certificate_authorities is empty or not set, the trusted + #certificate authorities of the host system are used. + #ssl.certificate_authorities: $ssl.certificate_authorities + + #The path to the certificate for SSL client authentication. If the certificate is not specified, + #client authentication is not available. + #ssl.certificate: $ssl.certificate + + #The client certificate key used for client authentication. + #ssl.key: $ssl.key + + #The passphrase used to decrypt an encrypted key stored in the configured key file + #ssl.key_passphrase: $ssl.key_passphrase \ No newline at end of file diff --git a/kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/central.yaml b/kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/central.yaml new file mode 100644 index 0000000000..7ef2dcdb8f --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/central.yaml @@ -0,0 +1,6 @@ +{ + "dcaeLocationName" : "san-francisco", + "fqdn" : "dmaap-dr-node.san-francisco", + "hostName" : "dmaap-dr-node.pod", + "version" : "1.0.1" +} diff --git a/kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/edge.yaml b/kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/edge.yaml new file mode 100644 index 0000000000..272cd75e52 --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-node/resources/dr_nodes/edge.yaml @@ -0,0 +1,6 @@ +{ + "dcaeLocationName" : "edge1", + "fqdn" : "dmaap-dr-node.edge1", + "hostName" : "dmaap-dr-node.pod.edge1", + "version" : "1.0.1" +} diff --git a/kubernetes/dmaap/components/dmaap-dr-node/templates/configmap.yaml b/kubernetes/dmaap/components/dmaap-dr-node/templates/configmap.yaml index 67392671f8..cae0d71672 100644 --- a/kubernetes/dmaap/components/dmaap-dr-node/templates/configmap.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-node/templates/configmap.yaml @@ -45,3 +45,24 @@ metadata: namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/logback.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dbc-drnodes + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/dr_nodes/*.json").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dmaap-filebeat-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }} diff --git a/kubernetes/dmaap/components/dmaap-dr-node/templates/post-install-job.yaml b/kubernetes/dmaap/components/dmaap-dr-node/templates/post-install-job.yaml new file mode 100644 index 0000000000..c6fa76ce72 --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-node/templates/post-install-job.yaml @@ -0,0 +1,62 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "common.fullname" . }}-post-install + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + "helm.sh/hook": post-install + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{.Release.Name}}" + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + spec: + restartPolicy: Never + containers: + - name: post-install-job + image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}" + env: + - name: DELAY + value: "60" + - name: REQUESTID + value: "{{.Chart.Name}}-post-install" + + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + +# NOTE: on the following several configMaps, careful to include / at end +# since there may be more than one file in each mountPath +# NOTE: the basename of the subdirectory is important - it matches the DBCL API URI + - name: {{ include "common.fullname" . }}-dbc-drnodes + mountPath: /opt/app/config/dr_nodes/ + resources: +{{ include "common.resources" . | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-dbc-drnodes + configMap: + name: {{ include "common.fullname" . }}-dbc-drnodes + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml b/kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml index 2c4b0de63b..3e0e69ecc2 100644 --- a/kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-node/templates/statefulset.yaml @@ -97,7 +97,7 @@ spec: {{ toYaml .Values.affinity | indent 10 }} {{- end }} # Filebeat sidecar container - - name: {{ include "common.name" . }}-filebeat-onap + - name: {{ include "common.fullname" . }}-filebeat-onap image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: @@ -126,7 +126,7 @@ spec: name: {{ include "common.fullname" . }}-log - name: {{ include "common.fullname" . }}-filebeat-conf configMap: - name: {{ .Release.Name }}-dmaap-filebeat-configmap + name: {{ include "common.fullname" . }}-dmaap-filebeat-configmap - name: {{ include "common.fullname" . }}-data-filebeat emptyDir: {} - name: {{ include "common.fullname" . }}-event-logs-pvc diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/resources/config/log/filebeat/filebeat.yml b/kubernetes/dmaap/components/dmaap-dr-prov/resources/config/log/filebeat/filebeat.yml new file mode 100644 index 0000000000..f1cf7394b6 --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-prov/resources/config/log/filebeat/filebeat.yml @@ -0,0 +1,60 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2019 The Nordix Foundation. 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +filebeat.prospectors: +#it is mandatory, in our case it's log +- input_type: log + #This is the canolical path as mentioned in logback.xml, *.* means it will monitor all files in the directory. + paths: + - /var/log/onap/*/*/*/*.log + - /var/log/onap/*/*/*.log + - /var/log/onap/*/*.log + - /opt/app/datartr/logs/*.log + #Files older than this should be ignored.In our case it will be 48 hours i.e. 2 days. It is a helping flag for clean_inactive + ignore_older: 48h + # Remove the registry entry for a file that is more than the specified time. In our case it will be 96 hours, i.e. 4 days. It will help to keep registry records with in limit + clean_inactive: 96h + + +# Name of the registry file. If a relative path is used, it is considered relative to the +# data path. Else full qualified file name. +#filebeat.registry_file: ${path.data}/registry + + +output.logstash: + #List of logstash server ip addresses with port number. + #But, in our case, this will be the loadbalancer IP address. + #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] + #If enable will do load balancing among available Logstash, automatically. + loadbalance: true + + #The list of root certificates for server verifications. + #If certificate_authorities is empty or not set, the trusted + #certificate authorities of the host system are used. + #ssl.certificate_authorities: $ssl.certificate_authorities + + #The path to the certificate for SSL client authentication. If the certificate is not specified, + #client authentication is not available. + #ssl.certificate: $ssl.certificate + + #The client certificate key used for client authentication. + #ssl.key: $ssl.key + + #The passphrase used to decrypt an encrypted key stored in the configured key file + #ssl.key_passphrase: $ssl.key_passphrase \ No newline at end of file diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/feeds/DefaultPM.json b/kubernetes/dmaap/components/dmaap-dr-prov/resources/feeds/DefaultPM.json similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/feeds/DefaultPM.json rename to kubernetes/dmaap/components/dmaap-dr-prov/resources/feeds/DefaultPM.json diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/feeds/README b/kubernetes/dmaap/components/dmaap-dr-prov/resources/feeds/README similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/feeds/README rename to kubernetes/dmaap/components/dmaap-dr-prov/resources/feeds/README diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/templates/configmap.yaml b/kubernetes/dmaap/components/dmaap-dr-prov/templates/configmap.yaml index f9884d7827..bd5886ba9c 100644 --- a/kubernetes/dmaap/components/dmaap-dr-prov/templates/configmap.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-prov/templates/configmap.yaml @@ -32,3 +32,50 @@ metadata: namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/logback.xml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dmaap-filebeat-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dbc-feeds + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/feeds/*.json").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dbc-drpubs + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/dr_pubs/*.json").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dbc-drsubs + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/dr_subs/*.json").AsConfig . | indent 2 }} diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml b/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml index d2c653eb6f..573e90c35a 100644 --- a/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml +++ b/kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml @@ -84,7 +84,7 @@ spec: {{ toYaml .Values.affinity | indent 10 }} {{- end }} # Filebeat sidecar container - - name: {{ include "common.name" . }}-filebeat-onap + - name: {{ include "common.fullname" . }}-filebeat-onap image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: @@ -107,7 +107,7 @@ spec: name: {{ include "common.fullname" . }}-log - name: {{ include "common.fullname" . }}-filebeat-conf configMap: - name: {{ .Release.Name }}-dmaap-filebeat-configmap + name: {{ include "common.fullname" . }}-dmaap-filebeat-configmap - name: {{ include "common.fullname" . }}-data-filebeat emptyDir: {} - name: {{ include "common.fullname" . }}-logs diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/templates/post-install-job.yaml b/kubernetes/dmaap/components/dmaap-dr-prov/templates/post-install-job.yaml new file mode 100644 index 0000000000..1f7214f3ec --- /dev/null +++ b/kubernetes/dmaap/components/dmaap-dr-prov/templates/post-install-job.yaml @@ -0,0 +1,75 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "common.fullname" . }}-post-install + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + "helm.sh/hook": post-install + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{.Release.Name}}" + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + spec: + restartPolicy: Never + containers: + - name: post-install-job + image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}" + env: + - name: DELAY + value: "30" + - name: REQUESTID + value: "{{.Chart.Name}}-post-install" + + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + +# NOTE: on the following several configMaps, careful to include / at end +# since there may be more than one file in each mountPath +# NOTE: the basename of the subdirectory is important - it matches the DBCL API URI + - name: {{ include "common.fullname" . }}-dbc-feeds + mountPath: /opt/app/config/feeds/ + - name: {{ include "common.fullname" . }}-dbc-drpubs + mountPath: /opt/app/config/dr_pubs/ + - name: {{ include "common.fullname" . }}-dbc-drsubs + mountPath: /opt/app/config/dr_subs/ + resources: +{{ include "common.resources" . | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime +# - name: {{ include "common.name" . }}-config +# configMap: +# name: {{ include "common.fullname" . }}-config + - name: {{ include "common.fullname" . }}-dbc-feeds + configMap: + name: {{ include "common.fullname" . }}-dbc-feeds + - name: {{ include "common.fullname" . }}-dbc-drpubs + configMap: + name: {{ include "common.fullname" . }}-dbc-drpubs + - name: {{ include "common.fullname" . }}-dbc-drsubs + configMap: + name: {{ include "common.fullname" . }}-dbc-drsubs + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dmaap/components/message-router/resources/topics/MMagent.json b/kubernetes/dmaap/components/message-router/resources/topics/MMagent.json new file mode 100644 index 0000000000..2612e0d64c --- /dev/null +++ b/kubernetes/dmaap/components/message-router/resources/topics/MMagent.json @@ -0,0 +1,19 @@ +{ + "topicName": "MirrorMakerProvisioning", + "topicDescription": "the topic used to provision the MM agent whitelist", + "replicationCase": "REPLICATION_NONE", + "owner": "dmaap", + "txenabled": false, + "partitionCount": "1", + "clients": [ + { + "dcaeLocationName": "san-francisco", + "clientIdentity": "dmaap-bc-mm-prov@dmaap-bc-mm-prov.onap.org", + "action": [ + "pub", + "view" + ] + + } + ] +} diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/topics/PNF_READY.json b/kubernetes/dmaap/components/message-router/resources/topics/PNF_READY.json similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/topics/PNF_READY.json rename to kubernetes/dmaap/components/message-router/resources/topics/PNF_READY.json diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/topics/PNF_REGISTRATION.json b/kubernetes/dmaap/components/message-router/resources/topics/PNF_REGISTRATION.json similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/topics/PNF_REGISTRATION.json rename to kubernetes/dmaap/components/message-router/resources/topics/PNF_REGISTRATION.json diff --git a/kubernetes/dmaap/components/dmaap-bus-controller/resources/topics/README b/kubernetes/dmaap/components/message-router/resources/topics/README similarity index 100% rename from kubernetes/dmaap/components/dmaap-bus-controller/resources/topics/README rename to kubernetes/dmaap/components/message-router/resources/topics/README diff --git a/kubernetes/dmaap/components/message-router/templates/configmap.yaml b/kubernetes/dmaap/components/message-router/templates/configmap.yaml index 1ed788893f..e2e0da51fd 100644 --- a/kubernetes/dmaap/components/message-router/templates/configmap.yaml +++ b/kubernetes/dmaap/components/message-router/templates/configmap.yaml @@ -38,3 +38,30 @@ metadata: heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/dmaap/cadi.properties").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dbc-mrclusters + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/mr_clusters/*.json").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dbc-topics + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ tpl (.Files.Glob "resources/topics/*.json").AsConfig . | indent 2 }} + diff --git a/kubernetes/dmaap/components/message-router/templates/post-install-job.yaml b/kubernetes/dmaap/components/message-router/templates/post-install-job.yaml new file mode 100644 index 0000000000..df840ce828 --- /dev/null +++ b/kubernetes/dmaap/components/message-router/templates/post-install-job.yaml @@ -0,0 +1,66 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "common.fullname" . }}-post-install + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + annotations: + # This is what defines this resource as a hook. Without this line, the + # job is considered part of the release. + "helm.sh/hook": post-install + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded +spec: + template: + metadata: + name: "{{.Release.Name}}" + labels: + app.kubernetes.io/managed-by: {{.Release.Service | quote }} + app.kubernetes.io/instance: {{.Release.Name | quote }} + helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" + spec: + restartPolicy: Never + containers: + - name: post-install-job + image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}" + env: + - name: DELAY + value: "60" + - name: REQUESTID + value: "{{.Chart.Name}}-post-install" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + +# NOTE: on the following several configMaps, careful to include / at end +# since there may be more than one file in each mountPath +# NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI + - name: {{ include "common.fullname" . }}-dbc-mrclusters + mountPath: /opt/app/config/mr_clusters/ + - name: {{ include "common.fullname" . }}-dbc-topics + mountPath: /opt/app/config/topics/ + resources: +{{ include "common.resources" . | indent 10 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: {{ include "common.fullname" . }}-dbc-mrclusters + configMap: + name: {{ include "common.fullname" . }}-dbc-mrclusters + - name: {{ include "common.fullname" . }}-dbc-topics + configMap: + name: {{ include "common.fullname" . }}-dbc-topics + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dmaap/requirements.yaml b/kubernetes/dmaap/requirements.yaml index b5b9902276..c330403612 100644 --- a/kubernetes/dmaap/requirements.yaml +++ b/kubernetes/dmaap/requirements.yaml @@ -21,9 +21,9 @@ dependencies: version: ~4.x-0 repository: 'file://components/message-router' condition: message-router.enabled - - name: dmaap-bus-controller + - name: dbc version: ~4.x-0 - repository: 'file://components/dmaap-bus-controller' + repository: 'file://components/dbc' condition: dmaap-bus-controller.enabled - name: dmaap-dr-node version: ~4.x-0 diff --git a/kubernetes/dmaap/templates/configmap.yaml b/kubernetes/dmaap/templates/configmap.yaml index 6d801024f4..bdd3b0a31e 100644 --- a/kubernetes/dmaap/templates/configmap.yaml +++ b/kubernetes/dmaap/templates/configmap.yaml @@ -23,4 +23,4 @@ metadata: name: {{ .Release.Name }}-dmaap-filebeat-configmap namespace: {{ include "common.namespace" . }} data: -{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }} \ No newline at end of file +{{ tpl (.Files.Glob "resources/config/log/filebeat/filebeat.yml").AsConfig . | indent 2 }} diff --git a/kubernetes/dmaap/values.yaml b/kubernetes/dmaap/values.yaml index af39ede9d3..a077d183d5 100644 --- a/kubernetes/dmaap/values.yaml +++ b/kubernetes/dmaap/values.yaml @@ -22,6 +22,7 @@ global: readinessImage: readiness-check:2.0.0 loggingRepository: docker.elastic.co loggingImage: beats/filebeat:5.5.0 + clientImage: onap/dmaap/dbc-client:1.0.3 # application configuration config: logstashServiceName: log-ls @@ -31,7 +32,9 @@ message-router: enabled: true dmaap-bus-controller: enabled: true +dbc: + enabled: true dmaap-dr-node: enabled: true dmaap-dr-prov: - enabled: true \ No newline at end of file + enabled: true -- 2.16.6