Merge "Update standard xApp helm chart"
authorLusheng Ji <lji@research.att.com>
Mon, 24 Jun 2019 20:15:22 +0000 (20:15 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Mon, 24 Jun 2019 20:15:22 +0000 (20:15 +0000)
40 files changed:
RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE [new file with mode: 0644]
RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE [new file with mode: 0644]
RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE [moved from RECIPE_EXAMPLE/RECIPE_EXAMPLE with 83% similarity]
bin/deploy-ric-infra [new file with mode: 0755]
etc/ric-infra.conf [new file with mode: 0644]
ric-aux/80-Auxiliary-Functions/helm/dashboard/Chart.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml [new file with mode: 0644]
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/deployment.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/service.yaml
ric-aux/80-Auxiliary-Functions/helm/dashboard/values.yaml
ric-infra/00-Kubernetes/bin/gen-cloud-init.sh
ric-infra/00-Kubernetes/heat/scripts/k8s_vm_install.sh
ric-infra/10-Nexus/bin/change_password [new file with mode: 0755]
ric-infra/10-Nexus/bin/deploy_nexus_data [new file with mode: 0755]
ric-infra/10-Nexus/bin/install
ric-infra/10-Nexus/etc/nexus.conf
ric-infra/10-Nexus/helm/templates/deployment.yaml
ric-infra/10-Nexus/helm/templates/helmingress.yaml [new file with mode: 0644]
ric-infra/10-Nexus/helm/templates/ingress.yaml
ric-infra/10-Nexus/helm/templates/persistentVolume.yaml [new file with mode: 0644]
ric-infra/10-Nexus/helm/templates/persistentVolumeClaim.yaml [new file with mode: 0644]
ric-infra/10-Nexus/helm/templates/save-secret-job.yaml
ric-infra/10-Nexus/helm/templates/secret-helm.yaml [moved from ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/configmap.yaml with 75% similarity]
ric-infra/10-Nexus/helm/templates/storageClass.yaml [new file with mode: 0644]
ric-infra/10-Nexus/helm/values.yaml
ric-infra/15-Initcontainer/docker/Dockerfile [new file with mode: 0644]
ric-infra/15-Initcontainer/docker/bin/ricplt-init.sh [new file with mode: 0755]
ric-infra/20-Credential/bin/install
ric-infra/20-Credential/bin/uninstall
ric-infra/20-Credential/helm/resources/tls.crt
ric-infra/20-Credential/helm/templates/_helper.tpl
ric-infra/20-Credential/helm/values.yaml
ric-platform/50-RIC-Platform/helm/appmgr/resources/appenv.yaml [new file with mode: 0644]
ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml [new file with mode: 0644]
ric-platform/50-RIC-Platform/helm/appmgr/resources/xapp-manager.yaml [deleted file]
ric-platform/50-RIC-Platform/helm/appmgr/templates/appconfig.yaml
ric-platform/50-RIC-Platform/helm/appmgr/templates/appenv.yaml
ric-platform/50-RIC-Platform/helm/appmgr/templates/deployment.yaml
ric-platform/50-RIC-Platform/helm/appmgr/values.yaml
ric-platform/50-RIC-Platform/helm/common/templates/_helmrepo.tpl

diff --git a/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_AUX_RECIPE_EXAMPLE
new file mode 100644 (file)
index 0000000..cb494e4
--- /dev/null
@@ -0,0 +1,59 @@
+################################################################################
+#   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.                                             #
+###############################################################################
+
+#-------------------------------------------------------------------------
+# Global common setting
+#-------------------------------------------------------------------------
+global:
+  # Docker registry from which RIC platform components pull the images
+  repository: nexus3.o-ran-sc.org:10004
+  
+  # Name of the K8S docker credential that is onboarded by 20-credential 
+  repositoryCred: docker-reg-cred
+
+  # Docker image pull policy
+  imagePullPolicy: Always
+
+  # Helm repo that will be used by xApp manager
+  helmRepository: nexus.ricinfra.local
+
+  # Certificate of the helm repo
+  helmRepositoryCert: xapp-mgr-certs
+
+  # Name of the K8S secret that contains the credential of the helm repo
+  helmRepositoryCred: xapp-mgr-creds
+
+  # The name of the tiller that xApp helm client talks to
+  helmRepositoryTiller: tiller-deploy
+
+  # The namespace of the xApp helm tiller
+  helmRepositoryTillerNamespace: kube-system
+
+  # The port the xApp helm tiller is listening to
+  helmRepositoryTillerPort: 44134
+
+
+
+  
+#-------------------------------------------------------------------------
+# Auxiliary Functions
+#-------------------------------------------------------------------------
+dashboard:
+  image:
+    name:: ric-dash-be
+    tag: 1.0.0-SNAPSHOT
+
diff --git a/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE b/RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE
new file mode 100644 (file)
index 0000000..737526d
--- /dev/null
@@ -0,0 +1,72 @@
+################################################################################
+#   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.                                             #
+###############################################################################
+
+#-------------------------------------------------------------------------
+# Global common setting
+#-------------------------------------------------------------------------
+global:
+  # Docker registry from which RIC platform components pull the images
+  repository: nexus3.o-ran-sc.org:10004
+  
+  # Name of the K8S docker credential that is onboarded by 20-credential 
+  repositoryCred: docker-reg-cred
+
+  # Docker image pull policy
+  imagePullPolicy: Always
+
+  # Helm repo that will be used by xApp manager
+  helmRepository: nexus.ricinfra.local
+
+  # Certificate of the helm repo
+  helmRepositoryCert: xapp-mgr-certs
+
+  # Name of the K8S secret that contains the credential of the helm repo
+  helmRepositoryCred: xapp-mgr-creds
+
+  # The name of the tiller that xApp helm client talks to
+  helmRepositoryTiller: tiller-deploy
+
+  # The namespace of the xApp helm tiller
+  helmRepositoryTillerNamespace: kube-system
+
+  # The port the xApp helm tiller is listening to
+  helmRepositoryTillerPort: 44134
+
+#-------------------------------------------------------------------------
+# Infrastructure
+#-------------------------------------------------------------------------
+
+cluster:
+  deployK8S: false
+  deployNexus: false
+  useLocalHelmRepo: false
+  useLocalDockerRegistry: false
+
+
+repositoryCredential:
+  user: "docker"
+  password: "docker"
+
+
+helmrepoCredential:
+  user: "helm"
+  password: "docker"
+
+
+adminPassword: admin123
+
+datapath: /tmp/nexus3-data/
similarity index 83%
rename from RECIPE_EXAMPLE/RECIPE_EXAMPLE
rename to RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE
index e90af68..7d70475 100644 (file)
@@ -29,7 +29,7 @@ global:
   imagePullPolicy: Always
 
   # Helm repo that will be used by xApp manager
-  helmRepository: nexus.ricinfra.local
+  helmRepository: helm.ricinfra.local
 
   # Certificate of the helm repo
   helmRepositoryCert: xapp-mgr-certs
@@ -46,20 +46,6 @@ global:
   # The port the xApp helm tiller is listening to
   helmRepositoryTillerPort: 44134
 
-#-------------------------------------------------------------------------
-# Infrastructure
-#-------------------------------------------------------------------------
-
-
-
-  
-#-------------------------------------------------------------------------
-# Auxiliary Functions
-#-------------------------------------------------------------------------
-dashboard:
-  image:
-    name:: ric-dash-be
-    tag: 1.0.0-SNAPSHOT
 
 #-------------------------------------------------------------------------
 # Platform Components 
@@ -67,15 +53,15 @@ dashboard:
 # xApp Manager 
 appmgr:
   image:
-    name: xapp-manager
-    tag: latest
+    name: ric-plt-appmgr
+    tag: 0.1.3
 
 # DBAAS 
 dbaas:
   backend:
     image:
-      name: redis-standalone
-      tag: latest
+      name: ric-plt-dbaas
+      tag: 0.1.0
 
 # E2 Manager
 e2mgr:
diff --git a/bin/deploy-ric-infra b/bin/deploy-ric-infra
new file mode 100755 (executable)
index 0000000..508bcbd
--- /dev/null
@@ -0,0 +1,104 @@
+#!/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.                                             #
+################################################################################
+
+# This script deploys RIC auxiliary function components automatically
+
+OVERRIDEYAML=$1
+
+
+
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+source $DIR/../etc/ric-infra.conf
+
+export RICINFRA_RELEASE_NAME=$ric_infra_helm_release_name
+
+export RICINFRA_NAMESPACE=$ric_infra_namespace
+
+export DEPLOY_K8S=$deployK8S
+
+export DEPLOY_NEXUS=$deployNexus
+
+export USE_LOCAL_HELM_REPO=$useLocalHelmRepo
+
+export USE_LOCAL_DOCKER_REGISTRY=$useLocalDockerRegistry
+
+
+
+
+
+source $DIR/../etc/ric-platform.conf
+
+export RICPLT_RELEASE_NAME=$ric_platform_helm_release_name
+
+export RICPLT_NAMESPACE=$ric_platform_namespace
+
+
+
+
+if [ -z "$OVERRIDEYAML" ];then
+       echo "****************************************************************************************************************"
+       echo "                                                     WARNING                                                    "
+       echo "****************************************************************************************************************"
+       echo "Deploying RIC infrastructure components without deployment recipe. Default configurations are used."
+       echo "****************************************************************************************************************"
+
+else
+
+       export DEPLOY_K8S=$(cat $OVERRIDEYAML | grep deployK8S | awk '{print $2}')
+       export DEPLOY_NEXUS=$(cat $OVERRIDEYAML | grep deployNexus | awk '{print $2}')
+       export USE_LOCAL_HELM_REPO=$(cat $OVERRIDEYAML | grep useLocalHelmRepo | awk '{print $2}')
+       export USE_LOCAL_DOCKER_REGISTRY=$(cat $OVERRIDEYAML | grep useLocalDockerRegistry | awk '{print $2}')
+fi
+
+
+
+if $USE_LOCAL_HELM_REPO  &&  [ "$DEPLOY_NEXUS" != "true" ];then
+       echo "****************************************************************************************************************"
+        echo "                                                     ERROR                                                    "
+        echo "****************************************************************************************************************"
+        echo "Local helm repo cannot be used if Nexus is not installed. Please change your configurations in the deployment recipe."
+        echo "****************************************************************************************************************"
+       exit 1
+fi
+
+
+if $USE_LOCAL_DOCKER_REGISTRY  &&  [ "$DEPLOY_NEXUS" != "true" ];then
+       echo "****************************************************************************************************************"
+        echo "                                                     ERROR                                                    "
+        echo "****************************************************************************************************************"
+        echo "Local docker registry cannot be used if Nexus is not installed. Please change your configurations in the deployment recipe."
+        echo "****************************************************************************************************************"
+       exit 1
+fi
+
+
+if $DEPLOY_K8S; then
+       echo "Deploying K8S. Please make sure that you configure files in ./ric-infra/00-Kubernetes/etc correctly."
+       . ../ric-infra/00-Kubernetes/bin/install
+fi
+
+
+if $DEPLOY_NEXUS; then
+       echo "Deploying Nexus."
+       . ../ric-infra/10-Nexus/bin/install $OVERRIDEYAML
+fi
+
+
+
diff --git a/etc/ric-infra.conf b/etc/ric-infra.conf
new file mode 100644 (file)
index 0000000..a5ddb27
--- /dev/null
@@ -0,0 +1,36 @@
+################################################################################
+#   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.                                             #
+################################################################################
+
+# -------------------  RIC AUX ---------------------------------------
+
+# release name helm will use to deploy RIC infrastructure componenets
+ric_infra_helm_release_name=r0
+
+# namespace that helm will use to deploy RIC infrastructure componenets
+ric_infra_namespace=ricinfra
+
+# deploy the kubernete cluster
+deployK8S=false
+
+# deploy a nexus repository manager
+deployNexus=true
+
+# use the local helm repo
+useLocalHelmRepo=true
+
+# use the local docker registry
+useLocalDockerRegistry=false
index f142b0a..11d8096 100644 (file)
@@ -17,6 +17,7 @@
 
 apiVersion: v1
 appVersion: "1.0"
-description: Helm chart for the RIC Dashboard web app
+description: Helm Chart for RIC Dashboard
 name: dashboard
 version: 1.1.0
+icon: https://gerrit.o-ran-sc.org/r/gitweb?p=portal/ric-dashboard.git;a=blob;f=webapp-frontend/src/assets/at_t.png;h=3cced1d5ce4668fbf3b33064aaaa6920bc8130b6;hb=HEAD
diff --git a/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml b/ric-aux/80-Auxiliary-Functions/helm/dashboard/templates/appconfig.yaml
new file mode 100644 (file)
index 0000000..2930a15
--- /dev/null
@@ -0,0 +1,32 @@
+################################################################################
+#   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.                                             #
+################################################################################
+
+# Defines a config map for mounting as file application.properties
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ include "dashboard.fullname" . }}-appconfig
+data:
+  # this key becomes the filename when mounted
+  application.properties: |
+    # appconfig.yaml
+    server.port = {{ .Values.dashboard.server.port }}
+    a1med.url =   {{ .Values.dashboard.properties.a1med.url   }}
+    anrxapp.url = {{ .Values.dashboard.properties.anrxapp.url }}
+    e2mgr.url =   {{ .Values.dashboard.properties.e2mgr.url   }}
+    xappmgr.url = {{ .Values.dashboard.properties.xappmgr.url }}
index f02ddec..a4b311d 100644 (file)
@@ -46,14 +46,13 @@ spec:
           imagePullPolicy: {{ include "common.pullPolicy" . }}
           ports:
             - name: http
