From 3034e7cd569faea033c9a309b3318c7e51c1ba9e Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Mon, 2 Mar 2020 08:54:04 +0000 Subject: Switch from cloudify helm plugin to cloudify/tosca. 1. Blueprint implementation. 2. Modify startup sequence. Issue-ID: DCAEGEN2-2098 Signed-off-by: Kate Hsuan Change-Id: I9d3d56565b0e997d3150eeef0891cc79bb0519ae --- .../admin/nginx/dl-admin-nginx.conf | 2 +- .../dpo/blueprint/k8s-datalake-helm-input.yaml | 24 ---- .../dpo/helm-chart/dcae-datalake/Chart.yaml | 22 ++++ .../charts/dcae-datalake-admin-ui/Chart.yaml | 22 ++++ .../dcae-datalake-admin-ui/templates/NOTES.txt | 38 ++++++ .../dcae-datalake-admin-ui/templates/_helpers.tpl | 62 +++++++++ .../templates/deployment.yaml | 70 ++++++++++ .../dcae-datalake-admin-ui/templates/ingress.yaml | 53 ++++++++ .../dcae-datalake-admin-ui/templates/service.yaml | 34 +++++ .../charts/dcae-datalake-admin-ui/values.yaml | 67 ++++++++++ .../charts/dcae-datalake-feeder/Chart.yaml | 23 ++++ .../config/overrides/application.properties | 91 +++++++++++++ .../dcae-datalake-feeder/templates/NOTES.txt | 39 ++++++ .../dcae-datalake-feeder/templates/_helpers.tpl | 63 +++++++++ .../dcae-datalake-feeder/templates/configmap.yaml | 27 ++++ .../dcae-datalake-feeder/templates/deployment.yaml | 81 ++++++++++++ .../dcae-datalake-feeder/templates/ingress.yaml | 53 ++++++++ .../dcae-datalake-feeder/templates/service.yaml | 35 +++++ .../templates/serviceCusterIP.yaml | 36 ++++++ .../charts/dcae-datalake-feeder/values.yaml | 77 +++++++++++ .../dpo/helm-chart/dcae-datalake/values.yaml | 31 +++++ .../dpo/helm_chart/dcae-datalake/Chart.yaml | 22 ---- .../charts/dcae-datalake-admin-ui/Chart.yaml | 22 ---- .../dcae-datalake-admin-ui/templates/NOTES.txt | 38 ------ .../dcae-datalake-admin-ui/templates/_helpers.tpl | 62 --------- .../templates/deployment.yaml | 70 ---------- .../dcae-datalake-admin-ui/templates/ingress.yaml | 53 -------- .../dcae-datalake-admin-ui/templates/service.yaml | 34 ----- .../charts/dcae-datalake-admin-ui/values.yaml | 67 ---------- .../charts/dcae-datalake-feeder/Chart.yaml | 23 ---- .../config/overrides/application.properties | 91 ------------- .../dcae-datalake-feeder/templates/NOTES.txt | 39 ------ .../dcae-datalake-feeder/templates/_helpers.tpl | 63 --------- .../dcae-datalake-feeder/templates/configmap.yaml | 27 ---- .../dcae-datalake-feeder/templates/deployment.yaml | 96 -------------- .../dcae-datalake-feeder/templates/ingress.yaml | 53 -------- .../charts/dcae-datalake-feeder/templates/job.yaml | 57 --------- .../dcae-datalake-feeder/templates/service.yaml | 35 ----- .../templates/serviceCusterIP.yaml | 36 ------ .../charts/dcae-datalake-feeder/values.yaml | 77 ----------- .../dpo/helm_chart/dcae-datalake/values.yaml | 31 ----- components/datalake-handler/feeder/Dockerfile | 12 ++ .../src/assembly/init_db/db_scripts/init_db.sql | 142 +++++++++++++++++++++ .../assembly/init_db/db_scripts/init_db_data.sql | 111 ++++++++++++++++ .../init_db/scripts/db_init/10_check-db-exist | 30 +++++ .../init_db/scripts/db_init/11_create-database | 25 ++++ .../assembly/init_db/scripts/db_init/15_db-adduser | 34 +++++ .../assembly/init_db/scripts/db_init/20_db-initdb | 25 ++++ .../feeder/src/assembly/init_db/scripts/run.sh | 28 ++++ .../datalake-handler/feeder/src/assembly/run.sh | 14 +- .../src/main/resources/application.properties | 4 +- components/datalake-handler/init_db/Dockerfile | 48 ------- .../init_db/db_scripts/init_db.sql | 142 --------------------- .../init_db/db_scripts/init_db_data.sql | 111 ---------------- components/datalake-handler/init_db/pom.xml | 45 ------- .../init_db/scripts/db_init/10_check-db-exist | 30 ----- .../init_db/scripts/db_init/11_create-database | 25 ---- .../init_db/scripts/db_init/15_db-adduser | 34 ----- .../init_db/scripts/db_init/20_db-initdb | 25 ---- components/datalake-handler/init_db/scripts/run.sh | 28 ---- 60 files changed, 1347 insertions(+), 1512 deletions(-) delete mode 100644 components/datalake-handler/dpo/blueprint/k8s-datalake-helm-input.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/Chart.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml create mode 100644 components/datalake-handler/dpo/helm-chart/dcae-datalake/values.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/Chart.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/job.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml delete mode 100644 components/datalake-handler/dpo/helm_chart/dcae-datalake/values.yaml create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db.sql create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db_data.sql create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/10_check-db-exist create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/11_create-database create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/15_db-adduser create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/20_db-initdb create mode 100644 components/datalake-handler/feeder/src/assembly/init_db/scripts/run.sh delete mode 100644 components/datalake-handler/init_db/Dockerfile delete mode 100644 components/datalake-handler/init_db/db_scripts/init_db.sql delete mode 100644 components/datalake-handler/init_db/db_scripts/init_db_data.sql delete mode 100644 components/datalake-handler/init_db/pom.xml delete mode 100644 components/datalake-handler/init_db/scripts/db_init/10_check-db-exist delete mode 100644 components/datalake-handler/init_db/scripts/db_init/11_create-database delete mode 100644 components/datalake-handler/init_db/scripts/db_init/15_db-adduser delete mode 100644 components/datalake-handler/init_db/scripts/db_init/20_db-initdb delete mode 100644 components/datalake-handler/init_db/scripts/run.sh (limited to 'components') diff --git a/components/datalake-handler/admin/nginx/dl-admin-nginx.conf b/components/datalake-handler/admin/nginx/dl-admin-nginx.conf index 56e0a51e..9551a1db 100644 --- a/components/datalake-handler/admin/nginx/dl-admin-nginx.conf +++ b/components/datalake-handler/admin/nginx/dl-admin-nginx.conf @@ -4,7 +4,7 @@ server { location ~/datalake/v1(.*)$ { resolver 127.0.0.1 valid=10s; - set $upstreamName http://dl_feeder:1680/datalake/v1$1; + set $upstreamName http://dl-feeder:1680/datalake/v1$1; proxy_pass $upstreamName; proxy_ssl_server_name on; diff --git a/components/datalake-handler/dpo/blueprint/k8s-datalake-helm-input.yaml b/components/datalake-handler/dpo/blueprint/k8s-datalake-helm-input.yaml deleted file mode 100644 index c343f9c7..00000000 --- a/components/datalake-handler/dpo/blueprint/k8s-datalake-helm-input.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -tiller-server-ip: 10.103.11.87 -tiller-server-port: 31867 -namespace: onap -chart-repo-url: http://10.103.11.87:8879/charts -stable-repo-url: http://127.0.0.1:8879 -chart-version: 1.0.0 -component-name: dcae-datalake diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/Chart.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/Chart.yaml new file mode 100644 index 00000000..bdb3cff8 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/Chart.yaml @@ -0,0 +1,22 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +apiVersion: v1 +appVersion: "1.0" +description: DCAE dalake- ONAP message bus data collection and dalake configuration UI. +name: dcae-datalake +version: 1.0.0 diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml new file mode 100644 index 00000000..a93facc7 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml @@ -0,0 +1,22 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +apiVersion: v1 +appVersion: "1.0" +description: Datalake Admin UI. +name: dcae-datalake-admin-ui +version: 1.0.0 diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt new file mode 100644 index 00000000..6f315f55 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt @@ -0,0 +1,38 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dcae-datalake-admin-ui.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "dcae-datalake-admin-ui.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dcae-datalake-admin-ui.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "dcae-datalake-admin-ui.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl new file mode 100644 index 00000000..e383ea4b --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl @@ -0,0 +1,62 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "dcae-datalake-admin-ui.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "dcae-datalake-admin-ui.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "dcae-datalake-admin-ui.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "dcae-datalake-admin-ui.labels" -}} +app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} +helm.sh/chart: {{ include "dcae-datalake-admin-ui.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml new file mode 100644 index 00000000..b57acbee --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml @@ -0,0 +1,70 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "dcae-datalake-admin-ui.fullname" . }} + labels: +{{ include "dcae-datalake-admin-ui.labels" . | indent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml new file mode 100644 index 00000000..d8167407 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml @@ -0,0 +1,53 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "dcae-datalake-admin-ui.fullname" . -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "dcae-datalake-admin-ui.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} + {{- end }} +{{- end }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml new file mode 100644 index 00000000..3934e419 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml @@ -0,0 +1,34 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +apiVersion: v1 +kind: Service +metadata: + name: dl-feeder-admin-ui + labels: +{{ include "dcae-datalake-admin-ui.labels" . | indent 4 }} +spec: + type: NodePort + ports: + - port: 80 + targetPort: http + nodePort: {{ .Values.global.nodePortPrefixExt }}{{ .Values.service.nodePort }} + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml new file mode 100644 index 00000000..cb6b7be8 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml @@ -0,0 +1,67 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +# Default values for dcae-datalake-admin-ui. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.datalakeadminui + tag: 1.0.0 + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +service: + type: nodePort + nodePort: 79 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml new file mode 100644 index 00000000..abc42752 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml @@ -0,0 +1,23 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +apiVersion: v1 +appVersion: "1.0" +description: Datalake- the message collector and analyzer. +name: dcae-datalake-feeder +version: 1.0.0 diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties new file mode 100644 index 00000000..6d3f3d21 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties @@ -0,0 +1,91 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +#####################App general +server.port = 1680 +server.servlet.context-path = /datalake/v1 + +#tolerate inconsistency when system crash, see PullThread.run() +async=true + +#SSL global flag, if enabled, still need to check each individual DB SSL flag +enableSSL=false + +#names for extra fields that DL adds to each record +timestampLabel=datalake_ts_ +rawDataLabel=datalake_text_ + +defaultTopicName=_DL_DEFAULT_ + +#####################Spring connection to MariaDB for ORM +#spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=none +spring.jpa.show-sql=false + +#spring.datasource.driver-class-name=com.mysql.jdbc.Driver +spring.datasource.url=jdbc:mariadb://dl-mariadb:3306/datalake?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 +spring.datasource.username=dl +spring.datasource.password=dl1234 + + +#####################DMaaP +dmaapZookeeperHostPort=message-router-zookeeper:2181 +dmaapKafkaHostPort=message-router-kafka:9092 +dmaapKafkaGroup=dlgroup44 +#dmaapKafkaLogin=admin +#dmaapKafkaPass=admin-secret +#dmaapKafkaSecurityProtocol=SASL_PLAINTEXT + +#in second +dmaapKafkaTimeout=10 +dmaapKafkaExclude[0]=__consumer_offsets +dmaapKafkaExclude[1]=__transaction_state +#dmaapKafkaExclude[2]=msgrtr.apinode.metrics.dmaap +#check for new topics , in millisecond +dmaapCheckNewTopicInterval=10000 + +kafkaConsumerCount=3 + +#####################Elasticsearch +elasticsearchType=doc + +#####################HDFS +hdfsBufferSize=4096 +#how often we flush stall updates, in millisecond +hdfsFlushInterval=30000 +hdfsBatchSize=500 + +#####################Logging +logging.level.org.springframework.web=ERROR +logging.level.com.att.nsa.apiClient.http=ERROR +logging.level.org.onap.datalake=DEBUG + +#####################Verison +datalakeVersion=0.0.1 + +#####################KibanaDashboardImportApi +kibanaDashboardImportApi=/api/kibana/dashboards/import?exclude=index-pattern + +#####################KibanaPort +kibanaPort=5601 + +#####################Elasticsearch Template API +esTemplateMappingApi=/_template/ + +#####################Elasticsearch port +esPort=9200 diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt new file mode 100644 index 00000000..4e97715e --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt @@ -0,0 +1,39 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dcae-datalake-feeder.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "dcae-datalake-feeder.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dcae-datalake-feeder.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "dcae-datalake-feeder.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl new file mode 100644 index 00000000..272853ea --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl @@ -0,0 +1,63 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "dcae-datalake-feeder.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "dcae-datalake-feeder.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "dcae-datalake-feeder.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "dcae-datalake-feeder.labels" -}} +app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} +helm.sh/chart: {{ include "dcae-datalake-feeder.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml new file mode 100644 index 00000000..f7aca237 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml @@ -0,0 +1,27 @@ +# Copyright (C) 2020 QCT 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========================================================= +# @author:kate.hsuan@qct.io +apiVersion: v1 + +kind: ConfigMap +metadata: + name: {{ include "dcae-datalake-feeder.fullname" . }}-configmap + namespace: {{ .Release.Namespace }} + labels: +{{ include "dcae-datalake-feeder.labels" . | indent 4 }} +data: +{{ tpl (.Files.Glob "resources/config/overrides/*").AsConfig . | indent 2 }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml new file mode 100644 index 00000000..a8762291 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml @@ -0,0 +1,81 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "dcae-datalake-feeder.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: +{{ include "dcae-datalake-feeder.labels" . | indent 4 }} +spec: + hostname: dcae-datalake-feeder-feeder + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: HOSTNAME + value: k8s-datalake + - name: CONSUL_HOST + value: consul + - name: CONFIG_BINDING_SERVICE + value: config-binding-service + ports: + - name: http + containerPort: 1680 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: config-volume + mountPath: /etc/datalake + volumes: + - name: config-volume + configMap: + name: {{ .Release.Name }}-dcae-datalake-feeder-configmap + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml new file mode 100644 index 00000000..af724c12 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml @@ -0,0 +1,53 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "dcae-datalake-feeder.fullname" . -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "dcae-datalake-feeder.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} + {{- end }} +{{- end }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml new file mode 100644 index 00000000..918f0bc8 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml @@ -0,0 +1,35 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +apiVersion: v1 +kind: Service +metadata: + name: dl-feeder-api + labels: +{{ include "dcae-datalake-feeder.labels" . | indent 4 }} +spec: + type: NodePort + ports: + - port: 1680 + targetPort: 1680 + nodePort: {{ .Values.global.nodePortPrefixExt }}{{ .Values.service.nodePort }} + protocol: TCP + name: datalake-api + selector: + app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml new file mode 100644 index 00000000..32043b43 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml @@ -0,0 +1,36 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +apiVersion: v1 +kind: Service +metadata: + name: dl-feeder + labels: +{{ include "dcae-datalake-feeder.labels" . | indent 4 }} +spec: + clusterIP: None + type: ClusterIP + ports: + - name: datalake-api-cluster + port: 1680 + protocol: TCP + targetPort: 1680 + selector: + app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml new file mode 100644 index 00000000..acec4640 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml @@ -0,0 +1,77 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +# Default values for dcae-datalake. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.datalakefeeder + tag: 1.0.0 + #pullPolicy: IfNotPresent + pullPolicy: Always + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +config: + mariadbGalera: + chartName: mariadb-galera + serviceName: mariadb-galera + internalPort: 3306 + presto: + serviceName: presto + +service: + type: NodePort + nodePort: "08" + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/components/datalake-handler/dpo/helm-chart/dcae-datalake/values.yaml b/components/datalake-handler/dpo/helm-chart/dcae-datalake/values.yaml new file mode 100644 index 00000000..b31a5d01 --- /dev/null +++ b/components/datalake-handler/dpo/helm-chart/dcae-datalake/values.yaml @@ -0,0 +1,31 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ +# + +################################################################# +# Global configuration defaults. +################################################################# + +global: + nodePortPrefix: 302 + nodePortPrefixExt: 304 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + repository: nexus3.onap.org:10001 + diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/Chart.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/Chart.yaml deleted file mode 100644 index bdb3cff8..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/Chart.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -apiVersion: v1 -appVersion: "1.0" -description: DCAE dalake- ONAP message bus data collection and dalake configuration UI. -name: dcae-datalake -version: 1.0.0 diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml deleted file mode 100644 index a93facc7..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/Chart.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -apiVersion: v1 -appVersion: "1.0" -description: Datalake Admin UI. -name: dcae-datalake-admin-ui -version: 1.0.0 diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt deleted file mode 100644 index 6f315f55..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/NOTES.txt +++ /dev/null @@ -1,38 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dcae-datalake-admin-ui.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "dcae-datalake-admin-ui.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dcae-datalake-admin-ui.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "dcae-datalake-admin-ui.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl deleted file mode 100644 index e383ea4b..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "dcae-datalake-admin-ui.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "dcae-datalake-admin-ui.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "dcae-datalake-admin-ui.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "dcae-datalake-admin-ui.labels" -}} -app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} -helm.sh/chart: {{ include "dcae-datalake-admin-ui.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml deleted file mode 100644 index b57acbee..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/deployment.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "dcae-datalake-admin-ui.fullname" . }} - labels: -{{ include "dcae-datalake-admin-ui.labels" . | indent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - template: - metadata: - labels: - app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml deleted file mode 100644 index d8167407..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/ingress.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "dcae-datalake-admin-ui.fullname" . -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: -{{ include "dcae-datalake-admin-ui.labels" . | indent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} - {{- end }} -{{- end }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml deleted file mode 100644 index 3934e419..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/templates/service.yaml +++ /dev/null @@ -1,34 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -apiVersion: v1 -kind: Service -metadata: - name: dl-feeder-admin-ui - labels: -{{ include "dcae-datalake-admin-ui.labels" . | indent 4 }} -spec: - type: NodePort - ports: - - port: 80 - targetPort: http - nodePort: {{ .Values.global.nodePortPrefixExt }}{{ .Values.service.nodePort }} - protocol: TCP - name: http - selector: - app.kubernetes.io/name: {{ include "dcae-datalake-admin-ui.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml deleted file mode 100644 index a47e7d0a..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-admin-ui/values.yaml +++ /dev/null @@ -1,67 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -# Default values for dcae-datalake-admin-ui. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nexus3.onap.org:10001/v2/onap/org.onap.dcaegen2.services.datalakeadminui - tag: 1.0.0 - pullPolicy: IfNotPresent - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -service: - type: nodePort - nodePort: 79 - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: [] - - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml deleted file mode 100644 index abc42752..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/Chart.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -apiVersion: v1 -appVersion: "1.0" -description: Datalake- the message collector and analyzer. -name: dcae-datalake-feeder -version: 1.0.0 diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties deleted file mode 100644 index 6d3f3d21..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/resources/config/overrides/application.properties +++ /dev/null @@ -1,91 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -#####################App general -server.port = 1680 -server.servlet.context-path = /datalake/v1 - -#tolerate inconsistency when system crash, see PullThread.run() -async=true - -#SSL global flag, if enabled, still need to check each individual DB SSL flag -enableSSL=false - -#names for extra fields that DL adds to each record -timestampLabel=datalake_ts_ -rawDataLabel=datalake_text_ - -defaultTopicName=_DL_DEFAULT_ - -#####################Spring connection to MariaDB for ORM -#spring.jpa.hibernate.ddl-auto=update -spring.jpa.hibernate.ddl-auto=none -spring.jpa.show-sql=false - -#spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.datasource.url=jdbc:mariadb://dl-mariadb:3306/datalake?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 -spring.datasource.username=dl -spring.datasource.password=dl1234 - - -#####################DMaaP -dmaapZookeeperHostPort=message-router-zookeeper:2181 -dmaapKafkaHostPort=message-router-kafka:9092 -dmaapKafkaGroup=dlgroup44 -#dmaapKafkaLogin=admin -#dmaapKafkaPass=admin-secret -#dmaapKafkaSecurityProtocol=SASL_PLAINTEXT - -#in second -dmaapKafkaTimeout=10 -dmaapKafkaExclude[0]=__consumer_offsets -dmaapKafkaExclude[1]=__transaction_state -#dmaapKafkaExclude[2]=msgrtr.apinode.metrics.dmaap -#check for new topics , in millisecond -dmaapCheckNewTopicInterval=10000 - -kafkaConsumerCount=3 - -#####################Elasticsearch -elasticsearchType=doc - -#####################HDFS -hdfsBufferSize=4096 -#how often we flush stall updates, in millisecond -hdfsFlushInterval=30000 -hdfsBatchSize=500 - -#####################Logging -logging.level.org.springframework.web=ERROR -logging.level.com.att.nsa.apiClient.http=ERROR -logging.level.org.onap.datalake=DEBUG - -#####################Verison -datalakeVersion=0.0.1 - -#####################KibanaDashboardImportApi -kibanaDashboardImportApi=/api/kibana/dashboards/import?exclude=index-pattern - -#####################KibanaPort -kibanaPort=5601 - -#####################Elasticsearch Template API -esTemplateMappingApi=/_template/ - -#####################Elasticsearch port -esPort=9200 diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt deleted file mode 100644 index 4e97715e..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/NOTES.txt +++ /dev/null @@ -1,39 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dcae-datalake-feeder.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "dcae-datalake-feeder.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dcae-datalake-feeder.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "dcae-datalake-feeder.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl port-forward $POD_NAME 8080:80 -{{- end }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl deleted file mode 100644 index 272853ea..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/_helpers.tpl +++ /dev/null @@ -1,63 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "dcae-datalake-feeder.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "dcae-datalake-feeder.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "dcae-datalake-feeder.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Common labels -*/}} -{{- define "dcae-datalake-feeder.labels" -}} -app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} -helm.sh/chart: {{ include "dcae-datalake-feeder.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml deleted file mode 100644 index f7aca237..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/configmap.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2020 QCT 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========================================================= -# @author:kate.hsuan@qct.io -apiVersion: v1 - -kind: ConfigMap -metadata: - name: {{ include "dcae-datalake-feeder.fullname" . }}-configmap - namespace: {{ .Release.Namespace }} - labels: -{{ include "dcae-datalake-feeder.labels" . | indent 4 }} -data: -{{ tpl (.Files.Glob "resources/config/overrides/*").AsConfig . | indent 2 }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml deleted file mode 100644 index 4c9dffcd..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/deployment.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "dcae-datalake-feeder.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: -{{ include "dcae-datalake-feeder.labels" . | indent 4 }} -spec: - hostname: dcae-datalake-feeder-feeder - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - template: - metadata: - labels: - app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - initContainers: - - command: - - /root/job_complete.py - args: - - -j - - {{ .Release.Name }}-dcae-datalake-feeder-dbinit-job - env: - - name: NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" - imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - name: datalake-readiness - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: HOSTNAME - value: k8s-datalake - - name: CONSUL_HOST - value: consul - - name: CONFIG_BINDING_SERVICE - value: config-binding-service - ports: - - name: http - containerPort: 1680 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - volumeMounts: - - name: config-volume - mountPath: /etc/datalake - volumes: - - name: config-volume - configMap: - name: {{ .Release.Name }}-dcae-datalake-feeder-configmap - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml deleted file mode 100644 index af724c12..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/ingress.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "dcae-datalake-feeder.fullname" . -}} -apiVersion: extensions/v1beta1 -kind: Ingress -metadata: - name: {{ $fullName }} - labels: -{{ include "dcae-datalake-feeder.labels" . | indent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} -{{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ . }} - backend: - serviceName: {{ $fullName }} - servicePort: http - {{- end }} - {{- end }} -{{- end }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/job.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/job.yaml deleted file mode 100644 index a990fb75..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/job.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "dcae-datalake-feeder.fullname" . }}-dbinit-job - labels: -{{ include "dcae-datalake-feeder.labels" . | indent 4 }} -spec: - template: - spec: - #initContainers: - #- name: datalake-readiness - #command: - #- /root/ready.py - #args: - #- --container-name - #- {{ .Values.config.mariadbGalera.chartName }} - #env: - #- name: NAMESPACE - # valueFrom: - # fieldRef: - # apiVersion: v1 - # fieldPath: metadata.namespace - #image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" - #imagePullPolicy: Always - - containers: - - name: datalake-db-init - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.datalake.dbinit:1.0.0 - env: - - name: MYSQL_HOST - value: "{{ .Values.config.mariadbGalera.serviceName }}" - - name: MYSQL_PORT - value: "3306" - - name: MYSQL_ROOT_PASSWORD - value: "secretpassword" - - name: PRESTO_HOST - value: "{{ .Values.config.presto.serviceName }}" - command: ["sh", "run.sh"] - restartPolicy: Never - backoffLimit: 4 diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml deleted file mode 100644 index 918f0bc8..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/service.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -apiVersion: v1 -kind: Service -metadata: - name: dl-feeder-api - labels: -{{ include "dcae-datalake-feeder.labels" . | indent 4 }} -spec: - type: NodePort - ports: - - port: 1680 - targetPort: 1680 - nodePort: {{ .Values.global.nodePortPrefixExt }}{{ .Values.service.nodePort }} - protocol: TCP - name: datalake-api - selector: - app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml deleted file mode 100644 index 32043b43..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/templates/serviceCusterIP.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -apiVersion: v1 -kind: Service -metadata: - name: dl-feeder - labels: -{{ include "dcae-datalake-feeder.labels" . | indent 4 }} -spec: - clusterIP: None - type: ClusterIP - ports: - - name: datalake-api-cluster - port: 1680 - protocol: TCP - targetPort: 1680 - selector: - app.kubernetes.io/name: {{ include "dcae-datalake-feeder.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml deleted file mode 100644 index acec4640..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/charts/dcae-datalake-feeder/values.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -# Default values for dcae-datalake. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.datalakefeeder - tag: 1.0.0 - #pullPolicy: IfNotPresent - pullPolicy: Always - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -config: - mariadbGalera: - chartName: mariadb-galera - serviceName: mariadb-galera - internalPort: 3306 - presto: - serviceName: presto - -service: - type: NodePort - nodePort: "08" - -ingress: - enabled: false - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: [] - - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/components/datalake-handler/dpo/helm_chart/dcae-datalake/values.yaml b/components/datalake-handler/dpo/helm_chart/dcae-datalake/values.yaml deleted file mode 100644 index b31a5d01..00000000 --- a/components/datalake-handler/dpo/helm_chart/dcae-datalake/values.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ -# - -################################################################# -# Global configuration defaults. -################################################################# - -global: - nodePortPrefix: 302 - nodePortPrefixExt: 304 - readinessRepository: oomk8s - readinessImage: readiness-check:2.0.0 - loggingRepository: docker.elastic.co - loggingImage: beats/filebeat:5.5.0 - repository: nexus3.onap.org:10001 - diff --git a/components/datalake-handler/feeder/Dockerfile b/components/datalake-handler/feeder/Dockerfile index 20444f97..e2606352 100644 --- a/components/datalake-handler/feeder/Dockerfile +++ b/components/datalake-handler/feeder/Dockerfile @@ -15,5 +15,17 @@ WORKDIR /home/datalake COPY target/${JAR_FILE} /home/datalake/ COPY src/assembly/run.sh /home/datalake/ +WORKDIR /home/datalake/db_init +ADD src/assembly/init_db/scripts/db_init . +USER root +RUN chmod 0755 ./* +WORKDIR /home/datalake +COPY src/assembly/init_db/db_scripts/init_db.sql . +COPY src/assembly/init_db/db_scripts/init_db_data.sql . + +RUN apt update && \ + apt install -y mariadb-client && \ + apt install -y curl + CMD ["sh", "run.sh"] diff --git a/components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db.sql b/components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db.sql new file mode 100644 index 00000000..b363988d --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db.sql @@ -0,0 +1,142 @@ +/* +* ============LICENSE_START======================================================= +* ONAP : DATALAKE +* ================================================================================ +* Copyright 2019-2020 China Mobile +*================================================================================= +* 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========================================================= +*/ + +create database if not exists datalake; +use datalake; + +CREATE TABLE `topic_name` ( + `id` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `db_type` ( + `id` varchar(255) NOT NULL, + `default_port` int(11) DEFAULT NULL, + `name` varchar(255) NOT NULL, + `tool` bit(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `db` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `database_name` varchar(255) DEFAULT NULL, + `enabled` bit(1) NOT NULL, + `encrypt` bit(1) DEFAULT NULL, + `host` varchar(255) DEFAULT NULL, + `login` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `pass` varchar(255) DEFAULT NULL, + `port` int(11) DEFAULT NULL, + `property1` varchar(255) DEFAULT NULL, + `property2` varchar(255) DEFAULT NULL, + `property3` varchar(255) DEFAULT NULL, + `db_type_id` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `FK3njadtw43ieph7ftt4kxdhcko` (`db_type_id`), + CONSTRAINT `FK3njadtw43ieph7ftt4kxdhcko` FOREIGN KEY (`db_type_id`) REFERENCES `db_type` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `design_type` ( + `id` varchar(255) NOT NULL, + `name` varchar(255) DEFAULT NULL, + `note` varchar(255) DEFAULT NULL, + `db_type_id` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `FKm8rkv2qkq01gsmeq1c3y4w02x` (`db_type_id`), + CONSTRAINT `FKm8rkv2qkq01gsmeq1c3y4w02x` FOREIGN KEY (`db_type_id`) REFERENCES `db_type` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `design` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `body` text DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `note` varchar(255) DEFAULT NULL, + `submitted` bit(1) DEFAULT NULL, + `design_type_id` varchar(255) NOT NULL, + `topic_name_id` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `FKo43yi6aputq6kwqqu8eqbspm5` (`design_type_id`), + KEY `FKabb8e74230glxpaiai4aqsr34` (`topic_name_id`), + CONSTRAINT `FKabb8e74230glxpaiai4aqsr34` FOREIGN KEY (`topic_name_id`) REFERENCES `topic_name` (`id`), + CONSTRAINT `FKo43yi6aputq6kwqqu8eqbspm5` FOREIGN KEY (`design_type_id`) REFERENCES `design_type` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `kafka` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `broker_list` varchar(255) NOT NULL, + `consumer_count` int(11) DEFAULT 3, + `enabled` bit(1) NOT NULL, + `excluded_topic` varchar(1023) DEFAULT '__consumer_offsets,__transaction_state', + `group` varchar(255) DEFAULT 'datalake', + `included_topic` varchar(255) DEFAULT NULL, + `login` varchar(255) DEFAULT NULL, + `name` varchar(255) NOT NULL, + `pass` varchar(255) DEFAULT NULL, + `secure` bit(1) DEFAULT b'0', + `security_protocol` varchar(255) DEFAULT NULL, + `timeout_sec` int(11) DEFAULT 10, + `zk` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `topic` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `aggregate_array_path` varchar(255) DEFAULT NULL, + `correlate_cleared_message` bit(1) NOT NULL DEFAULT b'0', + `data_format` varchar(255) DEFAULT NULL, + `enabled` bit(1) NOT NULL, + `flatten_array_path` varchar(255) DEFAULT NULL, + `login` varchar(255) DEFAULT NULL, + `message_id_path` varchar(255) DEFAULT NULL, + `pass` varchar(255) DEFAULT NULL, + `save_raw` bit(1) NOT NULL DEFAULT b'0', + `ttl_day` int(11) DEFAULT NULL, + `topic_name_id` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + KEY `FKj3pldlfaokdhqjfva8n3pkjca` (`topic_name_id`), + CONSTRAINT `FKj3pldlfaokdhqjfva8n3pkjca` FOREIGN KEY (`topic_name_id`) REFERENCES `topic_name` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `map_db_design` ( + `design_id` int(11) NOT NULL, + `db_id` int(11) NOT NULL, + PRIMARY KEY (`design_id`,`db_id`), + KEY `FKhpn49r94k05mancjtn301m2p0` (`db_id`), + CONSTRAINT `FKfli240v96cfjbnmjqc0fvvd57` FOREIGN KEY (`design_id`) REFERENCES `design` (`id`), + CONSTRAINT `FKhpn49r94k05mancjtn301m2p0` FOREIGN KEY (`db_id`) REFERENCES `db` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `map_db_topic` ( + `topic_id` int(11) NOT NULL, + `db_id` int(11) NOT NULL, + PRIMARY KEY (`db_id`,`topic_id`), + KEY `FKq1jon185jnrr7dv1dd8214uw0` (`topic_id`), + CONSTRAINT `FKirro29ojp7jmtqx9m1qxwixcc` FOREIGN KEY (`db_id`) REFERENCES `db` (`id`), + CONSTRAINT `FKq1jon185jnrr7dv1dd8214uw0` FOREIGN KEY (`topic_id`) REFERENCES `topic` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `map_kafka_topic` ( + `kafka_id` int(11) NOT NULL, + `topic_id` int(11) NOT NULL, + PRIMARY KEY (`topic_id`,`kafka_id`), + KEY `FKtdrme4h7rxfh04u2i2wqu23g5` (`kafka_id`), + CONSTRAINT `FK5q7jdxy54au5rcrhwa4a5igqi` FOREIGN KEY (`topic_id`) REFERENCES `topic` (`id`), + CONSTRAINT `FKtdrme4h7rxfh04u2i2wqu23g5` FOREIGN KEY (`kafka_id`) REFERENCES `kafka` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db_data.sql b/components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db_data.sql new file mode 100644 index 00000000..bc377348 --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/db_scripts/init_db_data.sql @@ -0,0 +1,111 @@ +/* +* ============LICENSE_START======================================================= +* ONAP : DATALAKE +* ================================================================================ +* Copyright 2019 China Mobile +*================================================================================= +* 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========================================================= +*/ + +use datalake; + +INSERT INTO kafka( + `id` + ,`name` + ,`consumer_count` + ,`enabled` + ,`group` + ,`broker_list` + ,`included_topic` + ,`login` + ,`pass` + ,`secure` + ,`security_protocol` + ,`timeout_sec` + ,`zk` +) VALUES ( + 1 + ,'main Kafka cluster' -- name - IN varchar(255) + ,3 -- consumer_count - IN int(11) + ,1 -- enabled - IN bit(1) + ,'dlgroup' -- group - IN varchar(255) + ,'message-router-kafka:9092' -- host_port - IN varchar(255) + ,'' -- included_topic - IN varchar(255) + ,'admin' -- login - IN varchar(255) + ,'admin_secret' -- pass - IN varchar(255) + ,0 -- secure - IN bit(1) + ,'SASL_PLAINTEXT' -- security_protocol - IN varchar(255) + ,10 -- timeout_sec - IN int(11) + ,'message-router-zookeeper:2181' -- zk - IN varchar(255) +); + +use datalake; + +insert into db_type (`id`, `name`, tool) values ('CB', 'Couchbase', false); +insert into db_type (`id`, `name`, tool) values ('ES', 'Elasticsearch', false); +insert into db_type (`id`, `name`, tool,`default_port`) values ('MONGO', 'MongoDB', false, 27017); +insert into db_type (`id`, `name`, tool) values ('DRUID', 'Druid', false); +insert into db_type (`id`, `name`, tool) values ('HDFS', 'HDFS', false); +insert into db_type (`id`, `name`, tool) values ('KIBANA', 'Kibana', true); +insert into db_type (`id`, `name`, tool) values ('SUPERSET', 'Apache Superset', true); + +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`,`login`,`pass`,`database_name`) values (1, 'CB', true, true, 'Couchbase 1','dl-couchbase','dl','dl1234','datalake'); +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (2, 'ES', true, true, 'Elasticsearch','dl-es'); +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`,`port`,`database_name`) values (3, 'MONGO', true, true, 'MongoDB 1','dl-mongodb',27017,'datalake'); +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (4, 'DRUID', true, true, 'Druid','dl-druid'); +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`,`login`) values (5, 'HDFS', true, true, 'Hadoop Cluster','dl-hdfs','dl'); +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (6, 'KIBANA', true, false, 'Kibana demo','dl-es'); +insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (7, 'SUPERSET', true, false, 'Superset demo','dl-druid'); + +insert into topic_name (`id`) values ('_DL_DEFAULT_'); +insert into topic_name (`id`) values ('unauthenticated.SEC_FAULT_OUTPUT'); +insert into topic_name (`id`) values ('unauthenticated.VES_MEASUREMENT_OUTPUT'); +insert into topic_name (`id`) values ('EPC'); +insert into topic_name (`id`) values ('HW'); + +-- in production, default enabled should be off +insert into `topic`(`id`, `topic_name_id`,`enabled`,`save_raw`,`ttl_day`,`data_format`) values (1, '_DL_DEFAULT_',1,0,3650,'JSON'); + +insert into `topic`(`id`, `topic_name_id`,`correlate_cleared_message`,`enabled`, `message_id_path`,`data_format`) +values (2, 'unauthenticated.SEC_FAULT_OUTPUT',1,1,'/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName,/event/faultFields/specificProblem,/event/commonEventHeader/eventId','JSON'); + +insert into `topic`(id, `topic_name_id`,`enabled`, `aggregate_array_path`,`flatten_array_path`,`data_format`) +values (3, 'unauthenticated.VES_MEASUREMENT_OUTPUT',1, +'/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray', +'/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface', +'JSON'); + +insert into `topic`(`id`, `topic_name_id`,`enabled`, `flatten_array_path`,`data_format`) +values (4, 'EPC',1, '/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface', 'JSON'); + +insert into `topic`(`id`, `topic_name_id`,`enabled`, `aggregate_array_path`,`data_format`) +values (5, 'HW',1, +'/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray', +'JSON'); + + +insert into `map_db_topic`(`db_id`,`topic_id`) select db.id, topic.id from db_type, db, topic where db.db_type_id=db_type.id and db_type.tool=0; +insert into `map_kafka_topic`(`kafka_id`,`topic_id`) select kafka.id, topic.id from kafka, topic; + + +insert into design_type (`id`, `name`, `db_type_id`) values ('KIBANA_DB', 'Kibana Dashboard', 'KIBANA'); +insert into design_type (`id`, `name`, `db_type_id`) values ('KIBANA_SEARCH', 'Kibana Search', 'KIBANA'); +insert into design_type (`id`, `name`, `db_type_id`) values ('KIBANA_VISUAL', 'Kibana Visualization', 'KIBANA'); +insert into design_type (`id`, `name`, `db_type_id`) values ('ES_MAPPING', 'Elasticsearch Field Mapping Template', 'ES'); +insert into design_type (`id`, `name`, `db_type_id`) values ('DRUID_KAFKA_SPEC', 'Druid Kafka Indexing Service Supervisor Spec', 'DRUID'); + + +insert into design (`id`, `name`,`topic_name_id`, `submitted`,`body`, `design_type_id`) values (1, 'Kibana Dashboard on EPC test1', 'EPC', 0, 'body here', 'KIBANA_DB'); + +insert into map_db_design (`design_id`,`db_id` ) values (1, 6); diff --git a/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/10_check-db-exist b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/10_check-db-exist new file mode 100644 index 00000000..cdf8af50 --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/10_check-db-exist @@ -0,0 +1,30 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# =================================================================== +# Copyright © 2020 QCT 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. +# 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============================================ +# +result=`mysql -qfsB -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT -e "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='datalake'" 2>&1` + +if [[ ! -z $result ]]; +then + echo "DATABASE ALREADY EXISTS" + touch /tmp/db_exist + exit 1 +else + echo "DATABASE DOES NOT EXIST" + exit 0 +fi \ No newline at end of file diff --git a/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/11_create-database b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/11_create-database new file mode 100644 index 00000000..a43b0cf2 --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/11_create-database @@ -0,0 +1,25 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# =================================================================== +# Copyright © 2020 QCT 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. +# 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============================================ +# + +if [ -f "/tmp/db_exist" ]; then + exit 0 +fi + +cat /home/datalake/init_db.sql | mysql -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT || exit 1 diff --git a/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/15_db-adduser b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/15_db-adduser new file mode 100644 index 00000000..c691751c --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/15_db-adduser @@ -0,0 +1,34 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# =================================================================== +# Copyright © 2020 QCT 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. +# 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============================================ +# + +if [ -f "/tmp/db_exist" ]; then + exit 0 +fi + +echo "Creating datalake user" 1>/tmp/mariadb-datalake-user.log 2>&1 + +mysql -uroot -p$MYSQL_ROOT_PASSWORD -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT << 'EOF' || exit 1 +CREATE USER IF NOT EXISTS 'dl'; +GRANT USAGE ON *.* TO 'dl'@'%' IDENTIFIED BY 'dl1234'; +GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, SHOW VIEW ON `datalake`.* TO 'dl'@'%'; +FLUSH PRIVILEGES; +EOF + +echo "Created so user . . ." 1>>/tmp/mariadb-datalake-user.log 2>&1 diff --git a/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/20_db-initdb b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/20_db-initdb new file mode 100644 index 00000000..ad8f6f89 --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/scripts/db_init/20_db-initdb @@ -0,0 +1,25 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# =================================================================== +# Copyright © 2020 QCT 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. +# 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============================================ +# + +if [ -f "/tmp/db_exist" ]; then + exit 0 +fi + +cat /home/datalake/init_db_data.sql | mysql -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT || exit 1 diff --git a/components/datalake-handler/feeder/src/assembly/init_db/scripts/run.sh b/components/datalake-handler/feeder/src/assembly/init_db/scripts/run.sh new file mode 100644 index 00000000..e1e59252 --- /dev/null +++ b/components/datalake-handler/feeder/src/assembly/init_db/scripts/run.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2020 QCT +# +# 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============================================ + + +echo "start init db ..." + +/bin/run-parts /app/db_init + +echo "finish init db" + + +curl -X PUT -H "contain-type:application/json" http://consul:8500/v1/kv/k8s-datalake -d "{\"mysql_host\": \"$MYSQL_HOST\", \"mysql_password\": \"$MYSQL_ROOT_PASSWORD\", \"mysql_port\": \"$MYSQL_PORT\", \"presto_host\": \"$PRESTO_HOST\"}" + diff --git a/components/datalake-handler/feeder/src/assembly/run.sh b/components/datalake-handler/feeder/src/assembly/run.sh index 377f208a..a061bfcf 100644 --- a/components/datalake-handler/feeder/src/assembly/run.sh +++ b/components/datalake-handler/feeder/src/assembly/run.sh @@ -1,3 +1,15 @@ #!/bin/sh -java -jar feeder-1.0.0-SNAPSHOT.jar \ No newline at end of file +echo "start init db ..." + +/bin/run-parts /home/datalake/db_init + +echo "finish init db" + +cmd=`ls feeder-*.jar` +if [ -z "$cmd" ]; then + echo "STRING is empty" + sleep 10000 +else + java -jar $cmd +fi diff --git a/components/datalake-handler/feeder/src/main/resources/application.properties b/components/datalake-handler/feeder/src/main/resources/application.properties index c7a040cf..bc24cdb2 100644 --- a/components/datalake-handler/feeder/src/main/resources/application.properties +++ b/components/datalake-handler/feeder/src/main/resources/application.properties @@ -20,7 +20,7 @@ spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=false #spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.datasource.url=jdbc:mariadb://dl-mariadb:3306/datalake?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 +spring.datasource.url=jdbc:mariadb://mariadb-galera:3306/datalake?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8 spring.datasource.username=dl spring.datasource.password=dl1234 @@ -70,4 +70,4 @@ kibanaPort=5601 esTemplateMappingApi=/_template/ #####################Elasticsearch port -esPort=9200 \ No newline at end of file +esPort=9200 diff --git a/components/datalake-handler/init_db/Dockerfile b/components/datalake-handler/init_db/Dockerfile deleted file mode 100644 index cf6aed2d..00000000 --- a/components/datalake-handler/init_db/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - -FROM ubuntu:16.04 AS builder -MAINTAINER Kate Hsuan - -LABEL org.label-schema.docker.build="docker build -t dl-db-init . --no-cache" \ - org.label-schema.docker.run="docker run dl-init" - -WORKDIR /app -WORKDIR /app/db_init -ADD scripts/db_init/ . -RUN chmod 0755 ./* -WORKDIR /app -COPY scripts/run.sh . -COPY db_scripts/init_db.sql . -COPY db_scripts/init_db_data.sql . - -RUN chmod 0755 /app/run.sh - -ARG mysqlpasswd="0000" -ENV MYSQL_ROOT_PASSWORD=$mysqlpasswd - -ARG mysqlhost="mariadb-galera" -ENV MYSQL_HOST=$mysqlhost - -ARG mysqlport="3306" -ENV MYSQL_PORT=${mysqlport} - -RUN apt update && \ - apt install -y mariadb-client-core-10.0 && \ - apt install -y curl - -CMD ["sh", "run.sh"] diff --git a/components/datalake-handler/init_db/db_scripts/init_db.sql b/components/datalake-handler/init_db/db_scripts/init_db.sql deleted file mode 100644 index b363988d..00000000 --- a/components/datalake-handler/init_db/db_scripts/init_db.sql +++ /dev/null @@ -1,142 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : DATALAKE -* ================================================================================ -* Copyright 2019-2020 China Mobile -*================================================================================= -* 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========================================================= -*/ - -create database if not exists datalake; -use datalake; - -CREATE TABLE `topic_name` ( - `id` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `db_type` ( - `id` varchar(255) NOT NULL, - `default_port` int(11) DEFAULT NULL, - `name` varchar(255) NOT NULL, - `tool` bit(1) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `db` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `database_name` varchar(255) DEFAULT NULL, - `enabled` bit(1) NOT NULL, - `encrypt` bit(1) DEFAULT NULL, - `host` varchar(255) DEFAULT NULL, - `login` varchar(255) DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `pass` varchar(255) DEFAULT NULL, - `port` int(11) DEFAULT NULL, - `property1` varchar(255) DEFAULT NULL, - `property2` varchar(255) DEFAULT NULL, - `property3` varchar(255) DEFAULT NULL, - `db_type_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `FK3njadtw43ieph7ftt4kxdhcko` (`db_type_id`), - CONSTRAINT `FK3njadtw43ieph7ftt4kxdhcko` FOREIGN KEY (`db_type_id`) REFERENCES `db_type` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `design_type` ( - `id` varchar(255) NOT NULL, - `name` varchar(255) DEFAULT NULL, - `note` varchar(255) DEFAULT NULL, - `db_type_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKm8rkv2qkq01gsmeq1c3y4w02x` (`db_type_id`), - CONSTRAINT `FKm8rkv2qkq01gsmeq1c3y4w02x` FOREIGN KEY (`db_type_id`) REFERENCES `db_type` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `design` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `body` text DEFAULT NULL, - `name` varchar(255) DEFAULT NULL, - `note` varchar(255) DEFAULT NULL, - `submitted` bit(1) DEFAULT NULL, - `design_type_id` varchar(255) NOT NULL, - `topic_name_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKo43yi6aputq6kwqqu8eqbspm5` (`design_type_id`), - KEY `FKabb8e74230glxpaiai4aqsr34` (`topic_name_id`), - CONSTRAINT `FKabb8e74230glxpaiai4aqsr34` FOREIGN KEY (`topic_name_id`) REFERENCES `topic_name` (`id`), - CONSTRAINT `FKo43yi6aputq6kwqqu8eqbspm5` FOREIGN KEY (`design_type_id`) REFERENCES `design_type` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `kafka` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `broker_list` varchar(255) NOT NULL, - `consumer_count` int(11) DEFAULT 3, - `enabled` bit(1) NOT NULL, - `excluded_topic` varchar(1023) DEFAULT '__consumer_offsets,__transaction_state', - `group` varchar(255) DEFAULT 'datalake', - `included_topic` varchar(255) DEFAULT NULL, - `login` varchar(255) DEFAULT NULL, - `name` varchar(255) NOT NULL, - `pass` varchar(255) DEFAULT NULL, - `secure` bit(1) DEFAULT b'0', - `security_protocol` varchar(255) DEFAULT NULL, - `timeout_sec` int(11) DEFAULT 10, - `zk` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `topic` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `aggregate_array_path` varchar(255) DEFAULT NULL, - `correlate_cleared_message` bit(1) NOT NULL DEFAULT b'0', - `data_format` varchar(255) DEFAULT NULL, - `enabled` bit(1) NOT NULL, - `flatten_array_path` varchar(255) DEFAULT NULL, - `login` varchar(255) DEFAULT NULL, - `message_id_path` varchar(255) DEFAULT NULL, - `pass` varchar(255) DEFAULT NULL, - `save_raw` bit(1) NOT NULL DEFAULT b'0', - `ttl_day` int(11) DEFAULT NULL, - `topic_name_id` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `FKj3pldlfaokdhqjfva8n3pkjca` (`topic_name_id`), - CONSTRAINT `FKj3pldlfaokdhqjfva8n3pkjca` FOREIGN KEY (`topic_name_id`) REFERENCES `topic_name` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `map_db_design` ( - `design_id` int(11) NOT NULL, - `db_id` int(11) NOT NULL, - PRIMARY KEY (`design_id`,`db_id`), - KEY `FKhpn49r94k05mancjtn301m2p0` (`db_id`), - CONSTRAINT `FKfli240v96cfjbnmjqc0fvvd57` FOREIGN KEY (`design_id`) REFERENCES `design` (`id`), - CONSTRAINT `FKhpn49r94k05mancjtn301m2p0` FOREIGN KEY (`db_id`) REFERENCES `db` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `map_db_topic` ( - `topic_id` int(11) NOT NULL, - `db_id` int(11) NOT NULL, - PRIMARY KEY (`db_id`,`topic_id`), - KEY `FKq1jon185jnrr7dv1dd8214uw0` (`topic_id`), - CONSTRAINT `FKirro29ojp7jmtqx9m1qxwixcc` FOREIGN KEY (`db_id`) REFERENCES `db` (`id`), - CONSTRAINT `FKq1jon185jnrr7dv1dd8214uw0` FOREIGN KEY (`topic_id`) REFERENCES `topic` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `map_kafka_topic` ( - `kafka_id` int(11) NOT NULL, - `topic_id` int(11) NOT NULL, - PRIMARY KEY (`topic_id`,`kafka_id`), - KEY `FKtdrme4h7rxfh04u2i2wqu23g5` (`kafka_id`), - CONSTRAINT `FK5q7jdxy54au5rcrhwa4a5igqi` FOREIGN KEY (`topic_id`) REFERENCES `topic` (`id`), - CONSTRAINT `FKtdrme4h7rxfh04u2i2wqu23g5` FOREIGN KEY (`kafka_id`) REFERENCES `kafka` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/components/datalake-handler/init_db/db_scripts/init_db_data.sql b/components/datalake-handler/init_db/db_scripts/init_db_data.sql deleted file mode 100644 index 7857d3ee..00000000 --- a/components/datalake-handler/init_db/db_scripts/init_db_data.sql +++ /dev/null @@ -1,111 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : DATALAKE -* ================================================================================ -* Copyright 2019 China Mobile -*================================================================================= -* 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========================================================= -*/ - -use datalake; - -INSERT INTO kafka( - `id` - ,`name` - ,`consumer_count` - ,`enabled` - ,`group` - ,`broker_list` - ,`included_topic` - ,`login` - ,`pass` - ,`secure` - ,`security_protocol` - ,`timeout_sec` - ,`zk` -) VALUES ( - 1 - ,'main Kafka cluster' -- name - IN varchar(255) - ,3 -- consumer_count - IN int(11) - ,1 -- enabled - IN bit(1) - ,'dlgroup' -- group - IN varchar(255) - ,'message-router-kafka:9092' -- host_port - IN varchar(255) - ,'' -- included_topic - IN varchar(255) - ,'admin' -- login - IN varchar(255) - ,'admin-secret' -- pass - IN varchar(255) - ,0 -- secure - IN bit(1) - ,'SASL_PLAINTEXT' -- security_protocol - IN varchar(255) - ,10 -- timeout_sec - IN int(11) - ,'message-router-zookeeper:2181' -- zk - IN varchar(255) -); - -use datalake; - -insert into db_type (`id`, `name`, tool) values ('CB', 'Couchbase', false); -insert into db_type (`id`, `name`, tool) values ('ES', 'Elasticsearch', false); -insert into db_type (`id`, `name`, tool,`default_port`) values ('MONGO', 'MongoDB', false, 27017); -insert into db_type (`id`, `name`, tool) values ('DRUID', 'Druid', false); -insert into db_type (`id`, `name`, tool) values ('HDFS', 'HDFS', false); -insert into db_type (`id`, `name`, tool) values ('KIBANA', 'Kibana', true); -insert into db_type (`id`, `name`, tool) values ('SUPERSET', 'Apache Superset', true); - -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`,`login`,`pass`,`database_name`) values (1, 'CB', true, true, 'Couchbase 1','dl-couchbase','dl','dl1234','datalake'); -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (2, 'ES', true, true, 'Elasticsearch','dl-es'); -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`,`port`,`database_name`) values (3, 'MONGO', true, true, 'MongoDB 1','dl-mongodb',27017,'datalake'); -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (4, 'DRUID', true, true, 'Druid','dl-druid'); -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`,`login`) values (5, 'HDFS', true, true, 'Hadoop Cluster','dl-hdfs','dl'); -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (6, 'KIBANA', true, false, 'Kibana demo','dl-es'); -insert into db (`id`, `db_type_id`, `enabled`, `encrypt`, `name`,`host`) values (7, 'SUPERSET', true, false, 'Superset demo','dl-druid'); - -insert into topic_name (`id`) values ('_DL_DEFAULT_'); -insert into topic_name (`id`) values ('unauthenticated.SEC_FAULT_OUTPUT'); -insert into topic_name (`id`) values ('unauthenticated.VES_MEASUREMENT_OUTPUT'); -insert into topic_name (`id`) values ('EPC'); -insert into topic_name (`id`) values ('HW'); - --- in production, default enabled should be off -insert into `topic`(`id`, `topic_name_id`,`enabled`,`save_raw`,`ttl_day`,`data_format`) values (1, '_DL_DEFAULT_',1,0,3650,'JSON'); - -insert into `topic`(`id`, `topic_name_id`,`correlate_cleared_message`,`enabled`, `message_id_path`,`data_format`) -values (2, 'unauthenticated.SEC_FAULT_OUTPUT',1,1,'/event/commonEventHeader/eventName,/event/commonEventHeader/reportingEntityName,/event/faultFields/specificProblem,/event/commonEventHeader/eventId','JSON'); - -insert into `topic`(id, `topic_name_id`,`enabled`, `aggregate_array_path`,`flatten_array_path`,`data_format`) -values (3, 'unauthenticated.VES_MEASUREMENT_OUTPUT',1, -'/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray', -'/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface', -'JSON'); - -insert into `topic`(`id`, `topic_name_id`,`enabled`, `flatten_array_path`,`data_format`) -values (4, 'EPC',1, '/event/measurementsForVfScalingFields/astriMeasurement/astriDPMeasurementArray/astriInterface', 'JSON'); - -insert into `topic`(`id`, `topic_name_id`,`enabled`, `aggregate_array_path`,`data_format`) -values (5, 'HW',1, -'/event/measurementsForVfScalingFields/memoryUsageArray,/event/measurementsForVfScalingFields/diskUsageArray,/event/measurementsForVfScalingFields/cpuUsageArray,/event/measurementsForVfScalingFields/vNicPerformanceArray', -'JSON'); - - -insert into `map_db_topic`(`db_id`,`topic_id`) select db.id, topic.id from db_type, db, topic where db.db_type_id=db_type.id and db_type.tool=0; -insert into `map_kafka_topic`(`kafka_id`,`topic_id`) select kafka.id, topic.id from kafka, topic; - - -insert into design_type (`id`, `name`, `db_type_id`) values ('KIBANA_DB', 'Kibana Dashboard', 'KIBANA'); -insert into design_type (`id`, `name`, `db_type_id`) values ('KIBANA_SEARCH', 'Kibana Search', 'KIBANA'); -insert into design_type (`id`, `name`, `db_type_id`) values ('KIBANA_VISUAL', 'Kibana Visualization', 'KIBANA'); -insert into design_type (`id`, `name`, `db_type_id`) values ('ES_MAPPING', 'Elasticsearch Field Mapping Template', 'ES'); -insert into design_type (`id`, `name`, `db_type_id`) values ('DRUID_KAFKA_SPEC', 'Druid Kafka Indexing Service Supervisor Spec', 'DRUID'); - - -insert into design (`id`, `name`,`topic_name_id`, `submitted`,`body`, `design_type_id`) values (1, 'Kibana Dashboard on EPC test1', 'EPC', 0, 'body here', 'KIBANA_DB'); - -insert into map_db_design (`design_id`,`db_id` ) values (1, 6); diff --git a/components/datalake-handler/init_db/pom.xml b/components/datalake-handler/init_db/pom.xml deleted file mode 100644 index 0c63933b..00000000 --- a/components/datalake-handler/init_db/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - 4.0.0 - - - org.onap.dcaegen2.services.components - datalake-handler - 1.0.0-SNAPSHOT - - - org.onap.dcaegen2.services.components.datalake-handler - init_db - pom - - 2.9.2 - 1.4.5 - onap/org.onap.dcaegen2.services.datalake.dbinit - - DataLake db init - - - - - com.spotify - dockerfile-maven-plugin - ${dockerfile-maven.version} - - ${onap.nexus.dockerregistry.daily}/${docker.image.path} - ${project.version} - Dockerfile - true - - - - javax.activation - javax.activation-api - 1.2.0 - - - - - - diff --git a/components/datalake-handler/init_db/scripts/db_init/10_check-db-exist b/components/datalake-handler/init_db/scripts/db_init/10_check-db-exist deleted file mode 100644 index cdf8af50..00000000 --- a/components/datalake-handler/init_db/scripts/db_init/10_check-db-exist +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START========================================== -# =================================================================== -# Copyright © 2020 QCT 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. -# 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============================================ -# -result=`mysql -qfsB -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT -e "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='datalake'" 2>&1` - -if [[ ! -z $result ]]; -then - echo "DATABASE ALREADY EXISTS" - touch /tmp/db_exist - exit 1 -else - echo "DATABASE DOES NOT EXIST" - exit 0 -fi \ No newline at end of file diff --git a/components/datalake-handler/init_db/scripts/db_init/11_create-database b/components/datalake-handler/init_db/scripts/db_init/11_create-database deleted file mode 100644 index 3e34828f..00000000 --- a/components/datalake-handler/init_db/scripts/db_init/11_create-database +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START========================================== -# =================================================================== -# Copyright © 2020 QCT 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. -# 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============================================ -# - -if [ -f "/tmp/db_exist" ]; then - exit 0 -fi - -cat /app/init_db.sql | mysql -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT || exit 1 diff --git a/components/datalake-handler/init_db/scripts/db_init/15_db-adduser b/components/datalake-handler/init_db/scripts/db_init/15_db-adduser deleted file mode 100644 index c691751c..00000000 --- a/components/datalake-handler/init_db/scripts/db_init/15_db-adduser +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START========================================== -# =================================================================== -# Copyright © 2020 QCT 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. -# 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============================================ -# - -if [ -f "/tmp/db_exist" ]; then - exit 0 -fi - -echo "Creating datalake user" 1>/tmp/mariadb-datalake-user.log 2>&1 - -mysql -uroot -p$MYSQL_ROOT_PASSWORD -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT << 'EOF' || exit 1 -CREATE USER IF NOT EXISTS 'dl'; -GRANT USAGE ON *.* TO 'dl'@'%' IDENTIFIED BY 'dl1234'; -GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, SHOW VIEW ON `datalake`.* TO 'dl'@'%'; -FLUSH PRIVILEGES; -EOF - -echo "Created so user . . ." 1>>/tmp/mariadb-datalake-user.log 2>&1 diff --git a/components/datalake-handler/init_db/scripts/db_init/20_db-initdb b/components/datalake-handler/init_db/scripts/db_init/20_db-initdb deleted file mode 100644 index 3b6d340f..00000000 --- a/components/datalake-handler/init_db/scripts/db_init/20_db-initdb +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START========================================== -# =================================================================== -# Copyright © 2020 QCT 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. -# 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============================================ -# - -if [ -f "/tmp/db_exist" ]; then - exit 0 -fi - -cat /app/init_db_data.sql | mysql -uroot -p$MYSQL_ROOT_PASSWORD -h $MYSQL_HOST -P $MYSQL_PORT || exit 1 diff --git a/components/datalake-handler/init_db/scripts/run.sh b/components/datalake-handler/init_db/scripts/run.sh deleted file mode 100644 index e1e59252..00000000 --- a/components/datalake-handler/init_db/scripts/run.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2020 QCT -# -# 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============================================ - - -echo "start init db ..." - -/bin/run-parts /app/db_init - -echo "finish init db" - - -curl -X PUT -H "contain-type:application/json" http://consul:8500/v1/kv/k8s-datalake -d "{\"mysql_host\": \"$MYSQL_HOST\", \"mysql_password\": \"$MYSQL_ROOT_PASSWORD\", \"mysql_port\": \"$MYSQL_PORT\", \"presto_host\": \"$PRESTO_HOST\"}" - -- cgit 1.2.3-korg