New xApp standard template. This template defines the http and RMR services, and... 61/461/8
authorZhe Huang <zhehuang@research.att.com>
Wed, 3 Jul 2019 13:14:09 +0000 (09:14 -0400)
committerZhe Huang <zhehuang@research.att.com>
Wed, 3 Jul 2019 15:38:10 +0000 (11:38 -0400)
Signed-off-by: Zhe Huang <zhehuang@research.att.com>
Change-Id: I0050b0bdd5953e4622f7d4b7092c4207659697d9

12 files changed:
ric-xapps/90-xApps/bin/install [new file with mode: 0755]
ric-xapps/90-xApps/etc/xapp.conf [moved from ric-xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml with 87% similarity]
ric-xapps/90-xApps/helm/xapp-std/config/config-file.json [deleted file]
ric-xapps/90-xApps/helm/xapp-std/descriptors/schema.json [deleted file]
ric-xapps/90-xApps/helm/xapp-std/templates/_helpers.tpl
ric-xapps/90-xApps/helm/xapp-std/templates/appconfig.yaml
ric-xapps/90-xApps/helm/xapp-std/templates/appenv.yaml
ric-xapps/90-xApps/helm/xapp-std/templates/deployment.yaml
ric-xapps/90-xApps/helm/xapp-std/templates/service-rmr.yaml
ric-xapps/90-xApps/helm/xapp-std/values.yaml
ric-xapps/90-xApps/scripts/localize.sh [deleted file]
ric-xapps/90-xApps/scripts/ric_env.sh [deleted file]