-              containerPort: 8080
+              containerPort: {{ .Values.dashboard.server.port }}
               protocol: TCP
-          env:
-            - name: SPRING_APPLICATION_JSON
-              valueFrom:
-                configMapKeyRef:
-                  name: dashboard-configmap
-                  key: springApplication.json
+          volumeMounts:
+            - name: application-config
+              mountPath: /maven/application.properties
+              subPath: application.properties
+              readOnly: true
           livenessProbe:
             httpGet:
               path: /
@@ -62,3 +61,7 @@ spec:
             httpGet:
               path: /
               port: http
+      volumes:
+        - name: application-config
+          configMap:
+            name: {{ include "dashboard.fullname" . }}-appconfig
index 5a1b93c..08a4887 100644 (file)
@@ -28,7 +28,8 @@ metadata:
 spec:
   type: {{ .Values.dashboard.service.type }}
   ports:
-    - port: {{ .Values.dashboard.service.port }}
+    - port: {{ .Values.dashboard.server.port }}
+      nodePort: {{ .Values.dashboard.service.port }}
       targetPort: http
       protocol: TCP
   selector:
index 48da930..eb94646 100644 (file)
 #   limitations under the License.                                             #
 ################################################################################
 
-# Default values for dashboard.
-# This is a YAML-formatted file.
-# Declare variables to be passed into your templates.
+# Deployment values for dashboard.
 
