diff options
author | Borislav Glozman <Borislav.Glozman@amdocs.com> | 2019-03-20 14:52:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-20 14:52:34 +0000 |
commit | fbb1fe94675ed76ae23e52a49d3eb2630b21f669 (patch) | |
tree | 1a36ff031143f3153cdb30bc2087d96557ab0d41 /kubernetes/dmaap/components/message-router | |
parent | f0b50f8ea7ce03a3a57f1c39ffca4c7b6f46286a (diff) | |
parent | 671f59b6b2e915ed7e5ac3a3b82b88a1395c7c70 (diff) |
Merge "Attempt2: Post-install jobs for DMaaP Provisioning"
Diffstat (limited to 'kubernetes/dmaap/components/message-router')
6 files changed, 149 insertions, 0 deletions
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/message-router/resources/topics/PNF_READY.json b/kubernetes/dmaap/components/message-router/resources/topics/PNF_READY.json new file mode 100644 index 0000000000..8f4cf8bd64 --- /dev/null +++ b/kubernetes/dmaap/components/message-router/resources/topics/PNF_READY.json @@ -0,0 +1,17 @@ +{ + "topicName": "PNF_READY", + "topicDescription": "This topic will be used to publish the PNF_READY events generated by the PNF REgistration Handler service in the DCAE platform.", + "owner": "PNFRegistrationHandler", + "txenabled": false, + "clients": [ + { + "dcaeLocationName": "san-francisco", + "clientRole": "org.onap.dmaap.mr.PNF_READY.pub", + "action": [ + "pub", + "view" + ] + + } + ] +} diff --git a/kubernetes/dmaap/components/message-router/resources/topics/PNF_REGISTRATION.json b/kubernetes/dmaap/components/message-router/resources/topics/PNF_REGISTRATION.json new file mode 100644 index 0000000000..f0dd2c7829 --- /dev/null +++ b/kubernetes/dmaap/components/message-router/resources/topics/PNF_REGISTRATION.json @@ -0,0 +1,17 @@ +{ + "topicName": "PNF_REGISTRATION", + "topicDescription": "the VES collector will be publishing pnfRegistration events in this topic", + "owner": "VEScollector", + "txenabled": false, + "clients": [ + { + "dcaeLocationName": "san-francisco", + "clientRole": "org.onap.dmaap.mr.PNF_REGISTRATION.sub", + "action": [ + "sub", + "view" + ] + + } + ] +} diff --git a/kubernetes/dmaap/components/message-router/resources/topics/README b/kubernetes/dmaap/components/message-router/resources/topics/README new file mode 100644 index 0000000000..fbb88b97e6 --- /dev/null +++ b/kubernetes/dmaap/components/message-router/resources/topics/README @@ -0,0 +1,3 @@ +# +# Intent of this directory is for it to contain a file for each topic that needs to be provisioned in MR. +# So, app teams can add files to this directory as needed without impacting each other's code. 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" |