diff --git a/ric-xapps/90-xApps/bin/install b/ric-xapps/90-xApps/bin/install
new file mode 100755 (executable)
index 0000000..08f4563
--- /dev/null
@@ -0,0 +1,170 @@
+#!/bin/bash
+################################################################################
+#   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.                                             #
+################################################################################
+
+
+while [ -n "$1" ]; do # while loop starts
+
+    case "$1" in
+
+    -n) 
+       CHART_NAME=$2
+       shift
+       ;; 
+
+    -v) CHART_VERSION=$2
+       shift
+               ;; # Message for -b option
+
+    -f) OVERRIDEYAML=$2
+       shift
+       ;; # Message for -c option
+    
+    -i) FULLIMAGE=$2
+       shift
+       ;;
+
+    -d) DESCRIPTOR_PATH=$2
+       shift
+       ;;
+
+    -c) CONFIG_JSON_PATH=$2
+       shift
+       ;;
+
+    -h) HELM_REPO_USERNAME=$2
+        shift
+        ;;
+    
+    -p) HELM_REPO_PASSWORD=$2
+        shift
+        ;;
+
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option other than a,b,c
+
+    esac
+
+    shift
+
+done
+
+
+
+
+if [ -z $CHART_NAME ]; then
+  echo "Please specify chart name using -n option."
+  exit 1
+fi
+if [ -z $CHART_VERSION ]; then
+  echo "Please specify chart version using -v option."
+  exit 1
+fi
+if [ -z $FULLIMAGE ]; then
+  echo "Please specify image using -i option."
+  exit 1
+fi
+if [ -z $DESCRIPTOR_PATH ]; then
+  echo "Please specify descriptor file using -d option."
+  exit 1
+fi
+if [ -z $CONFIG_JSON_PATH ]; then
+  echo "Please specify config json file using -c option."
+  exit 1
+fi
+
+
+if [ ! -f $DESCRIPTOR_PATH ]; then
+  echo "Descriptor file cannot be founded at $DESCRIPTOR_PATH"
+  exit 1
+fi
+if [ ! -f $CONFIG_JSON_PATH ]; then
+  echo "Config json file cannot be founded at $CONFIG_JSON_PATH"
+  exit 1
+fi
+
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+
+source $DIR/../etc/xapp.conf
+
+if [ -z $OVERRIDEYAML ]; then
+  HELM_REPO=$default_helm_repo
+  DOCKER_REGISTRY=$default_docker_registry
+else
+  helm_repo_override=$(grep "^ *helmRepository:" $OVERRIDEYAML |  awk '{gsub(/ /,""); gsub(/\"/,""); split($0, b, "tory:");split(b[2],c,"#"); print c[1]}')
+  docker_reg_override=$(grep "^ *repository:" $OVERRIDEYAML |  awk '{ gsub(/ /,""); gsub(/\"/,""); split($0, b, "tory:");split(b[2],c,"#"); print c[1]}')
+  if [ -z $helm_repo_override ]; then
+    HELM_REPO=$default_helm_repo
+  else
+    HELM_REPO=$helm_repo_override
+  fi
+
+  if [ -z $docker_reg_override ]; then
+    DOCKER_REGISTRY=$default_docker_registry
+  else
+    DOCKER_REGISTRY=$docker_reg_override
+  fi
+fi
+
+
+
+
+rm -rf /tmp/$CHART_NAME
+
+cp -r $DIR/../helm/xapp-std/ /tmp/$CHART_NAME
+
+
+
+sed -i "s/^name: xapp-std/name: $CHART_NAME/" /tmp/$CHART_NAME/Chart.yaml
+sed -i "s/^version: 0.0.1/version: $CHART_VERSION/" /tmp/$CHART_NAME/Chart.yaml
+
+
+registry_path=$(echo $FULLIMAGE | awk '{n=split($0, a, "/"); if(n>1) print a[1]}')
+
+
+
+tag=$(echo $FULLIMAGE | awk '{n=split($0, a, "/"); split(a[n], b, ":"); print b[2]}')
+
+image=$(echo $FULLIMAGE | awk -v head="$registry_path/" -v tail=":$tag" '{gsub (head, ""); gsub(tail,""); gsub(/\//,"\\/"); print $0}') 
+
+
+sed -i "s/^  name: xapp-std/  name: $CHART_NAME/" /tmp/$CHART_NAME/values.yaml
+sed -i "s/^    name: xapp-std/    name: $image/" /tmp/$CHART_NAME/values.yaml
+sed -i "s/^    tag: latest/    tag: $tag/" /tmp/$CHART_NAME/values.yaml
+
+
+if [ -z $registry_path ]; then
+  sed -i "s/^    repository: xapp-std-reg/    repository: $DOCKER_REGISTRY/" /tmp/$CHART_NAME/values.yaml
+else
+  sed -i "s/^    repository: xapp-std-reg/    repository: $registry_path/" /tmp/$CHART_NAME/values.yaml
+fi
+
+
+
+
+cp $CONFIG_JSON_PATH /tmp/$CHART_NAME/config/
+cp $DESCRIPTOR_PATH /tmp/$CHART_NAME/descriptors/
+
+
+helm package -d /tmp /tmp/$CHART_NAME
+
+
+echo $HELM_REPO
+curl -k -u $HELM_REPO_USERNAME:$HELM_REPO_PASSWORD $HELM_REPO --upload-file /tmp/$CHART_NAME-$CHART_VERSION.tgz -v
+
+
similarity index 87%
rename from ric-xapps/90-xApps/helm/xapp-std/templates/appsecret.yaml
rename to ric-xapps/90-xApps/etc/xapp.conf
index a0dce0e..956b367 100644 (file)
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
-apiVersion: v1
-kind: Secret
-metadata:
-  name: {{ .Release.Name }}-appsecret
-type: Opaque
-stringData:
-  {{- with .Values.ricapp.appsecret }}
-    {{- toYaml . | nindent 2 }}
-  {{- end }}
+
+default_helm_repo=https://helm-entry
+
+default_docker_registry=docker-entry
+
 