-replicaCount: 1
 repository: "nexus3.o-ran-sc.org:10004"
 imagePullPolicy: IfNotPresent
 repositoryCred: docker-reg-cred
@@ -27,10 +24,22 @@ repositoryCred: docker-reg-cred
 dashboard:
   image:
     name: ric-dash-be
-    tag: 1.0.0-SNAPSHOT
-  
-  
+    tag: 1.0.4
+  replicaCount: 1
+  server:
+    # Tomcat listens here
+    port: 8080
   service:
     type: NodePort
-    port: 80
-  
+    port: 30080
+    name: dashboard-service
+  # config URLs must be specified at deployment
+  properties:
+    a1med:
+      url:  http://values-yaml-default-A1-URL
+    anrxapp:
+      url:  http://values-yaml-default-ANR-URL
+    e2mgr:
+      url:  http://values-yaml-default-E2-URL
+    xappmgr:
+      url:  http://values-yaml-default-MGR-URL
index b0270c4..61603ba 100755 (executable)
@@ -126,7 +126,8 @@ sed -e "s/__k8s_cni_version__/${INFRA_CNI_VERSION}/g" "$filename" > tmp && mv tm
 sed -e "s/__helm_version__/${INFRA_HELM_VERSION}/g" "$filename" > tmp && mv tmp "$filename"
 sed -e "s/__k8s_mst_private_ip_addr__/\$(hostname -I)/g" "$filename" > tmp && mv tmp "$filename"
 sed -e "s/__host_private_ip_addr__/\$(hostname -I)/g" "$filename" > tmp && mv tmp "$filename"
-sed -e "s/__k8s_mst_floating_ip_addr__/\$(ec2metadata --public-ipv4)/g" "$filename" > tmp && mv tmp "$filename" 
+#sed -e "s/__k8s_mst_floating_ip_addr__/\$(ec2metadata --public-ipv4)/g" "$filename" > tmp && mv tmp "$filename" 
+sed -e "s/__k8s_mst_floating_ip_addr__/\$(curl ifconfig.co)/g" "$filename" > tmp && mv tmp "$filename" 
 sed -e "s/__stack_name__/\$(hostname)/g" "$filename" > tmp && mv tmp "$filename"
 #echo "__mtu__" > /opt/config/mtu.txt
 #echo "__cinder_volume_id__" > /opt/config/cinder_volume_id.txt
index 54dbc3e..e3a949b 100644 (file)
@@ -264,9 +264,6 @@ EOF
     sleep 15
   done
 
-  # install ingress controller db-less kong
-  helm install stable/kong --set ingressController.enabled=true --set postgresql.enabled=false --set env.database=off
-
 
   echo "Starting an NC TCP server on port 29999 to indicate we are ready"
   nc -l -p 29999 &
