From 3faa1eecb410bc1b7134797ddccb807f9868476b Mon Sep 17 00:00:00 2001 From: wrider Date: Sun, 8 Sep 2019 16:27:33 -0400 Subject: [PATCH] VESPA Mgr template (including move Kong paths to common template) Change-Id: I99135cee3b9c741979ea8590ecbdabce77e383f1 Signed-off-by: wrider --- RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE | 2 ++ .../helm/ves/templates/ingress-ves.yaml | 2 +- .../Common-Template/helm/ric-common/Chart.yaml | 2 +- .../helm/ric-common/templates/_configmapname.tpl | 4 ++++ .../helm/ric-common/templates/_kongpath.tpl | 26 ++++++++++++++++++++++ .../a1mediator/templates/ingress-a1mediator.yaml | 2 +- .../helm/appmgr/templates/ingress-appmgr.yaml | 2 +- .../helm/e2mgr/templates/ingress-e2mgr.yaml | 2 +- .../helm/vespamgr/templates/deployment.yaml | 10 ++++----- .../helm/vespamgr/templates/secret.yaml | 9 ++++++++ .../helm/vespamgr/templates/vespa-config.yaml | 13 +++++++++++ .../50-RIC-Platform/helm/vespamgr/values.yaml | 2 ++ 12 files changed, 66 insertions(+), 10 deletions(-) create mode 100644 ric-common/Common-Template/helm/ric-common/templates/_kongpath.tpl create mode 100644 ric-platform/50-RIC-Platform/helm/vespamgr/templates/secret.yaml create mode 100644 ric-platform/50-RIC-Platform/helm/vespamgr/templates/vespa-config.yaml diff --git a/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE index c8e9c04a..0d9f1cc4 100644 --- a/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE +++ b/RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE @@ -163,6 +163,8 @@ vespamgr: image: name: ric-plt-vespamgr tag: 0.0.1 + prometheusurl: "http://rec-prometheus-server.default" + # the service for redirecting to AUX cluster extsvcplt: diff --git a/ric-aux/80-Auxiliary-Functions/helm/ves/templates/ingress-ves.yaml b/ric-aux/80-Auxiliary-Functions/helm/ves/templates/ingress-ves.yaml index 4450bc6b..4d56175b 100644 --- a/ric-aux/80-Auxiliary-Functions/helm/ves/templates/ingress-ves.yaml +++ b/ric-aux/80-Auxiliary-Functions/helm/ves/templates/ingress-ves.yaml @@ -6,7 +6,7 @@ spec: rules: - http: paths: - - path: /vescollector + - path: {{ include "common.kongpath.aux.vescollector" . }} backend: serviceName: {{ include "common.servicename.ves.http" . }} servicePort: {{ include "common.serviceport.ves.http" . }} diff --git a/ric-common/Common-Template/helm/ric-common/Chart.yaml b/ric-common/Common-Template/helm/ric-common/Chart.yaml index 597dd549..3612f046 100644 --- a/ric-common/Common-Template/helm/ric-common/Chart.yaml +++ b/ric-common/Common-Template/helm/ric-common/Chart.yaml @@ -18,4 +18,4 @@ apiVersion: v1 description: Common templates for inclusion in other charts name: ric-common -version: 2.0.4 +version: 2.0.5 diff --git a/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl b/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl index c9fcebf8..4b0a562c 100644 --- a/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl +++ b/ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl @@ -56,6 +56,10 @@ {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- define "common.configmapname.vespamgr" -}} + {{- $name := ( include "common.fullname.vespamgr" . ) -}} + {{- printf "configmap-%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} {{- define "common.configmapname.nexus" -}} {{- $name := ( include "common.fullname.nexus" . ) -}} diff --git a/ric-common/Common-Template/helm/ric-common/templates/_kongpath.tpl b/ric-common/Common-Template/helm/ric-common/templates/_kongpath.tpl new file mode 100644 index 00000000..736ffaa9 --- /dev/null +++ b/ric-common/Common-Template/helm/ric-common/templates/_kongpath.tpl @@ -0,0 +1,26 @@ +################################################################################ +# Copyright (c) 2019 AT&T Intellectual Property. # +# Copyright (c) 2019 Nokia. # +# # +# 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. # +################################################################################ + +{{/* + This file defines the URL paths that kong proxies for different servicess. +*/}} + +{{- define "common.kongpath.aux.vescollector" -}}/vescollector{{- end -}} +{{- define "common.kongpath.aux.helm" -}}/helm{{- end -}} +{{- define "common.kongpath.ric.appmgr" -}}/appmgr{{- end -}} +{{- define "common.kongpath.ric.a1mediator" -}}/a1mediator{{- end -}} +{{- define "common.kongpath.ric.e2mgr" -}}/e2mgr{{- end -}} diff --git a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/ingress-a1mediator.yaml b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/ingress-a1mediator.yaml index 4d26d304..06e70b88 100644 --- a/ric-platform/50-RIC-Platform/helm/a1mediator/templates/ingress-a1mediator.yaml +++ b/ric-platform/50-RIC-Platform/helm/a1mediator/templates/ingress-a1mediator.yaml @@ -6,7 +6,7 @@ spec: rules: - http: paths: - - path: /a1mediator + - path: {{ include "common.kongpath.ric.a1mediator" . }} backend: serviceName: {{ include "common.servicename.a1mediator.http" . }} servicePort: {{ include "common.serviceport.a1mediator.http" . }} diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml index 8123930e..5bc0e948 100644 --- a/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml +++ b/ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml @@ -6,7 +6,7 @@ spec: rules: - http: paths: - - path: /appmgr + - path: {{ include "common.kongpath.ric.appmgr" . }} backend: serviceName: {{ include "common.servicename.appmgr.http" . }} servicePort: {{ include "common.serviceport.appmgr.http" . }} diff --git a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml index 23d1975d..51764871 100644 --- a/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml +++ b/ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml @@ -6,7 +6,7 @@ spec: rules: - http: paths: - - path: /e2mgr + - path: {{ include "common.kongpath.ric.e2mgr" . }} backend: serviceName: {{ include "common.servicename.e2mgr.http" . }} servicePort: {{ include "common.serviceport.e2mgr.http" . }} diff --git a/ric-platform/50-RIC-Platform/helm/vespamgr/templates/deployment.yaml b/ric-platform/50-RIC-Platform/helm/vespamgr/templates/deployment.yaml index 9ea06392..8f053aa7 100644 --- a/ric-platform/50-RIC-Platform/helm/vespamgr/templates/deployment.yaml +++ b/ric-platform/50-RIC-Platform/helm/vespamgr/templates/deployment.yaml @@ -50,10 +50,10 @@ spec: - name: http containerPort: {{ include "common.serviceport.vespamgr.http" . }} protocol: TCP - #envFrom: - # - configMapRef: - # name: vespa-config - # - secretRef: - # name: vespa-secrets + envFrom: + - configMapRef: + name: {{ include "common.configmapname.vespamgr" . }} + - secretRef: + name: vespa-secrets diff --git a/ric-platform/50-RIC-Platform/helm/vespamgr/templates/secret.yaml b/ric-platform/50-RIC-Platform/helm/vespamgr/templates/secret.yaml new file mode 100644 index 00000000..e3213187 --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/vespamgr/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: vespa-secrets +type: Opaque +data: + VESMGR_PRICOLLECTOR_USER: "" + VESMGR_PRICOLLECTOR_PASSWORD: "" + diff --git a/ric-platform/50-RIC-Platform/helm/vespamgr/templates/vespa-config.yaml b/ric-platform/50-RIC-Platform/helm/vespamgr/templates/vespa-config.yaml new file mode 100644 index 00000000..6149f15e --- /dev/null +++ b/ric-platform/50-RIC-Platform/helm/vespamgr/templates/vespa-config.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.configmapname.vespamgr" . }} + namespace: {{ include "common.namespace.platform" . }} +data: + VESMGR_HB_INTERVAL: "60s" + VESMGR_MEAS_INTERVAL: "30s" + VESMGR_PRICOLLECTOR_ADDR: {{ include "common.ingressurl.aux" . | quote }} + VESMGR_PRICOLLECTOR_SERVERROOT: {{ include "common.kongpath.aux.vescollector" . | quote }} + VESMGR_PRICOLLECTOR_PORT: {{ include "common.ingresshttpsport" . | quote }} + VESMGR_PRICOLLECTOR_SECURE: "false" + VESMGR_PROMETHEUS_ADDR: {{ .Values.vespamgr.prometheusurl }} diff --git a/ric-platform/50-RIC-Platform/helm/vespamgr/values.yaml b/ric-platform/50-RIC-Platform/helm/vespamgr/values.yaml index 0b4024b5..8485f46a 100644 --- a/ric-platform/50-RIC-Platform/helm/vespamgr/values.yaml +++ b/ric-platform/50-RIC-Platform/helm/vespamgr/values.yaml @@ -35,3 +35,5 @@ vespamgr: # ric-common/Common-Template/helm/ric-common/templates/_ports.tpl file. # If need to change a service port, make the code change necessary, then # update the _ports.tpl file with the new port number. + + prometheusurl: "http://rec-prometheus-server.default" -- 2.16.6