diff --git a/ric-xapps/90-xApps/helm/xapp-std/config/config-file.json b/ric-xapps/90-xApps/helm/xapp-std/config/config-file.json
deleted file mode 100755 (executable)
index 33c5f20..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-    "local": {
-        "host": ":8080"
-    },
-    "logger": {
-        "level": 3
-    },
-    "rmr": {
-       "protPort": "tcp:4560",
-       "maxSize": 2072,
-       "numWorkers": 1,
-       "txMessages": ["RIC_X2_LOAD_INFORMATION"],
-       "rxMessages": ["RIC_X2_LOAD_INFORMATION"]
-    },
-    "db": {
-        "namespace": "ricxapp",
-        "host": "dbaas",
-        "port": 6379
-    }
-}
diff --git a/ric-xapps/90-xApps/helm/xapp-std/descriptors/schema.json b/ric-xapps/90-xApps/helm/xapp-std/descriptors/schema.json
deleted file mode 100755 (executable)
index 5fd3b23..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-{
-  "definitions": {},
-  "$schema": "http://json-schema.org/draft-07/schema#",
-  "$id": "http://example.com/root.json",
-  "type": "object",
-  "title": "The Root Schema",
-  "required": [
-    "local",
-    "logger",
-    "rmr",
-    "db"
-  ],
-  "properties": {
-    "local": {
-      "$id": "#/properties/local",
-      "type": "object",
-      "title": "The Local Schema",
-      "required": [
-        "host"
-      ],
-      "properties": {
-        "host": {
-          "$id": "#/properties/local/properties/host",
-          "type": "string",
-          "title": "The Host Schema",
-          "default": "",
-          "examples": [
-            ":8080"
-          ],
-          "pattern": "^(.*)$"
-        }
-      }
-    },
-    "logger": {
-      "$id": "#/properties/logger",
-      "type": "object",
-      "title": "The Logger Schema",
-      "required": [
-        "level"
-      ],
-      "properties": {
-        "level": {
-          "$id": "#/properties/logger/properties/level",
-          "type": "integer",
-          "title": "The Level Schema",
-          "default": 0,
-          "examples": [
-            3
-          ]
-        }
-      }
-    },
-    "rmr": {
-      "$id": "#/properties/rmr",
-      "type": "object",
-      "title": "The Rmr Schema",
-      "required": [
-        "protPort",
-        "maxSize",
-        "numWorkers",
-        "txMessages",
-        "rxMessages"
-      ],
-      "properties": {
-        "protPort": {
-          "$id": "#/properties/rmr/properties/protPort",
-          "type": "string",
-          "title": "The Protport Schema",
-          "default": "",
-          "examples": [
-            "tcp:4560"
-          ],
-          "pattern": "^(.*)$"
-        },
-        "maxSize": {
-          "$id": "#/properties/rmr/properties/maxSize",
-          "type": "integer",
-          "title": "The Maxsize Schema",
-          "default": 0,
-          "examples": [
-            2072
-          ]
-        },
-        "numWorkers": {
-          "$id": "#/properties/rmr/properties/numWorkers",
-          "type": "integer",
-          "title": "The Numworkers Schema",
-          "default": 0,
-          "examples": [
-            1
-          ]
-        },
-        "txMessages": {
-          "$id": "#/properties/rmr/properties/txMessages",
-          "type": "array",
-          "title": "The Txmessages Schema"
-        },
-        "rxMessages": {
-          "$id": "#/properties/rmr/properties/rxMessages",
-          "type": "array",
-          "title": "The Rxmessages Schema"
-        }
-      }
-    },
-    "db": {
-      "$id": "#/properties/db",
-      "type": "object",
-      "title": "The Db Schema",
-      "required": [
-        "host",
-        "namespace",
-        "port"
-      ],
-      "properties": {
-        "host": {
-          "$id": "#/properties/db/properties/host",
-          "type": "string",
-          "title": "The Host Schema",
-          "default": "",
-          "examples": [
-            "dbaas"
-          ],
-          "pattern": "^(.*)$"
-        },
-        "namespace": {
-          "$id": "#/properties/db/properties/namespace",
-          "type": "string",
-          "title": "The Namespace Schema",
-          "default": "",
-          "examples": [
-            "ricxapp"
-          ],
-          "pattern": "^(.*)$"
-        },
-        "port": {
-          "$id": "#/properties/db/properties/port",
-          "type": "integer",
-          "title": "The Port Schema",
-          "default": 0,
-          "examples": [
-            6379
-          ]
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
index e2309bf..d427a46 100644 (file)
@@ -19,7 +19,7 @@
 Expand the name of the chart.
 */}}
 {{- define "ricxapp.name" -}}
-{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+  {{- default .Chart.Name .Values.ricxapp.name | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
 
 {{/*
@@ -28,23 +28,16 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
 If release name contains chart name it will be used as a full name.
 */}}
 {{- define "ricxapp.fullname" -}}
-{{- if .Values.ricxapp.fullnameOverride -}}
-{{- .Values.ricxapp.fullnameOverride | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- $name := default .Chart.Name .Values.ricxapp.nameOverride -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Namespace $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-{{- end -}}
+  {{- $name := ( include "ricxapp.name" . ) -}}
+  {{- $fullname := ( printf "%s-%s" .Release.Namespace $name ) -}}
+  {{- default $fullname .Values.ricxapp.fullname | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
 
 {{/*
 Create chart name and version as used by the chart label.
 */}}
 {{- define "ricxapp.chart" -}}
-{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+  {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
 
 {{- define "ricxapp.namespace" -}}
@@ -74,6 +67,11 @@ Create chart name and version as used by the chart label.
 {{- end -}}
 
 
+{{- define "ricxapp.containername" -}}
+  {{- $name := ( include "ricxapp.fullname" . ) -}}
+  {{- printf "container-%s" $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
 {{- define "ricxapp.imagepullsecret" -}}
   {{- printf "docker-reg-cred" -}}
 {{- end -}}
index fc6e622..e08ecc8 100644 (file)
@@ -1,14 +1,32 @@
-#
-# ==================================================================================
-#   Copyright (c) 2019 Nokia
-# ==================================================================================
-#
+################################################################################
+#   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.                                             #
+################################################################################'
 
-{{ if (eq .Values.ricapp.appconfig.override "") }}
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }}
+  name: {{ include "ricxapp.configmapname" . }}-appconfig
 data:
-{{ (.Files.Glob "config/*").AsConfig | indent 2 }}
-{{ end }}
+{{- $dbaasservice := .Values.ricplt.dbaasService | quote -}}
+{{- $pltingressurl := .Values.ricplt.pltIngressUrl | quote -}}
+{{- $xappingressurl := .Values.ricplt.xappIngressUrl | quote -}}
+{{- $appmgrrmrservice := .Values.ricplt.appmgrRMRService | quote -}}
+{{- $e2mgrrmrservice := .Values.ricplt.e2mgrRMRService | quote -}}
+{{- $e2termrmrservice := .Values.ricplt.e2termRMRService | quote -}}
+{{- $rtmgrrmrservice := .Values.ricplt.rtmgrRMRService | quote -}}
+{{- $a1mediatorrmrservice := .Values.ricplt.a1mediatorRMRService | quote -}}
+
+{{ (.Files.Glob "config/*").AsConfig | replace "__DBAAS_SERVICE__" $dbaasservice | replace "__PLT_INGRESS_URL__" $pltingressurl | replace "__XAPP_INGRESS_URL__" $xappingressurl | replace "__APPMGR_RMR_SERVICE__" $appmgrrmrservice | replace "__E2MGR_RMR_SERVICE__" $e2mgrrmrservice | replace "__E2TERM_RMR_SERVICE__" $e2termrmrservice | replace "__RTMGR_RMR_SERVICE__" $rtmgrrmrservice | replace "__A1MEDIATOR_RMR_SERVICE__" $a1mediatorrmrservice | indent 2 }}
index 8f16b03..0d55f4e 100644 (file)
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ .Release.Name }}-appenv
+  name: {{ include "ricxapp.configmapname" . }}-appenv
 data:
-  {{- with .Values.ricapp.appenv }}
-    {{- toYaml . | nindent 2 }}
+  {{- if .Values.ricxapp.appenv }}
+    {{- toYaml .Values.ricxapp.appenv | nindent 2 }}
   {{- end }}
+  DBAAS_SERVICE_HOST: "{{ .Values.ricplt.dbaasService }}"
+  DBAAS_SERVICE_PORT: "6379"
+  DBAAS_PORT_6379_TCP_ADDR: "{{ .Values.ricplt.dbaasService }}"
+  DBAAS_PORT_6379_TCP_PORT: "6379"
+  RMR_RTG_SVC: "{{ .Values.ricxapp.service.rmr.route.port }}"
index e6fa26d..28bd23b 100644 (file)
@@ -1,84 +1,77 @@
-#
-# ==================================================================================
-#   Copyright (c) 2019 Nokia
-# ==================================================================================
-#
-
+################################################################################
+#   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.                                             #
+################################################################################'
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: {{ include "ricapp.fullname" . }}
+  name: {{ include "ricxapp.fullname" . }}
   labels:
-    app.kubernetes.io/name: {{ include "ricapp.name" . }}
-    helm.sh/chart: {{ include "ricapp.chart" . }}
-    app.kubernetes.io/instance: {{ .Release.Name }}
-    app.kubernetes.io/managed-by: {{ .Release.Service }}
+    app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
+    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
 spec:
-  replicas: {{ .Values.ricapp.replicaCount }}
+  replicas: {{ .Values.ricxapp.replicaCount }}
   selector:
     matchLabels:
-      app.kubernetes.io/name: {{ include "ricapp.name" . }}
-      app.kubernetes.io/instance: {{ .Release.Name }}
+      app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
+      release: {{ .Release.Name }}
   template:
     metadata:
       labels:
-        app.kubernetes.io/name: {{ include "ricapp.name" . }}
-        app.kubernetes.io/instance: {{ .Release.Name }}
+        app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
+        release: {{ .Release.Name }}
     spec:
-      hostname: {{ .Values.ricapp.hostname }}
+      hostname: {{ include "ricxapp.name" . }}
       imagePullSecrets:
         - name: {{ include "ricxapp.imagepullsecret" . }}
       containers:
-        - name: {{ .Chart.Name }}
-          image: "{{ .Values.global.repository }}/{{ .Values.ricapp.image.name }}:{{ .Values.ricapp.image.tag }}"
-          imagePullPolicy: {{ .Values.global.image.pullPolicy }}
+        - name: {{ include "ricxapp.containername" . }}
+          image: "{{ .Values.ricxapp.image.repository }}/{{ .Values.ricxapp.image.name }}:{{ .Values.ricxapp.image.tag }}"
+          imagePullPolicy: {{ .Values.ricxapp.image.pullPolicy }}
           ports:
             - name: http
-              containerPort: {{ .Values.ricapp.service.http.containerPort }}
+              containerPort: {{ .Values.ricxapp.service.http.containerPort }}
               protocol: TCP
-            - name: rmr
-              containerPort: {{ .Values.ricapp.service.rmr.containerPort }}
+            - name: rmrRoute
+              containerPort: {{ .Values.ricxapp.service.rmr.route.port }}
+              protocol: TCP
+            - name: rmrData
+              containerPort: {{ .Values.ricxapp.service.rmr.data.port }}
               protocol: TCP
           volumeMounts:
             - name: config-volume
-              mountPath: {{ .Values.ricapp.appconfig.path }}
-            - name: cert-volume
-              mountPath: {{ .Values.ricapp.cert.path }}
+              mountPath: {{ .Values.ricxapp.appconfig.path }}
+          envFrom:
+            - configMapRef:
+                name: {{ include "ricxapp.configmapname" . }}-appenv
           livenessProbe:
             httpGet:
-              path: {{ .Values.ricapp.probes.healthAliveCheckEndpoint }}
-              port: 8080
+              path: {{ .Values.ricxapp.probes.healthAliveCheckEndpoint }}
+              port: {{ .Values.ricxapp.service.http.containerPort }}
             initialDelaySeconds: 5
             periodSeconds: 15
           readinessProbe:
             httpGet:
-              path: {{ .Values.ricapp.probes.healthReadyCheckEndpoint }}
-              port: 8080
+              path: {{ .Values.ricxapp.probes.healthReadyCheckEndpoint }}
+              port: {{ .Values.ricxapp.service.http.containerPort }}
             initialDelaySeconds: 5
             periodSeconds: 15
           restartPolicy: Always
-          resources:
-            {{- toYaml .Values.ricapp.resources | nindent 12 }}
-          securityContext:
-            # ubuntu
-            #runAsUser: 1000
-            #allowPrivilegeEscalation: false
-      {{- with .Values.ricapp.nodeSelector }}
-      nodeSelector:
-        {{- toYaml . | nindent 8 }}
-      {{- end }}
-    {{- with .Values.ricapp.affinity }}
-      affinity:
-        {{- toYaml . | nindent 8 }}
-    {{- end }}
-    {{- with .Values.ricapp.tolerations }}
-      tolerations:
-        {{- toYaml . | nindent 8 }}
-    {{- end }}
-
       volumes:
         - name: config-volume
           configMap:
-            name: {{ if .Values.ricapp.appconfig.override }}{{ .Values.ricapp.appconfig.override }}{{ else }}{{ .Release.Name }}-appconfig{{ end }}
-        - name: cert-volume
-          emptyDir: {}
+            name: {{ include "ricxapp.configmapname" . }}-appconfig
index 1d9ce92..ee1670b 100644 (file)
@@ -28,10 +28,14 @@ metadata:
 spec:
   type: ClusterIP
   ports:
-    - port: {{ .Values.ricxapp.service.rmr.port }}
-      targetPort: rmr
+    - port: {{ .Values.ricxapp.service.rmr.data.port }}
+      targetPort: rmrData
       protocol: TCP
-      name: rmr
+      name: rmrData
+    - port: {{ .Values.ricxapp.service.rmr.route.port }}
+      targetPort: rmrRoute
+      protocol: TCP
+      name: rmrRoute
   selector:
     app: {{ include "ricxapp.namespace" . }}-{{ include "ricxapp.name" . }}
     release: {{ .Release.Name }}
index 1eaa11a..bf9be32 100644 (file)
 ################################################################################'
 # This is a YAML-formatted file.
 # Declare variables to be passed into your templates.
-
-global:
-  # modify this section to point to your local testing settings
-  repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}"
-  repositoryCred:
-    user: "${__RUNRICENV_DOCKER_USER__}"
-    password: "${__RUNRICENV_DOCKER_PASS__}"
-  image:
-    pullPolicy: IfNotPresent
-
 ricplt:
   # This section is reserved for values imported from RIC Platform charts
+  dbaasService: "service-ricplt-dbaas-tcp.ricplt.svc.cluster.local"
+  pltIngressUrl: "ricplt-entry"
+  xappIngressUrl: "ricxapp-entry"
 
-ricapp:
+  appmgrRMRService: "service-ricplt-appmgr-rmr.ricplt.svc.cluster.local"
+  e2mgrRMRService: "service-ricplt-e2mgr-rmr.ricplt.svc.cluster.local"
+  e2termRMRService: "service-ricplt-e2term-rmr.ricplt.svc.cluster.local"
+  rtmgrRMRService: "service-ricplt-rtmgr-rmr.ricplt.svc.cluster.local"
+  a1mediatorRMRService: "service-ricplt-a1mediator-rmr.ricplt.svc.cluster.local"
+
+  
+
+ricxapp:
   # This section is for xapp. Templates to be resolved from xApp descriptor
   replicaCount: 1
   name: xapp-std
-  fullname: xapp-std
-  nameOverride: ""
-  fullnameOverride: ""
-
-  # The name of the process that indicates the liveness of the component
-  livenessprocessname: xapp-std
+  # Your can specify the chart fullname by using the following option
+  #fullname: xapp-std
 
   image:
+    pullPolicy: IfNotPresent
+    repository: xapp-std-reg
     name: xapp-std
     tag: latest
 
@@ -49,8 +48,10 @@ ricapp:
       port: 8080
       containerPort: 8080
     rmr:
-      port: 4560
-      containerPort: 4560
+      route:
+        port: 4561
+      data:
+        port: 4560
 
   probes:
     healthAliveCheckEndpoint: ric/v1/health/alive
@@ -58,19 +59,5 @@ ricapp:
 
   appconfig:
     path: /opt/ric/config
-    override: ""
-
-  cert:
-    path: /opt/ric/certificates
-    object: {}
-
-  hostname: xapp-std
-
-  resources: {}
-
-  nodeSelector: {}
-
-  tolerations: []
-
-  affinity: {}
 
+  appenv:
diff --git a/ric-xapps/90-xApps/scripts/localize.sh b/ric-xapps/90-xApps/scripts/localize.sh
deleted file mode 100755 (executable)
index 90f9038..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-################################################################################
-#   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.                                             #
-################################################################################
-
-if (( $# != 1 )); then
-  echo "Missing parameters: <xapp-name>"
-  exit
-fi
-
-source ./scripts/ric_env.sh
-if [ -z $__RICENV_SET__ ]; then
-  echo "Edit your ric_env.sh for first!"
-  exit
-fi
-
-# Update the local values
-RESULT_DIR=./generated
-rm -rf $RESULT_DIR && mkdir -p $RESULT_DIR && cp -rf ./helm $RESULT_DIR
-
-FILELIST=$(find ./helm  \( -name "*.tpl" -o -name "*.yaml" \))
-for f in $FILELIST; do
-  envsubst '${__RUNRICENV_DOCKER_HOST__} ${__RUNRICENV_DOCKER_PORT__}' < $f > "$RESULT_DIR/$f";
-done
-
-# Rename the helm chart folder
-mv $RESULT_DIR/helm/xapp-std $RESULT_DIR/helm/$1
-find $RESULT_DIR/helm/$1 -type f | xargs sed -i -e "s/xapp-std/$1/g"
-
-# Push to helm chart repo
-helm package generated/helm/$1 | awk '{ print $NF }' | xargs mv -t $__RUNRICENV_HELMREPO_DIR__
-helm repo index $__RUNRICENV_HELMREPO_DIR__
-helm repo update
diff --git a/ric-xapps/90-xApps/scripts/ric_env.sh b/ric-xapps/90-xApps/scripts/ric_env.sh
deleted file mode 100755 (executable)
index ea960c1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-################################################################################
-#   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.                                             #
-################################################################################
-
-
-# customize the following repo info to local environment
-export __RICENV_SET__='true'
-export __RUNRICENV_DOCKER_HOST__='192.168.0.6'
-export __RUNRICENV_DOCKER_PORT__='5000'
-export __RUNRICENV_HELMREPO_DIR__='/var/www/html/charts/'
\ No newline at end of file