diff --git a/ric-infra/10-Nexus/bin/change_password b/ric-infra/10-Nexus/bin/change_password
new file mode 100755 (executable)
index 0000000..1a727d3
--- /dev/null
@@ -0,0 +1,225 @@
+#!/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.                                             #
+################################################################################
+
+OVERRIDEYAML=$1
+
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+source $DIR/../etc/nexus.conf
+
+if [ -z "$RICINFRA_RELEASE_NAME" ];then
+   RELEASE_NAME=$helm_release_name
+else
+   RELEASE_NAME=$RICINFRA_RELEASE_NAME
+fi
+if [ -z "$RICINFRA_NAMESPACE" ];then
+   NAMESPACE=$namespace
+else
+   NAMESPACE=$RICINFRA_NAMESPACE
+fi
+if [ -z "$INGRESS_PORT" ];then
+   INGRESS_PORT_NEXUS=$ingress_port
+else
+   INGRESS_PORT_NEXUS=$INGRESS_PORT
+fi
+
+if [ -z "$DEFAULT_NEXUS_ADMIN_PASSWORD" ];then
+   NEXUS_ADMIN_PASSWORD=$default_admin_password
+else
+   NEXUS_ADMIN_PASSWORD=$DEFAULT_NEXUS_ADMIN_PASSWORD
+fi
+
+
+
+HOSTPOSTFIX=$(cat $DIR/../helm/values.yaml  | grep hostpostfix | awk '{print $2}')
+
+
+
+
+
+
+
+
+
+NEXUS_URL="http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS"
+
+
+
+
+
+
+if [ -z $OVERRIDEYAML ]; then
+
+  DOCKERPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*repositoryCredential:.*/{getline; getline;  print substr($2, 2, length($2)-2);}')
+  HELMPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*helmrepoCredential:.*/{getline; getline;  print substr($2, 2, length($2)-2);}')
+  ADMINPASSWORD=$(cat $DIR/../helm/values.yaml | awk '/^.*adminPassword:.*/{print $2}')
+
+else
+
+
+
+  DOCKERPASSWORD=$(cat $OVERRIDEYAML | awk '/^.*repositoryCredential:.*/{getline; getline;  print substr($2, 2, length($2)-2);}')
+
+
+
+  if [ -z $DOCKERPASSWORD ]; then
+    DOCKERPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*repositoryCredential:.*/{getline; getline;  print substr($2, 2, length($2)-2);}')
+  fi
+
+  HELMPASSWORD=$(cat $OVERRIDEYAML | awk '/^.*helmrepoCredential:.*/{getline; getline;  print substr($2, 2, length($2)-2);}')
+  if [ -z $HELMPASSWORD ]; then
+    HELMPASSWORD=$(cat $DIR/../../20-Credential/helm/values.yaml | awk '/^.*helmrepoCredential:.*/{getline; getline;  print substr($2, 2, length($2)-2);}')
+  fi
+
+  ADMINPASSWORD=$(cat $OVERRIDEYAML | awk '/^.*adminPassword:.*/{print $2;}')
+  if [ -z $ADMINPASSWORD ]; then
+    ADMINPASSWORD=$(cat $DIR/../helm/values.yaml | awk '/^.*adminPassword:.*/{print $2;}')
+  fi
+
+fi
+
+
+
+
+#echo $DOCKERPASSWORD, $HELMPASSWORD, $ADMINPASSWORD
+
+
+
+
+DOCKERPORT=$(cat $DIR/../helm/templates/deployment.yaml  | awk '/.*- name: docker.*/{getline; print $2}')
+
+
+DOCKERREPOSCRIPT="{\"name\":\"docker_changepassword\",\
+    \"type\":\"groovy\",\
+    \"content\":\"security.securitySystem.changePassword('docker',  '$DOCKERPASSWORD')\"}"
+
+
+
+
+# This line uses the default admin password
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H "Content-Type: application/json" --data "$DOCKERREPOSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script)
+
+
+if [ "${STATUS}" != "204" ];then
+    echo "> script upload failed!"
+fi
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/docker_changepassword/run)
+
+
+if [ "${STATUS}" == "200" ];then
+    echo "> docker password change succeeded!"
+else
+    echo "> docker password change failed!"
+fi
+
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE -u admin:$NEXUS_ADMIN_PASSWORD http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/docker_changepassword)
+
+
+if [ "${STATUS}" != "204" ];then
+    echo "> script deletion failed!"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+HELMREPOSCRIPT="{\"name\":\"helm_changepassword\",\
+    \"type\":\"groovy\",\
+    \"content\":\"security.securitySystem.changePassword('helm',  '$HELMPASSWORD')\"}"
+
+
+
+# This line uses the default admin password
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H "Content-Type: application/json" --data "$HELMREPOSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script)
+
+
+if [ "${STATUS}" != "204" ];then
+    echo "> script upload failed!"
+fi
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/helm_changepassword/run)
+
+
+if [ "${STATUS}" == "200" ];then
+    echo "> helm password change succeeded!"
+else
+    echo "> helm password change failed!"
+fi
+
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE -u admin:$NEXUS_ADMIN_PASSWORD http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/helm_changepassword)
+
+
+if [ "${STATUS}" != "204" ];then
+    echo "> script deletion failed!"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ADMINSCRIPT="{\"name\":\"admin_changepassword\",\
+    \"type\":\"groovy\",\
+    \"content\":\"security.securitySystem.changePassword('admin',  '$ADMINPASSWORD')\"}"
+
+
+
+# This line uses the default admin password
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H "Content-Type: application/json" --data "$ADMINSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script)
+
+
+if [ "${STATUS}" != "204" ];then
+    echo "> script upload failed!"
+fi
+
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -u admin:$NEXUS_ADMIN_PASSWORD -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/admin_changepassword/run)
+
+
+if [ "${STATUS}" == "200" ];then
+    echo "> admin password change succeeded!"
+else
+    echo "> admin password change failed!"
+fi
+
+NEXUS_ADMIN_PASSWORD=$ADMINPASSWORD
+STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE -u admin:$NEXUS_ADMIN_PASSWORD http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/admin_changepassword)
+
+
+if [ "${STATUS}" != "204" ];then
+    echo "> script deletion failed!"
+fi
+
diff --git a/ric-infra/10-Nexus/bin/deploy_nexus_data b/ric-infra/10-Nexus/bin/deploy_nexus_data
new file mode 100755 (executable)
index 0000000..8c630f0
--- /dev/null
@@ -0,0 +1,70 @@
+#!/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.                                             #
+################################################################################
+
+OVERRIDEYAML=$1
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+
+
+
+
+
+
+if [ -z $OVERRIDEYAML ]; then
+
+  DATAPATH=$(cat $DIR/../helm/values.yaml | awk '/^.*datapath:.*/{ print $2;}')
+  
+else
+
+  DATAPATH=$(cat $OVERRIDEYAML | awk '/^.*datapath:.*/{ print $2;}')
+
+
+  if [ -z $DATAPATH ]; then
+    DATAPATH=$(cat $DIR/../helm/values.yaml | awk '/^.*datapath:.*/{ print $2;}')
+  fi
+
+fi
+
+if [ -e $DATAPATH ]; then
+       if [ ! -w $DATAPATH ]; then
+               echo "Error: you don't have write permission to directory $DATAPATH"
+               echo "Deployment terminated."
+               exit 1
+       fi
+
+       rm -rf $DATAPATH
+
+       mkdir -p $DATAPATH
+
+       tar -xf $DIR/../etc/conf.tar -C $DATAPATH
+
+       chmod -R a+rwx $DATAPATH
+else
+       mkdir -p $DATAPATH
+        if [ $? -eq 0 ]; then
+          tar -xf $DIR/../etc/conf.tar -C $DATAPATH
+          chmod -R a+rwx $DATAPATH
+        else
+         echo "Error: you don't have write permission to directory $DATAPATH"
+          echo "Deployment terminated."
+          exit 1
+       fi
+
+
+fi
+
+
index c0c5ed0..452924b 100755 (executable)
@@ -57,6 +57,18 @@ echo "You can access this nexus here: http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NE
 echo "If nexus.$HOSTPOSTFIX is not resolved by your DNS server, please add an entry in your /etc/hosts file."
 echo "****************************************************************************************************************"
 
+. ./deploy_nexus_data $OVERRIDEYAML
+
+
+
+NODENAME=$(kubectl get node | awk 'NR==2{print $1}')
+kubectl label --overwrite nodes $NODENAME nexus-node=enable
+
+
+
+
+
+
 COMMON_CHART_VERSION=$(cat $DIR/../../../ric-platform/50-RIC-Platform/helm/common/Chart.yaml | grep version | awk '{print $2}')
 helm package -d /tmp $DIR/../../../ric-platform/50-RIC-Platform/helm/common
 
