VESPA Mgr template (including move Kong paths to common template) 13/913/3
authorwrider <lji@research.att.com>
Sun, 8 Sep 2019 20:27:33 +0000 (16:27 -0400)
committerLusheng Ji <lji@research.att.com>
Tue, 10 Sep 2019 19:56:15 +0000 (19:56 +0000)
Change-Id: I99135cee3b9c741979ea8590ecbdabce77e383f1
Signed-off-by: wrider <lji@research.att.com>
12 files changed:
RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE
ric-aux/80-Auxiliary-Functions/helm/ves/templates/ingress-ves.yaml
ric-common/Common-Template/helm/ric-common/Chart.yaml
ric-common/Common-Template/helm/ric-common/templates/_configmapname.tpl
ric-common/Common-Template/helm/ric-common/templates/_kongpath.tpl [new file with mode: 0644]
ric-platform/50-RIC-Platform/helm/a1mediator/templates/ingress-a1mediator.yaml
ric-platform/50-RIC-Platform/helm/appmgr/templates/ingress-appmgr.yaml
ric-platform/50-RIC-Platform/helm/e2mgr/templates/ingress-e2mgr.yaml
ric-platform/50-RIC-Platform/helm/vespamgr/templates/deployment.yaml
ric-platform/50-RIC-Platform/helm/vespamgr/templates/secret.yaml [new file with mode: 0644]
ric-platform/50-RIC-Platform/helm/vespamgr/templates/vespa-config.yaml [new file with mode: 0644]
ric-platform/50-RIC-Platform/helm/vespamgr/values.yaml

index c8e9c04..0d9f1cc 100644 (file)
@@ -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:
index 4450bc6..4d56175 100644 (file)
@@ -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" . }}
index 597dd54..3612f04 100644 (file)
@@ -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
index c9fcebf..4b0a562 100644 (file)
   {{- 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 (file)
index 0000000..736ffaa
--- /dev/null
@@ -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 -}}
index 4d26d30..06e70b8 100644 (file)
@@ -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" . }}
index 8123930..5bc0e94 100644 (file)
@@ -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" . }}
index 23d1975..5176487 100644 (file)
@@ -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" . }}
index 9ea0639..8f053aa 100644 (file)
@@ -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 (file)
index 0000000..e321318
--- /dev/null
@@ -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 (file)
index 0000000..6149f15
--- /dev/null
@@ -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 }}
index 0b4024b..8485f46 100644 (file)
@@ -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"