From: rshacham Date: Wed, 3 Apr 2019 17:59:41 +0000 (+0000) Subject: adding ricplt directory as seed code X-Git-Tag: 0.0.2~109 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F22%2F1;p=it%2Fdep.git adding ricplt directory as seed code Change-Id: I69a91788be7cd028b009305fc71b534bbc0f44bb Signed-off-by: rshacham --- diff --git a/dep b/dep new file mode 160000 index 00000000..1a8a09de --- /dev/null +++ b/dep @@ -0,0 +1 @@ +Subproject commit 1a8a09deaeded3c6a50fa7c13594e46301375874 diff --git a/ricplt/README.md b/ricplt/README.md new file mode 100644 index 00000000..fa3f4368 --- /dev/null +++ b/ricplt/README.md @@ -0,0 +1,33 @@ +# RIC Platform Installation +### Directory Structure +- appmgr: xApp Manager Helm Chart +- common: Common Helm Chart +- dbaas: Database as a Service Helm Chart +- dist: local helm chart repo store +- e2mgr: E2 Termination Manager Helm Chart +- e2term: E2 Termination Helm Chart +- helm\_reset.sh: script for reseting local helm repo +- prepull.sh: scriptr for pre-pulling all RIC platform component docker images +- preric: Pre-RIC Helmn Chart (for setting infrastructure resources such as docker registry credential) +- ric: RIC Helm Chart +- ric\_env.sh: script for setting up various env varibles needed for RIC +- ric\_install.sh: RIC "one-click" installation script +- ric\_uninstall.sh: RIC uninstallation +- rtmgr: Routing Manager Helm Chart + +### To Install RIC Platform Deployment +```sh +$ # set environment variables +$ . ./ric_env.sh +$ # reset helm and local chart repo +$ ./helm_reset.sh +$ # install RIC platform +$ ./ric_install.sh +``` + +### To Unnstall RIC Platform Deployment +```sh +$ # uninstall RIC platform +$ ./ric_uninstall.sh +``` + diff --git a/ricplt/appmgr/.helmignore b/ricplt/appmgr/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/ricplt/appmgr/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ricplt/appmgr/Chart.yaml b/ricplt/appmgr/Chart.yaml new file mode 100644 index 00000000..f3e28a14 --- /dev/null +++ b/ricplt/appmgr/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: Helm Chart for xAppManager +name: appmgr +version: 0.0.1 diff --git a/ricplt/appmgr/charts/appmgr/Chart.yaml b/ricplt/appmgr/charts/appmgr/Chart.yaml new file mode 100644 index 00000000..f3e28a14 --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: Helm Chart for xAppManager +name: appmgr +version: 0.0.1 diff --git a/ricplt/appmgr/charts/appmgr/templates/_helpers.tpl b/ricplt/appmgr/charts/appmgr/templates/_helpers.tpl new file mode 100644 index 00000000..b65d7fa0 --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/templates/_helpers.tpl @@ -0,0 +1,50 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "appmgr.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "appmgr.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "appmgr.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + diff --git a/ricplt/appmgr/charts/appmgr/templates/appconfig.yaml b/ricplt/appmgr/charts/appmgr/templates/appconfig.yaml new file mode 100644 index 00000000..6cc1fda9 --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/templates/appconfig.yaml @@ -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. # +################################################################################ + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "appmgr.fullname" . }}-appconfig +data: + {{- with .Values.appconfig }} + {{- toYaml . | nindent 2 }} + {{- end }} + diff --git a/ricplt/appmgr/charts/appmgr/templates/appenv.yaml b/ricplt/appmgr/charts/appmgr/templates/appenv.yaml new file mode 100644 index 00000000..a414461b --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/templates/appenv.yaml @@ -0,0 +1,25 @@ +################################################################################ +# 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: v1 +kind: ConfigMap +metadata: + name: {{ include "appmgr.fullname" . }}-appenv +data: + {{- with .Values.appenv }} + {{- toYaml . | nindent 2 }} + {{- end }} diff --git a/ricplt/appmgr/charts/appmgr/templates/deployment.yaml b/ricplt/appmgr/charts/appmgr/templates/deployment.yaml new file mode 100644 index 00000000..ea189e68 --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/templates/deployment.yaml @@ -0,0 +1,112 @@ +################################################################################ +# 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 "appmgr.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + #app.kubernetes.io/name: {{ include "appmgr.name" . }} + #app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ include "common.namespace" . }}-{{ include "common.name" . }} + imagePullSecrets: + - name: {{ .Values.image.repositoryCred }} + hostAliases: + # create a DNS name entry in container's /etc/hosts for resolving helm chart repo hostnaem + - ip: "${__RUNRICENV_DOCKER_IP__}" + hostnames: + - "${__RUNRICENV_DOCKER_HOST__}" + - ip: "${__RUNRICENV_HELMREPO_IP__}" + hostnames: + - "${__RUNRICENV_HELMREPO_HOST__}" + containers: + - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.containerPort }} + protocol: TCP + volumeMounts: + - name: config-volume + mountPath: {{ .Values.appconfigpath }} + - name: secret-volume + mountPath: {{ .Values.appsecretpath }} + - name: cert-volume + mountPath: {{ .Values.appcertpath }} + envFrom: + - configMapRef: + name: {{ include "appmgr.fullname" . }}-appenv + livenessProbe: + #exec: + # command: + # - /bin/bash + # - -c + # - ps -ef | grep {{ .Values.livenessprocessname }}| grep -v "grep" + #initialDelaySeconds: 120 + #periodSeconds: 30 + readinessProbe: + # httpGet: + # path: / + # port: http + restartPolicy: Always + resources: + {{- toYaml .Values.resources | nindent 12 }} + securityContext: + # ubuntu + #runAsUser: 1000 + #allowPrivilegeEscalation: false + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + + volumes: + - name: config-volume + configMap: + name: {{ include "appmgr.fullname" . }}-appconfig + - name: secret-volume + secret: + secretName: {{ .Values.appsecretobject }} + - name: cert-volume + configMap: + name: {{ .Values.appcertobject }} diff --git a/ricplt/appmgr/charts/appmgr/templates/service.yaml b/ricplt/appmgr/charts/appmgr/templates/service.yaml new file mode 100644 index 00000000..53046282 --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/templates/service.yaml @@ -0,0 +1,38 @@ +################################################################################ +# 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: v1 +kind: Service +metadata: + name: {{ include "appmgr.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.appmgr.port }} + protocol: {{ .Values.service.appmgr.protocol }} + name: "{{ .Values.service.appmgr.name }}" + {{ if (eq .Values.service.type "NodePort") }}nodePort: {{ .Values.service.appmgr.extport }} {{ end }} + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + diff --git a/ricplt/appmgr/charts/appmgr/values.yaml b/ricplt/appmgr/charts/appmgr/values.yaml new file mode 100644 index 00000000..4428ef92 --- /dev/null +++ b/ricplt/appmgr/charts/appmgr/values.yaml @@ -0,0 +1,104 @@ +################################################################################ +# 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 a YAML-formatted file. +# Declare variables to be passed into your templates. + +# Modify this section to point to Docker image repository +image: + repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" + repositoryCred: "docker-reg-cred" + pullPolicy: IfNotPresent + + # xAppmanager Docker image name and tag + name: xapp-manager + tag: latest + +# This section describes xAppManager +replicaCount: 1 + +containerPort: 8080 + +service: + type: NodePort + appmgr: + port: 8080 + name: appmgr-service + protocol: "TCP" + export: 30020 + + +# config +# Path referred in xapp-manager for retrieving configuration details +appconfigpath: /opt/ric/config +appconfig: + # To be present as files under appconfigpath + # Use your own environment addresses + xapp-manager.yaml: | + "local": + # Port on which the xapp-manager REST services are provided + "host": ":8080" + "helm": + # Remote helm repo URL. UPDATE this as required. + "repo": "https://${__RUNRICENV_HELMREPO_HOST__}:${__RUNRICENV_HELMREPO_PORT__}" + + # Repo name referred within the xapp-manager + "repo-name": "helm-repo" + + # Tiller service details in the cluster. UPDATE this as required. + "tiller-service": "tiller-deploy" + "tiller-namespace": "kube-system" + "tiller-port": "44134" + +# To be provided as env variables +appenv: + NAME: xappmgr + #ENV1: "envvalue1" + #ENV2: "envvalue2" + +# secret +# Path referred in xapp-manager for retrieving helm repo secrets +appsecretpath: /opt/ric/secret + +# Secret object with credentials that should be created in K8S cluster. +# Parameters in this object are currently referred by xapp-manager to connect to helm repo and these are: +# helm_repo_username +# helm_repo_password +appsecretobject: xapp-mgr-creds + +# certificates +# Path referred in xapp-manager for retrieving helm repo client certificates +appcertpath: /opt/ric/certificates + +# configMap object in K8S cluster that holds the client side certificates to connect to helm repo. +# Currently all certificates mounted by this object are copied to /etc/ssl/certs +appcertobject: xapp-mgr-certs + +resources: {} +# limits: +# cpu: 100m +# memory: 128Mi +# requests: +# cpu: 100m +# memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} + diff --git a/ricplt/appmgr/requirements.yaml b/ricplt/appmgr/requirements.yaml new file mode 100644 index 00000000..f18ffcaa --- /dev/null +++ b/ricplt/appmgr/requirements.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: common + version: ~1.0.0 + repository: '@local' diff --git a/ricplt/appmgr/values.yaml b/ricplt/appmgr/values.yaml new file mode 100644 index 00000000..a2b7c0ef --- /dev/null +++ b/ricplt/appmgr/values.yaml @@ -0,0 +1,17 @@ +################################################################################ +# 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. # +################################################################################ + diff --git a/ricplt/common/Chart.yaml b/ricplt/common/Chart.yaml new file mode 100644 index 00000000..9963c884 --- /dev/null +++ b/ricplt/common/Chart.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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: v1 +description: Common templates for inclusion in other charts +name: common +version: 1.0.0 diff --git a/ricplt/common/templates/_name.tpl b/ricplt/common/templates/_name.tpl new file mode 100644 index 00000000..200e9c31 --- /dev/null +++ b/ricplt/common/templates/_name.tpl @@ -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. # +################################################################################ + +{{/* + Expand the name of a chart. +*/}} +{{- define "common.name" -}} + {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* + Create a default fully qualified application name. + Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "common.fullname" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ricplt/common/templates/_namespace.tpl b/ricplt/common/templates/_namespace.tpl new file mode 100644 index 00000000..a657432b --- /dev/null +++ b/ricplt/common/templates/_namespace.tpl @@ -0,0 +1,27 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* + Resolve the namespace to apply to a chart. The default namespace suffix + is the name of the chart. This can be overridden if necessary (eg. for subcharts) + using the following value: + + - .Values.nsPrefix : override namespace prefix +*/}} +{{- define "common.namespace" -}} + {{- default .Release.Namespace .Values.nsPrefix -}} +{{- end -}} diff --git a/ricplt/common/templates/_repository.tpl b/ricplt/common/templates/_repository.tpl new file mode 100644 index 00000000..a2f7e905 --- /dev/null +++ b/ricplt/common/templates/_repository.tpl @@ -0,0 +1,50 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* + Resolve the name of the common image repository. + The value for .Values.repository is used by default, + unless either override mechanism is used. + + - .Values.global.repository : override default image repository for all images + - .Values.repositoryOverride : override global and default image repository on a per image basis +*/}} +{{- define "common.repository" -}} + {{if .Values.repositoryOverride }} + {{- printf "%s" .Values.repositoryOverride -}} + {{else}} + {{- default .Values.repository .Values.global.repository -}} + {{end}} +{{- end -}} + + +{{/* + Resolve the image repository secret token. + The value for .Values.global.repositoryCred is used: + repositoryCred: + user: user + password: password + mail: email (optional) +*/}} +{{- define "common.repository.secret" -}} + {{- $repo := include "common.repository" . }} + {{- $repo := default "nexus3.onap.org:10001" $repo }} + {{- $cred := .Values.global.repositoryCred }} + {{- $mail := default "@" $cred.mail }} + {{- $auth := printf "%s:%s" $cred.user $cred.password | b64enc }} + {{- printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $cred.user $cred.password $mail $auth | b64enc -}} +{{- end -}} diff --git a/ricplt/common/templates/_resources.tpl b/ricplt/common/templates/_resources.tpl new file mode 100644 index 00000000..de0e736d --- /dev/null +++ b/ricplt/common/templates/_resources.tpl @@ -0,0 +1,61 @@ +################################################################################ +# 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. # +################################################################################ + + +{{- /* + Resolve the name of the common resource limit/request flavor. + The value for .Values.flavor is used by default, + unless either override mechanism is used. + + - .Values.global.flavor : override default flavor for all charts + - .Values.flavorOverride : override global and default flavor on a per chart basis +*/ -}} +{{- define "common.flavor" -}} + {{if .Values.flavorOverride }} + {{- printf "%s" .Values.flavorOverride -}} + {{else}} + {{- default .Values.flavor .Values.global.flavor -}} + {{end}} +{{- end -}} + +{{- /* + Resolve the resource limit/request flavor using the desired flavor value. + + - .Values.resources : YAML definition of resource limits. The flavor key + is computed based on the common.flavor template and + is used as the selected resource limit through the pluck + e.g: resources: + small: + limits: + cpu: 200m + memory: 4Gi + requests: + cpu: 100m + memory: 1Gi + large: + limits: + cpu: 400m + memory: 8Gi + requests: + cpu: 200m + memory: 2Gi + unlimited: {} +*/ -}} +{{- define "common.resources" -}} +{{- $flavor := include "common.flavor" . -}} +{{- toYaml (pluck $flavor .Values.resources | first) | indent 12 -}} +{{- end -}} diff --git a/ricplt/common/templates/_service.tpl b/ricplt/common/templates/_service.tpl new file mode 100644 index 00000000..5403effb --- /dev/null +++ b/ricplt/common/templates/_service.tpl @@ -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. # +################################################################################ + +{{/* + Resolve the name of a chart's service. + + The default will be the chart name (or .Values.nameOverride if set). + And the use of .Values.service.name overrides all. + + - .Values.service.name : override default service (ie. chart) name +*/}} +{{/* + Expand the service name for a chart. +*/}} +{{- define "common.servicename" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ricplt/common/values.yaml b/ricplt/common/values.yaml new file mode 100644 index 00000000..85432116 --- /dev/null +++ b/ricplt/common/values.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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 configuration default values that can be inherited by +# all subcharts. +################################################################# diff --git a/ricplt/dbaas/Chart.yaml b/ricplt/dbaas/Chart.yaml new file mode 100644 index 00000000..228bf8f0 --- /dev/null +++ b/ricplt/dbaas/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: DBaaS realized with standalone, non-persistent, non-redundant Redis +name: dbaas +version: 0.1.0 diff --git a/ricplt/dbaas/charts/dbaas/Chart.yaml b/ricplt/dbaas/charts/dbaas/Chart.yaml new file mode 100644 index 00000000..228bf8f0 --- /dev/null +++ b/ricplt/dbaas/charts/dbaas/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: DBaaS realized with standalone, non-persistent, non-redundant Redis +name: dbaas +version: 0.1.0 diff --git a/ricplt/dbaas/charts/dbaas/templates/_helper.tpl b/ricplt/dbaas/charts/dbaas/templates/_helper.tpl new file mode 100644 index 00000000..24c443dc --- /dev/null +++ b/ricplt/dbaas/charts/dbaas/templates/_helper.tpl @@ -0,0 +1,50 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "dbaas.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "dbaas.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "dbaas.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + diff --git a/ricplt/dbaas/charts/dbaas/templates/deployment.yaml b/ricplt/dbaas/charts/dbaas/templates/deployment.yaml new file mode 100644 index 00000000..9dd88de0 --- /dev/null +++ b/ricplt/dbaas/charts/dbaas/templates/deployment.yaml @@ -0,0 +1,49 @@ +################################################################################ +# 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 "dbaas.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.backend.replicas }} + selector: + matchLabels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + imagePullSecrets: + - name: {{ .Values.image.repositoryCred }} + terminationGracePeriodSeconds: {{ .Values.backend.terminationGracePeriodSeconds }} + containers: + - image: {{ .Values.image.repository }}/{{ .Values.backend.image.name }}:{{ .Values.backend.image.tag }} + imagePullPolicy: {{ .Values.backend.image.imagePullPolicy }} + ports: + - containerPort: {{ .Values.backend.targetPort }} + name: {{ .Values.backend.name }} + restartPolicy: Always diff --git a/ricplt/dbaas/charts/dbaas/templates/service.yaml b/ricplt/dbaas/charts/dbaas/templates/service.yaml new file mode 100644 index 00000000..6aa2bd9f --- /dev/null +++ b/ricplt/dbaas/charts/dbaas/templates/service.yaml @@ -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. # +################################################################################ + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "dbaas.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + ports: + - port: {{ .Values.backend.port }} + targetPort: {{ .Values.backend.targetPort }} diff --git a/ricplt/dbaas/charts/dbaas/values.yaml b/ricplt/dbaas/charts/dbaas/values.yaml new file mode 100644 index 00000000..b322d49a --- /dev/null +++ b/ricplt/dbaas/charts/dbaas/values.yaml @@ -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. # +################################################################################ + +image: + repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" + repositoryCred: docker-reg-cred + + +backend: + terminationGracePeriodSeconds: 0 + replicas: 1 + name: "redis-standalone" + port: 6379 + targetPort: 6379 + image: + name: redis-standalone + tag: latest + imagePullPolicy: IfNotPresent diff --git a/ricplt/dbaas/requirements.yaml b/ricplt/dbaas/requirements.yaml new file mode 100644 index 00000000..f18ffcaa --- /dev/null +++ b/ricplt/dbaas/requirements.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: common + version: ~1.0.0 + repository: '@local' diff --git a/ricplt/dbaas/values.yaml b/ricplt/dbaas/values.yaml new file mode 100644 index 00000000..a2b7c0ef --- /dev/null +++ b/ricplt/dbaas/values.yaml @@ -0,0 +1,17 @@ +################################################################################ +# 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. # +################################################################################ + diff --git a/ricplt/e2mgr/Chart.yaml b/ricplt/e2mgr/Chart.yaml new file mode 100644 index 00000000..26e79d46 --- /dev/null +++ b/ricplt/e2mgr/Chart.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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: v1 +description: O-RAN E2 Manager Helm charts +name: e2mgr +version: 1.0.0 diff --git a/ricplt/e2mgr/charts/e2mgr/.helmignore b/ricplt/e2mgr/charts/e2mgr/.helmignore new file mode 100644 index 00000000..ec17c386 --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/.helmignore @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. # +# # +# You may obtain a copy of the License at # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +############################################################################## + +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/ricplt/e2mgr/charts/e2mgr/Chart.yaml b/ricplt/e2mgr/charts/e2mgr/Chart.yaml new file mode 100644 index 00000000..30569402 --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +description: Oran e2mgr Helm charts +name: e2mgr +version: 1.0.0 diff --git a/ricplt/e2mgr/charts/e2mgr/templates/_helpers.tpl b/ricplt/e2mgr/charts/e2mgr/templates/_helpers.tpl new file mode 100644 index 00000000..567cb589 --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/templates/_helpers.tpl @@ -0,0 +1,49 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "e2mgr.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "e2mgr.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "e2mgr.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ricplt/e2mgr/charts/e2mgr/templates/configmap.yaml b/ricplt/e2mgr/charts/e2mgr/templates/configmap.yaml new file mode 100644 index 00000000..7ccc8a66 --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/templates/configmap.yaml @@ -0,0 +1,29 @@ +################################################################################ +# 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: v1 +kind: ConfigMap +metadata: + name: {{ include "e2mgr.fullname" . }}-router-configmap + namespace: {{ include "common.namespace" . }} +data: + router.txt: | + newrt|start + rte|1001|ric-full-e2term:38000 + rte|2002|{{ include "e2mgr.fullname" .}}:3801 + newrt|end diff --git a/ricplt/e2mgr/charts/e2mgr/templates/deployment.yaml b/ricplt/e2mgr/charts/e2mgr/templates/deployment.yaml new file mode 100644 index 00000000..2c07d26b --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/templates/deployment.yaml @@ -0,0 +1,66 @@ +################################################################################ +# 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 "e2mgr.fullname" .}} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ .Chart.Name }} + imagePullSecrets: + - name: {{ .Values.image.repositoryCred }} + containers: + - name: {{ include "common.namespace" . }}-{{ include "common.name" . }} + image: {{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} + volumeMounts: + - mountPath: /opt/E2Manager/router.txt + name: local-router-file + subPath: router.txt + env: + - name: RMR_RTG_SVC + value: "{{ .Values.env.RMR_RTG_SVC }}" + ports: + - name: {{ .Values.service.http.name }} + containerPort: {{ .Values.service.http.port }} + - name: {{ .Values.service.nano.name }} + containerPort: {{ .Values.service.nano.port }} + stdin: true + tty: true + securityContext: + privileged: true + volumes: + - name: local-router-file + configMap: + name: {{ include "e2mgr.fullname" . }}-router-configmap diff --git a/ricplt/e2mgr/charts/e2mgr/templates/service.yaml b/ricplt/e2mgr/charts/e2mgr/templates/service.yaml new file mode 100644 index 00000000..880e011d --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/templates/service.yaml @@ -0,0 +1,38 @@ +################################################################################ +# 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: v1 +kind: Service +metadata: + name: {{ include "e2mgr.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.http.port }} + protocol: TCP + targetPort: {{ .Values.service.http.port }} + name: "{{ .Values.service.http.name }}" + {{ if (eq .Values.service.type "NodePort") }}nodePort: {{ .Values.service.http.extport }} {{ end }} + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/ricplt/e2mgr/charts/e2mgr/values.yaml b/ricplt/e2mgr/charts/e2mgr/values.yaml new file mode 100644 index 00000000..830a5db8 --- /dev/null +++ b/ricplt/e2mgr/charts/e2mgr/values.yaml @@ -0,0 +1,48 @@ +################################################################################ +# 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. # +################################################################################ + +################################################################# +# Application configuration defaults. +################################################################# +# application image + +image: + repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" + repositoryCred: docker-reg-cred + name: e2mgr + tag: 1.0.0 + pullPolicy: IfNotPresent + + +replicaCount: 1 + +env: + RMR_RTG_SVC: "ric-full-rtmgr" + +service: + type: NodePort + http: + port: 3800 + target_port: 3800 + protocol: "TCP" + name: "http" + extport: 30004 + nano: + port: 3801 + target_port: 3801 + protocol: "TCP" + name: "nano" diff --git a/ricplt/e2mgr/requirements.yaml b/ricplt/e2mgr/requirements.yaml new file mode 100644 index 00000000..f18ffcaa --- /dev/null +++ b/ricplt/e2mgr/requirements.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: common + version: ~1.0.0 + repository: '@local' diff --git a/ricplt/e2mgr/values.yaml b/ricplt/e2mgr/values.yaml new file mode 100644 index 00000000..60054e76 --- /dev/null +++ b/ricplt/e2mgr/values.yaml @@ -0,0 +1,16 @@ +################################################################################ +# 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. # +################################################################################ diff --git a/ricplt/e2term/.helmignore b/ricplt/e2term/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/ricplt/e2term/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ricplt/e2term/Chart.yaml b/ricplt/e2term/Chart.yaml new file mode 100644 index 00000000..6f2477be --- /dev/null +++ b/ricplt/e2term/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: E2 Termination Helm Chart +name: e2term +version: 1.0.0 diff --git a/ricplt/e2term/charts/e2term/.helmignore b/ricplt/e2term/charts/e2term/.helmignore new file mode 100644 index 00000000..ec17c386 --- /dev/null +++ b/ricplt/e2term/charts/e2term/.helmignore @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. # +# # +# You may obtain a copy of the License at # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +############################################################################## + +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/ricplt/e2term/charts/e2term/Chart.yaml b/ricplt/e2term/charts/e2term/Chart.yaml new file mode 100644 index 00000000..72c044fb --- /dev/null +++ b/ricplt/e2term/charts/e2term/Chart.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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: v1 +description: O-RAN RIC E2 Termination Helm charts +name: e2term +version: 1.0.0 diff --git a/ricplt/e2term/charts/e2term/templates/_helpers.tpl b/ricplt/e2term/charts/e2term/templates/_helpers.tpl new file mode 100644 index 00000000..c1cd9509 --- /dev/null +++ b/ricplt/e2term/charts/e2term/templates/_helpers.tpl @@ -0,0 +1,48 @@ +################################################################################ +# 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. # +################################################################################ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "e2term.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "e2term.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "e2term.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/ricplt/e2term/charts/e2term/templates/configmap.yaml b/ricplt/e2term/charts/e2term/templates/configmap.yaml new file mode 100644 index 00000000..edd24ed7 --- /dev/null +++ b/ricplt/e2term/charts/e2term/templates/configmap.yaml @@ -0,0 +1,29 @@ +################################################################################ +# 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: v1 +kind: ConfigMap +metadata: + name: {{ include "e2term.fullname" . }}-router-configmap + namespace: {{ include "common.namespace" . }} +data: + router.txt: | + newrt|start + rte|1001|{{ include "e2term.fullname" . }}:38000 + rte|2002|ric-full-e2mgr:3801 + newrt|end diff --git a/ricplt/e2term/charts/e2term/templates/deployment.yaml b/ricplt/e2term/charts/e2term/templates/deployment.yaml new file mode 100644 index 00000000..e86f1b7a --- /dev/null +++ b/ricplt/e2term/charts/e2term/templates/deployment.yaml @@ -0,0 +1,70 @@ +################################################################################ +# 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 "e2term.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ .Chart.Name }} + imagePullSecrets: + - name: {{ .Values.image.repositoryCred }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} + volumeMounts: + - mountPath: /opt/e2/router.txt + name: local-router-file + subPath: router.txt + env: + - name: sctp + value: "5577" + - name: nano + value: "{{ .Values.service.nano.port }}" + - name: print + value: "{{ .Values.env.print }}" + - name: RMR_RTG_SVC + value: "{{ .Values.env.RMR_RTG_SVC }}" + ports: + - name: {{ .Values.service.nano.name }} + containerPort: {{ .Values.service.nano.port }} + stdin: true + tty: true + securityContext: + privileged: true + volumes: + - name: local-router-file + configMap: + name: {{ include "e2term.fullname" . }}-router-configmap diff --git a/ricplt/e2term/charts/e2term/templates/service.yaml b/ricplt/e2term/charts/e2term/templates/service.yaml new file mode 100644 index 00000000..f9d82740 --- /dev/null +++ b/ricplt/e2term/charts/e2term/templates/service.yaml @@ -0,0 +1,37 @@ +################################################################################ +# 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: v1 +kind: Service +metadata: + name: {{ include "e2term.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.nano.port }} + protocol: TCP + targetPort: {{ .Values.service.nano.target_port }} + name: {{ .Values.service.nano.name }} + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/ricplt/e2term/charts/e2term/values.yaml b/ricplt/e2term/charts/e2term/values.yaml new file mode 100644 index 00000000..88d33c83 --- /dev/null +++ b/ricplt/e2term/charts/e2term/values.yaml @@ -0,0 +1,44 @@ +################################################################################ +# 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. # +################################################################################ + +################################################################# +# Application configuration defaults. +################################################################# +# application image + +image: + repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" + repositoryCred: docker-reg-cred + name: e2 + tag: 1.0.0 + pullPolicy: IfNotPresent + + +replicaCount: 1 + +env: + print: "1" + RMR_RTG_SVC: "ric-full-rtmgr" + +service: + type: ClusterIP + nano: + port: 38000 + target_port: 38000 + protocol: "TCP" + name: "nano-port" + diff --git a/ricplt/e2term/requirements.yaml b/ricplt/e2term/requirements.yaml new file mode 100644 index 00000000..f18ffcaa --- /dev/null +++ b/ricplt/e2term/requirements.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: common + version: ~1.0.0 + repository: '@local' diff --git a/ricplt/e2term/values.yaml b/ricplt/e2term/values.yaml new file mode 100644 index 00000000..60054e76 --- /dev/null +++ b/ricplt/e2term/values.yaml @@ -0,0 +1,16 @@ +################################################################################ +# 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. # +################################################################################ diff --git a/ricplt/helm_reset.sh b/ricplt/helm_reset.sh new file mode 100755 index 00000000..c604c07f --- /dev/null +++ b/ricplt/helm_reset.sh @@ -0,0 +1,29 @@ +#!/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. # +################################################################################ + + +SERVEPID=$(ps aux |grep "helm[ +]serve" | sed 's/\s\s*/ /g' | cut -f2 -d ' ') +if [ ! -z $SERVEPID ]; then + echo "Stopping running helm serve process $SERVEPID" + kill -9 $SERVEPID +fi + +rm -rf ~/.helm +find . -name "common-*" | xargs rm +helm init --client-only diff --git a/ricplt/prepull.sh b/ricplt/prepull.sh new file mode 100755 index 00000000..0f3c7d0b --- /dev/null +++ b/ricplt/prepull.sh @@ -0,0 +1,29 @@ +#!/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. # +################################################################################ + +# usage: echo "{{YOUR_DOCKER_PASSWORD}}" | sh ./prepull.sh + +DOCKER_REGISTRY="${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" +IMAGE_LIST="xapp-manager:latest rtmgr:0.0.2 redis-standalone:latest e2mgr:1.0.0 e2:1.0.0" + +docker login -u ${__RUNRICENV_DOCKER_USER__} --password-stdin ${DOCKER_REGISTRY} +for IMAGE in ${IMAGE_LIST}; do + docker pull ${DOCKER_REGISTRY}/${IMAGE} +done + +docker logout ${DOCKER_REGISTRY} diff --git a/ricplt/preric/.helmignore b/ricplt/preric/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/ricplt/preric/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ricplt/preric/Chart.yaml b/ricplt/preric/Chart.yaml new file mode 100644 index 00000000..82c59cc3 --- /dev/null +++ b/ricplt/preric/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: A Helm chart for setting up k8s resources for accessing external and infrastructure resources before RIC deployment" +name: preric +version: 0.1.0 diff --git a/ricplt/preric/resources/helmrepo.crt b/ricplt/preric/resources/helmrepo.crt new file mode 100644 index 00000000..4ee7d62b --- /dev/null +++ b/ricplt/preric/resources/helmrepo.crt @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIESjCCAzKgAwIBAgIJAIU+AfULkw0PMA0GCSqGSIb3DQEBCwUAMIG5MQswCQYD +VQQGEwJVUzETMBEGA1UECAwKTmV3IEplcnNleTETMBEGA1UEBwwKQmVkbWluc3Rl +cjENMAsGA1UECgwEQVQmVDERMA8GA1UECwwIUmVzZWFyY2gxOTA3BgNVBAMMMCou +aGVsbS5yYW5jby1kZXYtdG9vbHMuZWFzdHVzLmNsb3VkYXBwLmF6dXJlLmNvbTEj +MCEGCSqGSIb3DQEJARYUcmljQHJlc2VhcmNoLmF0dC5jb20wHhcNMTkwMzIxMTU1 +MzAwWhcNMjEwMzIwMTU1MzAwWjCBuTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCk5l +dyBKZXJzZXkxEzARBgNVBAcMCkJlZG1pbnN0ZXIxDTALBgNVBAoMBEFUJlQxETAP +BgNVBAsMCFJlc2VhcmNoMTkwNwYDVQQDDDAqLmhlbG0ucmFuY28tZGV2LXRvb2xz +LmVhc3R1cy5jbG91ZGFwcC5henVyZS5jb20xIzAhBgkqhkiG9w0BCQEWFHJpY0By +ZXNlYXJjaC5hdHQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +tguhSQx5Dk2w+qx2AOcFRz7IZBASEehK1Z4f5jz2KrRylGx6jjedCZASdm1b0ZEB +/ZNrKht1zsWDETa7x0DF+q0Z2blff+T+6+YrJWhNxYHgZiYVi9gTuNDzpn8VVn7f ++cQxcMguHo1JBDIotOLubJ4T3/oXMCPv9kRSLHcNjbEE2yTB3AqXu9dvrDXuUdeU +ot6RzxhKXxRCQXPS2/FDjSV9vr9h1dv5fIkFXihpYaag0XqvXcqgncvcOJ1SsLc3 +DK+tyNknqG5SL8y2a7U4F7u+qGO2/3tnCO0ggYwa73hS0pQPY51EpRSckZqlfKEu +Ut0s3wlEFP1VaU0RfU3aIwIDAQABo1MwUTAdBgNVHQ4EFgQUYTpoVXZPXSR/rhjr +pu9PPhL7f9IwHwYDVR0jBBgwFoAUYTpoVXZPXSR/rhjrpu9PPhL7f9IwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAUDLbiKVIW6W9qFXLtoyO7S2e +IOUSZ1F70pkfeYUqegsfFZ9njPtPqTzDfJVxYqH2V0vxxoAxXCYCpNyR6vYlYiEL +R+oyxuvauW/yCoiwKBPYa4fD/PBajJnEO1EfIwZvjFLIfw4GjaX59+zDS3Zl0jT/ +w3uhPSsJAYXtDKLZ14btA27cM5mW4kmxVD8CRdUW0jr/cN3Hqe9uLSNWCNiDwma7 +RnpK7NnOgXHyhZD/nVC0nY7OzbK7VHFJatSOjyuMxgWsFGahwYNxf3AWfPwUai0K +ne/fVFGZ6ifR9QdD0SuKIAEuqSyyP4BsQ92uEweU/gWKsnM6iNVmNFX8UOuU9A== +-----END CERTIFICATE----- diff --git a/ricplt/preric/templates/_helper.tpl b/ricplt/preric/templates/_helper.tpl new file mode 100644 index 00000000..cba7024f --- /dev/null +++ b/ricplt/preric/templates/_helper.tpl @@ -0,0 +1,86 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "ricapp.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "ricapp.fullname" -}} +{{- if .Values.ricapp.fullnameOverride -}} +{{- .Values.ricapp.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.ricapp.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "ricapp.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "repository" -}} + {{if .Values.repositoryOverride }} + {{- printf "%s" .Values.repositoryOverride -}} + {{else}} + {{- default .Values.repository .Values.global.repository -}} + {{end}} +{{- end -}} + +{{/* + Resolve the image repository secret token. + The value for .Values.global.repositoryCred is used: + repositoryCred: + user: user + password: password + mail: email (optional) +*/}} +{{- define "repository.secret" -}} + {{- $repo := include "repository" . }} + {{- $repo := default "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" $repo }} + {{- $cred := .Values.global.repositoryCred }} + {{- $mail := default "@" $cred.mail }} + {{- $auth := printf "%s:%s" $cred.user $cred.password | b64enc }} + {{- printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $cred.user $cred.password $mail $auth | b64enc -}} +{{- end -}} + + +{{- define "helmrepo.secret.user" -}} + {{- $user := default "${__RUNRICENV_HELMREPO_USER__}" .Values.global.helmrepoCred.user -}} + {{- printf "%s" $user |b64enc }} +{{- end -}} + + +{{- define "helmrepo.secret.password" -}} + {{- $pass := default "${__RUNRICENV_HELMREPO_PASS__}" .Values.global.helmrepoCred.password -}} + {{- printf "%s" $pass |b64enc }} +{{- end -}} diff --git a/ricplt/preric/templates/config-helm-cert.yaml b/ricplt/preric/templates/config-helm-cert.yaml new file mode 100644 index 00000000..e293cd6a --- /dev/null +++ b/ricplt/preric/templates/config-helm-cert.yaml @@ -0,0 +1,23 @@ +################################################################################ +# 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: v1 +kind: ConfigMap +metadata: + name: xapp-mgr-certs +data: + {{ (.Files.Glob "resources/helmrepo.crt").AsConfig | nindent 2 }} diff --git a/ricplt/preric/templates/secrets-docker-reg.yaml b/ricplt/preric/templates/secrets-docker-reg.yaml new file mode 100644 index 00000000..83866e57 --- /dev/null +++ b/ricplt/preric/templates/secrets-docker-reg.yaml @@ -0,0 +1,23 @@ +################################################################################ +# 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: v1 +kind: Secret +metadata: + name: docker-reg-cred +data: + .dockercfg: {{ include "repository.secret" . }} +type: kubernetes.io/dockercfg diff --git a/ricplt/preric/templates/secrets-helm-xapp.yaml b/ricplt/preric/templates/secrets-helm-xapp.yaml new file mode 100644 index 00000000..24b226d1 --- /dev/null +++ b/ricplt/preric/templates/secrets-helm-xapp.yaml @@ -0,0 +1,25 @@ +################################################################################ +# 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: v1 +kind: Secret +metadata: + name: xapp-mgr-creds +type: Opaque +data: + helm_repo_username: {{ include "helmrepo.secret.user" . }} + helm_repo_password: {{ include "helmrepo.secret.password" . }} diff --git a/ricplt/preric/values.yaml b/ricplt/preric/values.yaml new file mode 100644 index 00000000..f5b77627 --- /dev/null +++ b/ricplt/preric/values.yaml @@ -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. # +################################################################################ + +# Values for setting up Kubernetes resources for accessing infrastructure such as docker registry +# helm repo, etc. + + +global: + repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" + repositoryCred: + user: "${__RUNRICENV_DOCKER_USER__}" + password: "${__RUNRICENV_DOCKER_PASS__}" + + + helmrepo: "https://${__RUNRICENV_HELMREPO_HOST__}:${__RUNRICENV_HELMREPO_PORT__}" + helmrepoCred: + user: "${__RUNRICENV_HELMREPO_USER__}" + password: "${__RUNRICENV_HELMREPO_PASS__}" + helmrepoCert: + diff --git a/ricplt/ric/.helmignore b/ricplt/ric/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/ricplt/ric/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ricplt/ric/Chart.yaml b/ricplt/ric/Chart.yaml new file mode 100644 index 00000000..12b7df9e --- /dev/null +++ b/ricplt/ric/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: A Helm chart for full RIC deployment +name: ric +version: 0.1.0 diff --git a/ricplt/ric/requirements.yaml b/ricplt/ric/requirements.yaml new file mode 100644 index 00000000..84ceec62 --- /dev/null +++ b/ricplt/ric/requirements.yaml @@ -0,0 +1,38 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: e2mgr + version: 1.0.0 + repository: '@local' + condition: e2mgr.enabled + - name: rtmgr + version: 0.1.0 + repository: '@local' + condition: rtmgr.enabled + - name: e2term + version: 1.0.0 + repository: '@local' + condition: e2term.enabled + - name: appmgr + version: 0.0.1 + repository: '@local' + condition: appmgr.enabled + - name: dbaas + version: 0.1.0 + repository: '@local' + condition: dbaas.enabled diff --git a/ricplt/ric/values.yaml b/ricplt/ric/values.yaml new file mode 100644 index 00000000..aefe36f6 --- /dev/null +++ b/ricplt/ric/values.yaml @@ -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. # +################################################################################ + +# Enable/disable helm charts for RIC deployment +dbaas: + enabled: true +e2mgr: + enabled: true + e2mgr: + service: + http: + extport: 30080 +rtmgr: + enabled: true +e2term: + enabled: true +appmgr: + enabled: true + appmgr: + service: + appmgr: + extport: 30070 diff --git a/ricplt/ric_env.sh b/ricplt/ric_env.sh new file mode 100644 index 00000000..9dc70aba --- /dev/null +++ b/ricplt/ric_env.sh @@ -0,0 +1,25 @@ +#!/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. # +################################################################################ + + +export RICPLT_RELEASE_NAME='ric-full' +export RICPLT_NAMESPACE='ricplatform' +export RICXAPP_NAMESPACE='ricxapp' +export RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term" +export RICPLT_APPMGR_EXT_PORT="30099" +export RICPLT_E2MGR_EXT_PORT="30199" diff --git a/ricplt/ric_install.sh b/ricplt/ric_install.sh new file mode 100755 index 00000000..863d30d7 --- /dev/null +++ b/ricplt/ric_install.sh @@ -0,0 +1,68 @@ +#!/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 [ -z "$RICPLT_RELEASE_NAME" ] || \ + [ -z "$RICPLT_COMPONENTS" ] || \ + [ -z "$RICPLT_NAMESPACE" ] || \ + [ -z "$RICPLT_APPMGR_EXT_PORT" ] || \ + [ -z "$RICPLT_E2MGR_EXT_PORT" ]; then + echo "RICPLT_RELEASE_NAME or RICPLT_COMPONENTS or RICPLT_NAMESPACE or " + echo "RICPLT_APPMGR_EXT_PORT or RICPLT_E2MGR_EXT_PORT unset, loading " + echo "values from ric_env.sh" + . ./ric_env.sh +fi + + +RICPLT_DEPLOYMENT="$RICPLT_RELEASE_NAME" +echo "Deplot RIC Platform components [$RICPLT_COMPONENTS] to" +echo "name space: $RICPLT_NAMESPACE, Helm release: $RICPLT_DEPLOYMENT" + + +rm -rf dist +mkdir -p dist/packages + +helm serve --repo-path dist/packages & + +sleep 1 + +helm repo add local http://127.0.0.1:8879 + +helm repo update +helm package -d dist/packages common +helm repo index dist/packages + + +for c in common preric $RICPLT_COMPONENTS ric; do + echo "Preparing chart for comonent $c" + helm repo update + if [ -e "$c/requirements.yaml" ]; then + helm dep up "$c" + fi + helm package -d dist/packages "$c" + helm repo index dist/packages + echo +done + +helm repo update +helm install local/preric --namespace "${RICPLT_NAMESPACE}" --name pre-"${RICPLT_RELEASE_NAME}" + +helm repo update +helm install local/ric --namespace "${RICPLT_NAMESPACE}" --name "${RICPLT_RELEASE_NAME}" --set appmgr.appmgr.service.appmgr.extport="${RICPLT_APPMGR_EXT_PORT}" --set e2mgr.e2mgr.service.http.extport="${RICPLT_E2MGR_EXT_PORT}" + + diff --git a/ricplt/ric_uninstall.sh b/ricplt/ric_uninstall.sh new file mode 100755 index 00000000..4b7ac42f --- /dev/null +++ b/ricplt/ric_uninstall.sh @@ -0,0 +1,52 @@ +#!/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 [ -z "$RICPLT_RELEASE_NAME" ] || [ -z "$RICPLT_COMPONENTS" ] || [ -z "$RICPLT_NAMESPACE" ]; then + echo "RICPLT_RELEASE_NAME or RICPLT_COMPONENTS or RICPLT_NAMESPACE unset, loading from ric_env.sh" + . ./ric_env.sh +fi + +RICPLT_DEPLOYMENT="$RICPLT_RELEASE_NAME" + +echo "Uninstall RIC Platform components $RICPLT_COMPONENTS" +echo "name space: $RICPLT_NAMESPACE, Helm release: $RICPLT_DEPLOYMENT" + +echo "Removing Helm deploymentsi ..." +helm delete --purge "${RICPLT_RELEASE_NAME}" +helm delete --purge pre-"${RICPLT_RELEASE_NAME}" +find . -name "common-*" | xargs rm +rm -rf ./ric/charts/* +echo "Done" + +#echo "Removing RIC resources from Kubernetes ..." +#RES=$(kubectl get pods -n "$RICPLT_NAMESPACE" |grep -v "tiller" |grep -v "RESTARTS" |grep -v "robot") +#while [ ! -z "$RES" ]; do +# NUMPODS=$(echo "$RES" | wc -l) +# echo "$(( NUMPODS - 1 )) pod(s) left, check again in 5 seconds ..." +# sleep 5 +# RES=$(kubectl get pods -n "$RICPLT_NAMESPACE" |grep -v "tiller" |grep -v "RESTARTS" |grep -v "robot") +#done +#echo "All RIC resources are gone." +#./helm_reset.sh + +echo "It may take Kubernetes some time to release all resources created" +echo "for RIC Platform. Use \"kubectl get pods -n ricplatform\" to check." +echo "To truely clean up the helm state, run the following command:" +echo " ./helm_reset.sh" +echo "Done" diff --git a/ricplt/rtmgr/.helmignore b/ricplt/rtmgr/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/ricplt/rtmgr/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/ricplt/rtmgr/Chart.yaml b/ricplt/rtmgr/Chart.yaml new file mode 100644 index 00000000..70ed31ce --- /dev/null +++ b/ricplt/rtmgr/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: Helm chart for RIC Routing Manager +name: rtmgr +version: 0.1.0 diff --git a/ricplt/rtmgr/charts/rtmgr/Chart.yaml b/ricplt/rtmgr/charts/rtmgr/Chart.yaml new file mode 100644 index 00000000..70ed31ce --- /dev/null +++ b/ricplt/rtmgr/charts/rtmgr/Chart.yaml @@ -0,0 +1,22 @@ +################################################################################ +# 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: v1 +appVersion: "1.0" +description: Helm chart for RIC Routing Manager +name: rtmgr +version: 0.1.0 diff --git a/ricplt/rtmgr/charts/rtmgr/templates/_helper.tpl b/ricplt/rtmgr/charts/rtmgr/templates/_helper.tpl new file mode 100644 index 00000000..46334378 --- /dev/null +++ b/ricplt/rtmgr/charts/rtmgr/templates/_helper.tpl @@ -0,0 +1,50 @@ +################################################################################ +# 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. # +################################################################################ + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "rtmgr.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "rtmgr.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "rtmgr.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + diff --git a/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-dep.yaml b/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-dep.yaml new file mode 100644 index 00000000..514972a1 --- /dev/null +++ b/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-dep.yaml @@ -0,0 +1,65 @@ +################################################################################ +# 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 "rtmgr.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + hostname: {{ .Chart.Name }} + imagePullSecrets: + - name: {{ .Values.image.repositoryCred }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} + command: ["/run_rtmgr.sh"] + env: + - name: XMURL + value: "http://ric-full-appmgr:8080/ric/v1/xapps" + - name: SOCKET + value: "tcp://0.0.0.0:4560" + - name: RTFILE + value: "/db/rt.json" + - name: NBI + value: "httpGetter" + - name: SBI + value: "nngpub" + - name: RPE + value: "rmr" + - name: SDL + value: "file" + ports: + - name: {{ .Values.service.nano.name }} + containerPort: {{ .Values.service.nano.port }} diff --git a/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-svc.yaml b/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-svc.yaml new file mode 100644 index 00000000..fb761112 --- /dev/null +++ b/ricplt/rtmgr/charts/rtmgr/templates/rtmgr-svc.yaml @@ -0,0 +1,37 @@ +################################################################################ +# 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: v1 +kind: Service +metadata: + name: {{ include "rtmgr.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.nano.port }} + protocol: TCP + targetPort: {{ .Values.service.nano.target_port }} + name: {{ .Values.service.nano.name }} + selector: + app: {{ include "common.namespace" . }}-{{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/ricplt/rtmgr/charts/rtmgr/values.yaml b/ricplt/rtmgr/charts/rtmgr/values.yaml new file mode 100644 index 00000000..8ce64ea7 --- /dev/null +++ b/ricplt/rtmgr/charts/rtmgr/values.yaml @@ -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. # +################################################################################ + +# Default values for rtmgr. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +image: + repository: "${__RUNRICENV_DOCKER_HOST__}:${__RUNRICENV_DOCKER_PORT__}" + repositoryCred: docker-reg-cred + name: rtmgr + tag: 0.0.2 + pullPolicy: IfNotPresent + +service: + type: ClusterIP + nano: + port: 5656 + target_port: 4560 + protocol: "TCP" + name: "nano-port" + diff --git a/ricplt/rtmgr/requirements.yaml b/ricplt/rtmgr/requirements.yaml new file mode 100644 index 00000000..f18ffcaa --- /dev/null +++ b/ricplt/rtmgr/requirements.yaml @@ -0,0 +1,21 @@ +################################################################################ +# 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. # +################################################################################ + +dependencies: + - name: common + version: ~1.0.0 + repository: '@local' diff --git a/ricplt/rtmgr/values.yaml b/ricplt/rtmgr/values.yaml new file mode 100644 index 00000000..60054e76 --- /dev/null +++ b/ricplt/rtmgr/values.yaml @@ -0,0 +1,16 @@ +################################################################################ +# 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. # +################################################################################