@@ -70,9 +82,10 @@ else
 helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-nexus" $DIR/../helm
 fi
 
-NEXUS_POD_NAME=$(kubectl get pod -n $NAMESPACE | grep nexus | grep ContainerCreating | awk '{print $1}')
 
 
+NEXUS_POD_NAME=$(kubectl get pod -n $NAMESPACE | grep nexus | grep -v "Terminating" | awk '{print $1}')
+
 
 echo "Waiting Nexus to be ready."
 echo " "
@@ -102,23 +115,7 @@ done
 echo $IS_NEXUS_READY
 
 
-DOCKERPORT=$(cat $DIR/../helm/templates/deployment.yaml  | awk '/.*- name: docker.*/{getline; print $2}')
-
-
-DOCKERREPOSCRIPT="{\"name\":\"create_docker_repo\",\
-    \"type\":\"groovy\",\
-    \"content\":\"repository.createDockerHosted('docker.snapshot',\
-    $DOCKERPORT, null, 'default', false, true)\"}"
-
-echo $DOCKERREPOSCRIPT
-
-# This line uses the default admin password
-curl -u admin:admin123 -X POST -H "Content-Type: application/json" --data "$DOCKERREPOSCRIPT" http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script
-
-curl -u admin:admin123 -X POST -H 'Content-Type: text/plain' -H 'Accept: application/json' http://nexus.$HOSTPOSTFIX:$INGRESS_PORT_NEXUS/service/rest/v1/script/create_docker_repo/run
-
-
-
+. ./change_password $OVERRIDEYAML
 
 
 
index cd40a73..ce00f72 100644 (file)
@@ -28,3 +28,6 @@ namespace=ric-infra
 # ingress port number of the K8S cluster
 # It will be overrided by INGRESS_PORT
 ingress_port=30000
+
+
+default_admin_password=admin123
index 65c5c23..2ba358c 100644 (file)
@@ -51,6 +51,15 @@ spec:
             - name: docker
               containerPort: 10001
               protocol: TCP
+          volumeMounts:
+            - name: nexus-config
+              mountPath: /nexus-data
+      volumes:
+        - name: nexus-config
+          persistentVolumeClaim:
+            claimName: nexus-claim
+      
+      
               #          livenessProbe:
               #            httpGet:
               #              path: /
diff --git a/ric-infra/10-Nexus/helm/templates/helmingress.yaml b/ric-infra/10-Nexus/helm/templates/helmingress.yaml
new file mode 100644 (file)
index 0000000..291a103
--- /dev/null
@@ -0,0 +1,40 @@
+################################################################################
+#   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: extensions/v1beta1
+kind: Ingress
+metadata:
+  annotations:
+    nginx.ingress.kubernetes.io/rewrite-target: /repository/helm.local/
+  name: {{ include "nexus.fullname" . }}-helm
+  labels:
+    app: {{ template "nexus.name" . }}
+    chart: {{ template "nexus.chart" . }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  tls:
+    - hosts:
+      - helm.{{ .Values.ingress.hostpostfix }}
+      secretName: {{ include "common.helmrepositorycert" . }}
+  rules:
+    - host: helm.{{ .Values.ingress.hostpostfix }}
+      http:
+        paths:
+          - backend:
+              serviceName: {{ include "nexus.fullname" . }}
+              servicePort: nexus
+            path: /
index 3609022..d1bbf2a 100644 (file)
@@ -25,9 +25,9 @@ metadata:
     heritage: {{ .Release.Service }}
 spec:
   tls:
-  - hosts:
-    - docker.{{ .Values.ingress.hostpostfix }}
-    secretName: {{ include "common.repositorycert" . }}
+    - hosts:
+      - docker.{{ .Values.ingress.hostpostfix }}
+      secretName: {{ include "common.repositorycert" . }}
   rules:
     - host: nexus.{{ .Values.ingress.hostpostfix }}
       http:
diff --git a/ric-infra/10-Nexus/helm/templates/persistentVolume.yaml b/ric-infra/10-Nexus/helm/templates/persistentVolume.yaml
new file mode 100644 (file)
index 0000000..dfdbd21
--- /dev/null
@@ -0,0 +1,21 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: nexus3-configuration
+spec:
+  capacity:
+    storage: {{ .Values.storagesize }}
+  accessModes:
+  - ReadWriteOnce
+  persistentVolumeReclaimPolicy: Retain
+  storageClassName: nexus3-storage
+  local:
+    path: {{ .Values.datapath }}
+  nodeAffinity:
+    required:
+      nodeSelectorTerms:
+      - matchExpressions:
+        - key: nexus-node
+          operator: In
+          values:
+          - enable
diff --git a/ric-infra/10-Nexus/helm/templates/persistentVolumeClaim.yaml b/ric-infra/10-Nexus/helm/templates/persistentVolumeClaim.yaml
new file mode 100644 (file)
index 0000000..b0f29ba
--- /dev/null
@@ -0,0 +1,11 @@
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+  name: nexus-claim
+spec:
+  accessModes:
+  - ReadWriteOnce
+  storageClassName: nexus3-storage 
+  resources:
+    requests:
+      storage: {{ .Values.storagesize }}
index 44b75ef..1d0e1be 100644 (file)
@@ -25,18 +25,24 @@ spec:
       containers:
       - name: cert-copy
         image: alpine
-        command: ["cp", "-rL", "/var/run/certs/..data/tls.crt", "/var/run/certs-copy/"]
+        command: [ "/bin/sh","-c","cp -rL /var/run/dockercerts/..data/tls.crt /var/run/certs-copy/dockertls.crt && cp -rL /var/run/helmcerts/..data/tls.crt /var/run/certs-copy/helmtls.crt"]
         #        command: ["tail", "-f", "/dev/null"]
         volumeMounts:
-        - name: certs
-          mountPath: /var/run/certs
+        - name: dockercerts
+          mountPath: /var/run/dockercerts
+          readOnly: true
+        - name: helmcerts
+          mountPath: /var/run/helmcerts
           readOnly: true
         - name:  write-to-volume
           mountPath: /var/run/certs-copy
       volumes:
-      - name: certs
+      - name: dockercerts
         secret:
           secretName: {{ include "common.repositorycert" . }}
+      - name: helmcerts
+        secret:
+          secretName: {{ include "common.helmrepositorycert" . }}
       - name: write-to-volume
         hostPath:
           path: /tmp
 #   limitations under the License.                                             #
 ################################################################################
 
-# Provides configuration parameters which spring expects as a JSON string
-
 apiVersion: v1
-kind: ConfigMap
+kind: Secret
+type: kubernetes.io/tls
 metadata:
-  name: dashboard-configmap
+  name: {{ include "common.helmrepositorycert" . }}
+  labels:
+    app: {{ template "nexus.name" . }}
+    chart: {{ template "nexus.chart" . }}
+    heritage: {{ .Release.Service }}
+    release: {{ .Release.Name }}
+  annotations:
+    "helm.sh/hook": "pre-install"
+    "helm.sh/hook-delete-policy": "before-hook-creation"
 data:
-  springApplication.json: |
-    {
-      "a1med": {
-        "basepath": "http://0.1.2.3:45"
-      },
-      "e2mgr": {
-        "basepath": "http://1.2.3.4:56"
-      },
-      "xappmgr": {
-        "basepath": "http://2.3.4.5:67"
-      }
-    }
+{{ ( include "common.helmrepository.gen-certs" . ) | indent 2 }}
diff --git a/ric-infra/10-Nexus/helm/templates/storageClass.yaml b/ric-infra/10-Nexus/helm/templates/storageClass.yaml
new file mode 100644 (file)
index 0000000..97ccd0f
--- /dev/null
@@ -0,0 +1,6 @@
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+  name: nexus3-storage
+provisioner: kubernetes.io/no-provisioner
+volumeBindingMode: WaitForFirstConsumer
index b35bd0c..31f8a72 100644 (file)
@@ -26,6 +26,15 @@ replicaCount: 1
 # repositoryCertOverride: ""
 repositoryCert: docker-reg-certs
 
+# This is the name of K8S secret that contains the helm repository cert
+# You can override this by using
+# helmRepositoryCertOverride: ""
+helmRepositoryCert: xapp-mgr-certs
+
+
+# This is the admin password
+adminPassword: admin123
+
 # This is designed to be deployed using local image
 image:
   repository: nexus-repository-helm-apt
@@ -39,3 +48,6 @@ service:
 ingress:
   hostpostfix: ricinfra.local
 
+
+storagesize: 20Gi
+datapath: /tmp/nexus3-data/
diff --git a/ric-infra/15-Initcontainer/docker/Dockerfile b/ric-infra/15-Initcontainer/docker/Dockerfile
new file mode 100644 (file)
index 0000000..8c38d71
--- /dev/null
@@ -0,0 +1,34 @@
+#   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.
+FROM alpine
+
+MAINTAINER "RIC"
+
+LABEL name="Generic initcontainer image for RIC Platform components"
+
+RUN apk update
+
+# iproute2: required for e2 termination
+RUN apk add iproute2
+# kubectl: required for xapp/ricplt helm installers
+RUN apk add openssl
+# kubectl: required for xapp/ricplt helm installers
+ADD https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubectl /bin/kubectl
+RUN chmod +x /bin/kubectl
+
+COPY bin/ricplt-init.sh /ricplt-init.sh
+
+#
+CMD /ricplt-init.sh
diff --git a/ric-infra/15-Initcontainer/docker/bin/ricplt-init.sh b/ric-infra/15-Initcontainer/docker/bin/ricplt-init.sh
new file mode 100755 (executable)
index 0000000..c16ad95
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+#   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 is placeholder script, intended
+# to be overridden by individual RIC
+# component charts.
+exit 0
index a261990..eb7bf21 100755 (executable)
@@ -45,8 +45,8 @@ cp /tmp/common-$COMMON_CHART_VERSION.tgz $DIR/../helm/charts/
 
 
 if [ -z $OVERRIDEYAML ]; then
-  helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../helm
+  helm install --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-${NAMESPACE}-credential" $DIR/../helm
 else
-  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-credential" $DIR/../helm
+  helm install -f $OVERRIDEYAML --namespace "${NAMESPACE}" --name "${RELEASE_NAME}-${NAMESPACE}-credential" $DIR/../helm
 fi
 
index f93004a..c820c7f 100755 (executable)
@@ -36,5 +36,5 @@ else
    NAMESPACE=$RICPLT_NAMESPACE
 fi
 
-  helm delete --purge "${RELEASE_NAME}-credential"
+helm delete --purge "${RELEASE_NAME}-${NAMESPACE}-credential"
 
index 3060f34..984701e 100644 (file)
@@ -1,19 +1,19 @@
 -----BEGIN CERTIFICATE-----
-MIIDCTCCAfGgAwIBAgIBATANBgkqhkiG9w0BAQsFADAdMRswGQYDVQQDExJkb2Nr
-ZXItcmVnaXN0cnktY2EwHhcNMTkwNTE1MTQ1NzQzWhcNMjAwNTE0MTQ1NzQzWjAQ
-MQ4wDAYDVQQDEwVuZXh1czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AKNNbC8/cil64YXmPYpN7mRaT5biVsZrOrFkXfX2AXcJAsLUL7E4t7keK4Ba/VwO
-pJKmgdjI4NxlTxe+zoOJVVz3+sMYz77UZTd1h/KDn1eBfozbqHcQ5lQksNDsL46d
-yG/JfYpEEzRha/QxEEdaaQLWMyOcf/SjWnscqMQ2cGvTaEiO8F1re2qrwfnrbqQm
-JYkIrmBbcGKMdg33edZpl3xbFc9eMfJGWuhaoC+Tk7Hj1EtV/O9KdPrvDYzO+h7P
-HVExKXU04h1f9ThAoeU9/o7EN266iuUiCVE6M0zekYSV4BuAkXqbUtmpbnYziAYo
-Cq2puiNUSirqXc6Bno12QykCAwEAAaNhMF8wDgYDVR0PAQH/BAQDAgWgMB0GA1Ud
-JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8EAjAAMCAGA1UdEQQZ
-MBeCFWRvY2tlci5yaWNpbmZyYS5sb2NhbDANBgkqhkiG9w0BAQsFAAOCAQEAg5aE
-yicj1VnG4G3JeCszj2hFFmg2eTnwkPsIlpeIMJY8zI/IZ2aQP5e0KPAM8IaKMnqq
-RPPusL2DF7Dl4A+ZBTkvfKtxIzwc7wnQGCfonMyM/MxyoBxXIJw+Qek42CpVbYYt
-qVZ3fz6VpCvF/QL6eGmVpMlvLIu15C9pxzEHPcUKpkM1mvKLRcxn2tt5daqjh9ao
-EvZHJt8kOh53c/FZHgA2+73I8Gx6BLUZPO0E+E1vC5K1FwtCl+Cmt6nX5jZEw1LK
-eNcb3oZhXrVnUoQ72HTJEWuPjydB7w1hxnzB5RYGZalM7XwDmOHwdGHlNxpmMbJa
-UZ4yL0N+nAUbLeUS2w==
+MIIDFzCCAf+gAwIBAgIRAPqRsyJWFaoXjwzmI+uQ5GkwDQYJKoZIhvcNAQELBQAw
+HTEbMBkGA1UEAxMSaGVsbS1yZXBvc2l0b3J5LWNhMB4XDTE5MDYyMjAzMDYxNVoX
+DTIwMDYyMTAzMDYxNVowEDEOMAwGA1UEAxMFbmV4dXMwggEiMA0GCSqGSIb3DQEB
+AQUAA4IBDwAwggEKAoIBAQDBExs2W0HvXyinLL/LOkgM4Dobe1OVVntQzCGB8tqD
+xI4ZcXGh8G4b3GMLVe8vs0c0IUUbPhy23AkDxGUT7whLbo1UwGa41htxY51zok4S
+20NN706XVs6E0tKqA1L5kzyxLEAKgHE/EefWIf6MHtRt5GfwFVdjdfZP+9L/ZpUL
+u1HKmiWw7fv0m/MrcAQA7lILpB4xeaM8rYWtBj8TGeoMlWLOtOcFKGpY9Kuty1n7
+cebHcz++qY+Vsrf8RlG4lGlit2IY06FE+5ihK24Zt9Ttwf3lsTf6xDwAEGmDxOAp
+R61gY9wX8ClLO+ns+nkkEiJ90104a4U+qg115tZCGfBBAgMBAAGjXzBdMA4GA1Ud
+DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0T
+AQH/BAIwADAeBgNVHREEFzAVghNoZWxtLnJpY2luZnJhLmxvY2FsMA0GCSqGSIb3
+DQEBCwUAA4IBAQA2Mt29tQ/3ACBpmZSKLPj3jTpPulXQKgtH9of9X0XBQ0ZdfqTN
+Evyu+K5gY/FF6RhnkaCML4XoOnvJHQQBydwMrK9f6mcC26U8PWZn9+usihw5GJHp
+Hu3pc0PDHb87ha+qCeie9ssKitz8pbJarTh6z1Ht8OT9/nktXkgPnIYI9ycAsdwy
+uBww45UxDu8OD8TT0/08RzH56ruPpRSYDNRbkcT8FZV8C6KgEKG55e/xNAITQwaD
+LD4xYkAZqK7lcPzuIM1kZUQAOJyw72TicMl94r0mL7pZ2NOJUCkkVvkYXo97TUKB
+zomEUpolyZnVpdl4HG3v3Lwd2K3bCs2X+HTc
 -----END CERTIFICATE-----
index 67274f0..83d4967 100644 (file)
@@ -59,7 +59,7 @@ Create chart name and version as used by the chart label.
 */}}
 {{- define "repository.secret" -}}
   {{- $repo := include "common.repository" . }}
-  {{- $cred := .Values.repositoryCred }}
+  {{- $cred := .Values.repositoryCredential }}
   {{- $user := default "docker" $cred.user }}
   {{- $password := default "docker" $cred.password }}
   {{- $mail := default "@" $cred.mail }}
@@ -70,12 +70,12 @@ Create chart name and version as used by the chart label.
 
 
 {{- define "helmrepo.secret.user" -}}
-  {{- $user := default "helm" .Values.helmrepoCred.user -}}
+  {{- $user := default "helm" .Values.helmrepoCredential.user -}}
   {{- printf "%s" $user |b64enc }}
 {{- end -}}
 
 
 {{- define "helmrepo.secret.password" -}}
-  {{- $pass := default "helm" .Values.helmrepoCred.password -}}
+  {{- $pass := default "helm" .Values.helmrepoCredential.password -}}
   {{- printf "%s" $pass |b64enc }}
 {{- end -}}
index 8f37004..ad22a1a 100644 (file)
 # Values for setting up Kubernetes resources for accessing infrastructure such as docker registry
 # helm repo, etc.
 
+repository: "nexus3.o-ran-sc.org:10004"
 
-repositoryCred:
+repositoryCredential:
   user: "docker"
   password: "docker"
 
 
-helmrepoCred:
+helmrepoCredential:
   user: "helm"
   password: "helm"
diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/resources/appenv.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/resources/appenv.yaml
new file mode 100644 (file)
index 0000000..c52bf15
--- /dev/null
@@ -0,0 +1,5 @@
+NAME: xappmgr
+DBAAS_SERVICE_HOST: "r0-dbaas-redis-standalone"
+DBAAS_SERVICE_PORT: "6379"
+DBAAS_PORT_6379_TCP_ADDR: "r0-dbaas-redis-standalone"
+DBAAS_PORT_6379_TCP_PORT: "6379"
diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/resources/appmgr.yaml
new file mode 100644 (file)
index 0000000..c7c8086
--- /dev/null
@@ -0,0 +1,25 @@
+"local":
+  # Port on which the xapp-manager REST services are provided
+  "host": __REST_PORT__
+"helm":
+  # Remote helm repo URL. UPDATE this as required.
+  "repo": __HELM_REPO__
+
+  # Repo name referred within the xapp-manager
+  "repo-name": __REPO_NAME__
+
+  # Tiller service details in the cluster. UPDATE this as required.
+  "tiller-service": __TILLER_SERVICE__
+  "tiller-namespace": __TILLER_NAMESPACE__
+  "tiller-port": __TILLER_PORT__
+  # helm username and password files
+  "helm-username-file": "/opt/ric/secret/helm_repo_username"
+  "helm-password-file": "/opt/ric/secret/helm_repo_password"
+  "retry": 1
+"xapp":
+  #Namespace to install xAPPs
+  "namespace": "ricxapp"
+  "tarDir": "/tmp"
+  "schema": "descriptors/schema.json"
+  "config": "config/config-file.json"
+  "tmpConfig": "/tmp/config-file.json"
diff --git a/ric-platform/50-RIC-Platform/helm/appmgr/resources/xapp-manager.yaml b/ric-platform/50-RIC-Platform/helm/appmgr/resources/xapp-manager.yaml
deleted file mode 100644 (file)
index 179bb75..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-"local":
-  # Port on which the xapp-manager REST services are provided
-  "host": __REST_PORT__
-"helm":
-  # Remote helm repo URL. UPDATE this as required.
-  "repo": __HELM_REPO__
-
-  # Repo name referred within the xapp-manager
-  "repo-name": __REPO_NAME__
-
-  # Tiller service details in the cluster. UPDATE this as required.
-  "tiller-service": __TILLER_SERVICE__
-  "tiller-namespace": __TILLER_SERVICE__
-  "tiller-port": __TILLER_PORT__
index 0ed87d4..79f334d 100644 (file)
@@ -20,10 +20,11 @@ kind: ConfigMap
 metadata:
   name: {{ include "appmgr.fullname" . }}-appconfig
 data:
-  {{- $restport := default ":8080" (printf ":%.0f" .Values.appmgr.containerPort) | quote -}}
-  {{- $helmrepo := include "common.helmrepository" . | quote -}}
-  {{- $reponame := default "helm-repo" .Values.appmgr.reponame | quote -}}
-  {{- $tiller := include "common.helmrepositorytiller" . | quote -}}
-  {{- $tillernamespace := include "common.helmrepositorytillernamespace" . | quote -}}
-  {{- $tillerport := include "common.helmrepositorytillerport" . | quote -}}
-  {{- (.Files.Glob "resources/xapp-manager.yaml").AsConfig | replace "__HELM_REPO__" $helmrepo | replace "__REST_PORT__" $restport | replace "__REPO_NAME__" $reponame | replace "__TILLER_SERVICE__" $tiller | replace "__TILLER_NAMESPACE__" $tillernamespace | replace "__TILLER_PORT__" $tillerport | nindent 2 }}
+  appmgr.yaml: |
+    {{- $restport := default ":8080" (printf ":%.0f" .Values.appmgr.containerPort) | quote -}}
+    {{- $helmrepo := include "common.helmrepository" . | quote -}}
+    {{- $reponame := default "helm-repo" .Values.appmgr.reponame | quote -}}
+    {{- $tiller := include "common.helmrepositorytiller" . | quote -}}
+    {{- $tillernamespace := include "common.helmrepositorytillernamespace" . | quote -}}
+    {{- $tillerport := include "common.helmrepositorytillerport" . | quote -}}
+    {{- (.Files.Glob "resources/appmgr.yaml").AsConfig | replace "__HELM_REPO__" $helmrepo | replace "__REST_PORT__" $restport | replace "__REPO_NAME__" $reponame | replace "__TILLER_SERVICE__" $tiller | replace "__TILLER_NAMESPACE__" $tillernamespace | replace "__TILLER_PORT__" $tillerport | nindent 2 }}
index 465f08c..5f6c8e7 100644 (file)
@@ -20,6 +20,5 @@ kind: ConfigMap
 metadata:
   name: {{ include "appmgr.fullname" . }}-appenv
 data:
-  {{- with .Values.appmgr.appenv }}
-    {{- toYaml . | nindent 2 }}
-  {{- end }}
+  {{- (.Files.Get "resources/appenv.yaml") | nindent 2 }}
+  
index b425365..b671152 100644 (file)
@@ -40,6 +40,10 @@ spec:
         release: {{ .Release.Name }}
     spec:
       hostname: {{ .Chart.Name }}
+      hostAliases:
+      - ip: "135.207.143.86"
+        hostnames:
+        - "helm.ricinfra.local"
       imagePullSecrets:
         - name: {{ include "common.repositoryCred" . }}
       containers:
@@ -52,7 +56,8 @@ spec:
               protocol: TCP
           volumeMounts:
             - name: config-volume
-              mountPath: {{ .Values.appmgr.appconfigpath }}
+              mountPath: {{ .Values.appmgr.appconfigpath }}/appmgr.yaml
+              subPath: appmgr.yaml
             - name: secret-volume
               mountPath: {{ .Values.appmgr.appsecretpath }}
             - name: cert-volume
index ffe2934..2bb470b 100644 (file)
 ################################################################################
 
 repository: "nexus3.o-ran-sc.org:10004"
+#repositoryOverride: "nexus3.o-ran-sc.org:10004"
 imagePullPolicy: IfNotPresent
 repositoryCred: docker-reg-cred
 
-
 # Helm Repo for xApp
 # By default a local helm repo is used. The global setting will override
 # the default value. You can further override using
 #helmRepositoryOverride: ""
-helmRepository: "snapshot.helm.local.ric.org
+helmRepository: "https://helm.ricinfra.local:31000
 
 # Default secret name for Helm Repo credential. .Value.golbal.helmRepositoryCred will
 # override the default value. You can further override uing
@@ -65,8 +65,8 @@ helmRepositoryTillerPort: "44134"
 appmgr:
   image:
     # xAppmanager Docker image name and tag
-    name: xapp-manager
-    tag: latest
+    name: ric-plt-appmgr
+    tag: 0.1.3
 
   # This section describes xAppManager
   replicaCount: 1
@@ -79,18 +79,13 @@ appmgr:
     port: 8080
     name: appmgr-service
     protocol: "TCP"
-    export: 30020
+    extport: 30020
 
 
   # config
   # Path referred in xapp-manager for retrieving configuration details
   appconfigpath: /opt/ric/config
 
-  # To be provided as env variables
-  appenv:
-    NAME: xappmgr
-    #ENV1: "envvalue1"
-    #ENV2: "envvalue2"
 
   # secret
   # Path referred in xapp-manager for retrieving helm repo secrets
index 30846dc..c662cf5 100644 (file)
 */}}
 {{- define "common.helmrepositorytillerport" -}}
   {{- if .Values.helmRepositoryTillerPortOverride -}}
-    {{- printf "%s" .Values.helmRepositoryTillerPortOverride -}}
+    {{- printf "%.0f" .Values.helmRepositoryTillerPortOverride -}}
   {{- else -}}
     {{- if  .Values.global -}}
       {{- if .Values.global.helmRepositoryTillerPort -}}
-        {{- printf "%s" .Values.global.helmRepositoryTillerPort -}}
+        {{- printf "%.0f" .Values.global.helmRepositoryTillerPort -}}
       {{- else -}}
-        {{- printf "%s" .Values.helmRepositoryTillerPort -}}
+        {{- printf "%.0f" .Values.helmRepositoryTillerPort -}}
       {{- end -}}
     {{- else -}}
-      {{- printf "%s" .Values.helmRepositoryTillerPort -}}
+      {{- printf "%.0f" .Values.helmRepositoryTillerPort -}}
     {{- end -}}
   {{- end -}}
 {{- end -}}
+
+{{/*
+Generate certificates for the helm repo
+*/}}
+{{- define "common.helmrepository.gen-certs" -}}
+{{- $altNames := list ( printf "helm.%s" .Values.ingress.hostpostfix ) -}}
+{{- $ca := genCA "helm-repository-ca" 365 -}}
+{{- $cert := genSignedCert ( include "nexus.name" . ) nil $altNames 365 $ca -}}
+tls.crt: {{ $cert.Cert | b64enc }}
+tls.key: {{ $cert.Key | b64enc }}
+{{- end -}}
+