From 9b70621587f6add44e73dea8b08aa7d45dcf2a99 Mon Sep 17 00:00:00 2001 From: "Arrobo, Gabriel" Date: Fri, 29 Sep 2023 18:06:59 -0700 Subject: [PATCH] Helm charts for RSM-5G --- onos-rsm-5g/.helmignore | 26 ++++++ onos-rsm-5g/Chart.yaml | 20 +++++ onos-rsm-5g/README.md | 10 +++ onos-rsm-5g/files/certs/README.md | 26 ++++++ onos-rsm-5g/files/certs/tls.cacrt | 21 +++++ onos-rsm-5g/files/certs/tls.crt | 21 +++++ onos-rsm-5g/files/certs/tls.key | 28 ++++++ onos-rsm-5g/templates/_helpers.tpl | 73 +++++++++++++++ onos-rsm-5g/templates/configmap.yaml | 20 +++++ onos-rsm-5g/templates/deployment.yaml | 122 ++++++++++++++++++++++++++ onos-rsm-5g/templates/secret.yaml | 18 ++++ onos-rsm-5g/templates/service.yaml | 59 +++++++++++++ onos-rsm-5g/values.yaml | 77 ++++++++++++++++ 13 files changed, 521 insertions(+) create mode 100644 onos-rsm-5g/.helmignore create mode 100644 onos-rsm-5g/Chart.yaml create mode 100644 onos-rsm-5g/README.md create mode 100644 onos-rsm-5g/files/certs/README.md create mode 100644 onos-rsm-5g/files/certs/tls.cacrt create mode 100644 onos-rsm-5g/files/certs/tls.crt create mode 100644 onos-rsm-5g/files/certs/tls.key create mode 100644 onos-rsm-5g/templates/_helpers.tpl create mode 100644 onos-rsm-5g/templates/configmap.yaml create mode 100644 onos-rsm-5g/templates/deployment.yaml create mode 100644 onos-rsm-5g/templates/secret.yaml create mode 100644 onos-rsm-5g/templates/service.yaml create mode 100644 onos-rsm-5g/values.yaml diff --git a/onos-rsm-5g/.helmignore b/onos-rsm-5g/.helmignore new file mode 100644 index 00000000..8d6310d7 --- /dev/null +++ b/onos-rsm-5g/.helmignore @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# 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/onos-rsm-5g/Chart.yaml b/onos-rsm-5g/Chart.yaml new file mode 100644 index 00000000..add2ccbc --- /dev/null +++ b/onos-rsm-5g/Chart.yaml @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v2 +name: onos-rsm +description: ONOS RSM 5G xAPP +kubeVersion: ">=1.17.0" +type: application +version: 0.0.1 +appVersion: v0.0.1 +keywords: + - onos + - sdn + - ric + - 5g +home: https://onosproject.org +maintainers: + - name: ONOS Support + email: support@opennetworking.org diff --git a/onos-rsm-5g/README.md b/onos-rsm-5g/README.md new file mode 100644 index 00000000..20b33795 --- /dev/null +++ b/onos-rsm-5g/README.md @@ -0,0 +1,10 @@ + + +## ONOS RSM 5G + +Provides a [Helm] chart for deploying µONOS RSM 5G xApp on [Kubernetes]. +See the [documentation](https://docs.onosproject.org/onos-ran/docs/deployment/) for more info. diff --git a/onos-rsm-5g/files/certs/README.md b/onos-rsm-5g/files/certs/README.md new file mode 100644 index 00000000..3b2e2c12 --- /dev/null +++ b/onos-rsm-5g/files/certs/README.md @@ -0,0 +1,26 @@ + + +This folder contains self-signed certificates for use in testing. _DO NOT USE THESE +CERTIFICATES IN PRODUCTION!_ + +The certificates were generated with the +https://github.com/onosproject/simulators/blob/master/pkg/certs/generate_certs.sh +script as +```bash +generate-certs.sh onos-e2t.opennetworking.org +``` + +In this folder they **must** be (re)named +* tls.cacrt +* tls.crt +* tls.key + +Use +```bash +openssl x509 -in deployments/helm/onos-e2t/files/certs/tls.crt -text -noout +``` +to verify the contents (especially the subject). diff --git a/onos-rsm-5g/files/certs/tls.cacrt b/onos-rsm-5g/files/certs/tls.cacrt new file mode 100644 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070hJXXzJh3eJpLl9dlUbMKzaoAh2bZx6y3ZJIZFs/zrpGfg4lvBAvfO/59i +mxJ9bQBSN3U2Hwp6ioOQzP0LpllfXtx9N5LanWpB0cu/HN9vAgtp3kRTBZD0M1XI +Ctit8bXV7Mz+1iGqoyUhfCYcCSjuWTgAxzir+hrdn7uO67Hv4ndCoSj4SQaGka3W +eEfVeA== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/onos-rsm-5g/files/certs/tls.crt b/onos-rsm-5g/files/certs/tls.crt new file mode 100644 index 00000000..c54a12fe --- /dev/null +++ b/onos-rsm-5g/files/certs/tls.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDcTCCAlkCFErBGzsXHo1l8bmZRmDkF+h2bsdVMA0GCSqGSIb3DQEBCwUAMHIx +CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJTWVubG9QYXJrMQww +CgYDVQQKDANPTkYxFDASBgNVBAsMC0VuZ2luZWVyaW5nMR4wHAYDVQQDDBVjYS5v +cGVubmV0d29ya2luZy5vcmcwHhcNMjAwOTAxMDYwNTI2WhcNMzAwODMwMDYwNTI2 +WjB4MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCU1lbmxvUGFy +azEMMAoGA1UECgwDT05GMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEkMCIGA1UEAwwb +b25vcy1lMnQub3Blbm5ldHdvcmtpbmcub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuNm6b+CvdyNUDUhqU8VNuldAVJtvtXInm7+WCCjpXJtYBw+2 +Amsa1S20Y5h6HnHIxXEsmB8wehQ9jl03CU8Z3YgXI7MJNjFEAHS7AKNfKz7SS92x +oA46wukV3njmN4xk/JZfFrbaUJ4HcE5PVi5dJyyQxg6mPcpdbiYHQ4+uDN4cKU8m +CRWdj4gNUaC+m8+qHqt3V3Vfa8iBMdpskTwT+1jBQcDGt+Ay2iinCAmf5m0pgEka +VghtXIKLUjG/a17FAkgy/sTWJ7J4waD0iRQsEBeQ+4r2MCIttLRk/mTTdBLOkGUi +unzjeh+1EiFslNUwXxu0qfhhJB3KNfwe0bF+LQIDAQABMA0GCSqGSIb3DQEBCwUA +A4IBAQCAron90Id5rzqn73M7FcCN9pFtu1MZ/WYNBxPmrcRc/yZ80PecZoHgTnJh +mBDTLwpoRLPimxTL4OzrnA6Go0kD/CPAThehGb8BBZ+aiSJ17I0/EL1HDmXStgRk +WuqP2DxenckWHaNmPVE0PbB6BCsd5HP0tCC4vGBbGYbJmAhhjzhzEmEypqskt+Np +eFe1DgDyfVrroIHmDLPCEu2ny9Syr/LslDmndGses8/QSVDDyAK/LFFMukCJRWsQ +uIUJM/aDEAqbZUs4bb60hVfcZTU1HVPcp2xuOmVUFKUvHyCpt/n65Y/5XKQYQpTr +1qa1krCQOnuwSstIpqBCnX+TecP7 +-----END CERTIFICATE----- diff --git a/onos-rsm-5g/files/certs/tls.key b/onos-rsm-5g/files/certs/tls.key new file mode 100644 index 00000000..ce12d977 --- /dev/null +++ b/onos-rsm-5g/files/certs/tls.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC42bpv4K93I1QN +SGpTxU26V0BUm2+1ciebv5YIKOlcm1gHD7YCaxrVLbRjmHoeccjFcSyYHzB6FD2O +XTcJTxndiBcjswk2MUQAdLsAo18rPtJL3bGgDjrC6RXeeOY3jGT8ll8WttpQngdw +Tk9WLl0nLJDGDqY9yl1uJgdDj64M3hwpTyYJFZ2PiA1RoL6bz6oeq3dXdV9ryIEx +2myRPBP7WMFBwMa34DLaKKcICZ/mbSmASRpWCG1cgotSMb9rXsUCSDL+xNYnsnjB +oPSJFCwQF5D7ivYwIi20tGT+ZNN0Es6QZSK6fON6H7USIWyU1TBfG7Sp+GEkHco1 +/B7RsX4tAgMBAAECggEBAIvky0Hs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k+xQQYneI1+uvi +d8NpUcLRilayIKQkaZFA+efXpyPOq8r0WtAh8tpTA3NFXunMiejJUF1wkzL4+NLt +3ct4RY4eHoPQHtxOqZn7aMx+8/V4yz6IDKEsAsxK1p7AP6yt6GEWzj8OvrP7cm4Z +NVQirzdY6fbkOULBISdVSWk= +-----END PRIVATE KEY----- diff --git a/onos-rsm-5g/templates/_helpers.tpl b/onos-rsm-5g/templates/_helpers.tpl new file mode 100644 index 00000000..b7270263 --- /dev/null +++ b/onos-rsm-5g/templates/_helpers.tpl @@ -0,0 +1,73 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "onos-rsm-5g.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 "onos-rsm-5g.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 "onos-rsm-5g.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "onos-rsm-5g.labels" -}} +helm.sh/chart: {{ include "onos-rsm-5g.chart" . }} +{{ include "onos-rsm-5g.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "onos-rsm-5g.selectorLabels" -}} +app.kubernetes.io/name: {{ include "onos-rsm-5g.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +onos-rsm-5g image name +*/}} +{{- define "onos-rsm-5g.imagename" -}} +{{- if .Values.global.image.registry -}} +{{- printf "%s/" .Values.global.image.registry -}} +{{- else if .Values.image.registry -}} +{{- printf "%s/" .Values.image.registry -}} +{{- end -}} +{{- printf "%s:" .Values.image.repository -}} +{{- if .Values.global.image.tag -}} +{{- .Values.global.image.tag -}} +{{- else -}} +{{- tpl .Values.image.tag . -}} +{{- end -}} +{{- end -}} diff --git a/onos-rsm-5g/templates/configmap.yaml b/onos-rsm-5g/templates/configmap.yaml new file mode 100644 index 00000000..f8bb0ad9 --- /dev/null +++ b/onos-rsm-5g/templates/configmap.yaml @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "onos-rsm-5g.fullname" . }}-config + labels: + app: {{ template "onos-rsm-5g.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + logging.yaml: |- +{{- if .Values.logging }} +{{ toYaml .Values.logging | indent 4 }} +{{- end}} + config.json: |- +{{ .Values.config.rsm.config_json | toPrettyJson | indent 4 }} diff --git a/onos-rsm-5g/templates/deployment.yaml b/onos-rsm-5g/templates/deployment.yaml new file mode 100644 index 00000000..3ad52807 --- /dev/null +++ b/onos-rsm-5g/templates/deployment.yaml @@ -0,0 +1,122 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "onos-rsm-5g.fullname" . }} + labels: + {{- include "onos-rsm-5g.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + name: {{ template "onos-rsm-5g.fullname" . }} + app: onos + type: rsm + resource: {{ template "onos-rsm-5g.fullname" . }} + {{- include "onos-rsm-5g.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + proxy.onosproject.org/inject: "true" + labels: + name: {{ template "onos-rsm-5g.fullname" . }} + app: onos + type: rsm + resource: {{ template "onos-rsm-5g.fullname" . }} + {{- include "onos-rsm-5g.selectorLabels" . | nindent 8 }} + spec: + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: {{ include "onos-rsm-5g.imagename" . | quote }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - "-caPath=/etc/onos/certs/tls.cacrt" + - "-keyPath=/etc/onos/certs/tls.key" + - "-certPath=/etc/onos/certs/tls.crt" + - "-e2tEndpoint={{ .Values.config.rsm.e2tEndpoint }}" + ports: + - name: grpc + containerPort: {{ .Values.service.grpc.port }} + - name: gnmi + containerPort: {{ .Values.service.gnmi.port}} + startupProbe: + tcpSocket: + port: 5150 + periodSeconds: 5 + failureThreshold: 60 + readinessProbe: + tcpSocket: + port: 5150 + initialDelaySeconds: 10 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: 5150 + initialDelaySeconds: 10 + periodSeconds: 10 + volumeMounts: + - name: secret + mountPath: /etc/onos/certs + readOnly: true + - name: config + mountPath: /etc/onos/config + readOnly: true + env: + # *_NAMESPACE and *_NAME environment variables are recognized by onos-lib-go utilities. + # These variables should always be defined. + - name: POD_ID + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: SERVICE_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: SERVICE_NAME + value: {{ template "onos-rsm-5g.fullname" . }} + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: secret + secret: + secretName: {{ template "onos-rsm-5g.fullname" . }}-secret + - name: config + configMap: + name: {{ template "onos-rsm-5g.fullname" . }}-config + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/onos-rsm-5g/templates/secret.yaml b/onos-rsm-5g/templates/secret.yaml new file mode 100644 index 00000000..89b90a26 --- /dev/null +++ b/onos-rsm-5g/templates/secret.yaml @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "onos-rsm-5g.fullname" . }}-secret + labels: + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + {{ $root := . }} + {{ range $path, $bytes := .Files.Glob "files/certs/tls.*" }} + {{ base $path }}: '{{ $root.Files.Get $path | b64enc }}' + {{ end }} +type: Opaque diff --git a/onos-rsm-5g/templates/service.yaml b/onos-rsm-5g/templates/service.yaml new file mode 100644 index 00000000..117115af --- /dev/null +++ b/onos-rsm-5g/templates/service.yaml @@ -0,0 +1,59 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "onos-rsm-5g.fullname" . }} + labels: + app: {{ template "onos-rsm-5g.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- include "onos-rsm-5g.labels" . | nindent 4 }} +spec: + type: ClusterIP + selector: + name: {{ template "onos-rsm-5g.fullname" . }} + app: onos + type: rsm + resource: {{ template "onos-rsm-5g.fullname" . }} + {{- include "onos-rsm-5g.selectorLabels" . | nindent 4 }} + ports: + - name: exporter + port: {{ .Values.service.exporter.port }} + - name: grpc + port: {{ .Values.service.grpc.port}} + - name: gnmi + port: {{.Values.service.gnmi.port}} + + {{- if .Values.service.exporter.nodePort.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ template "onos-rsm-5g.fullname" . }}-external + labels: + app: {{ template "onos-rsm-5g.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- include "onos-rsm-5g.labels" . | nindent 4 }} +spec: + type: NodePort + selector: + name: {{ template "onos-rsm-5g.fullname" . }} + app: onos + type: rsm + resource: {{ template "onos-rsm-5g.fullname" . }} + {{- include "onos-rsm-5g.selectorLabels" . | nindent 4 }} + ports: + - name: exporter + port: {{ .Values.service.exporter.port }} + nodePort: {{ .Values.service.exporter.nodePort.port }} + protocol: TCP + {{- end }} +--- + diff --git a/onos-rsm-5g/values.yaml b/onos-rsm-5g/values.yaml new file mode 100644 index 00000000..0ea49a34 --- /dev/null +++ b/onos-rsm-5g/values.yaml @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: 2023-present Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# Default values for onos-rsm-5g. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +global: + image: + registry: "" + tag: "" + +replicaCount: 1 + +image: + registry: "" + repository: onosproject/onos-rsm-5g + tag: '{{ .Chart.AppVersion }}' + pullPolicy: IfNotPresent + pullSecrets: [] + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "onos-rsm-5g" + +storage: {} + +service: + # TODO: External NodePort service should be disabled by default + grpc: + port: 5150 + gnmi: + port: 9339 + exporter: + port: 7001 + nodePort: + enabled: false + port: 31701 + +config: + rsm: + e2tEndpoint: "onos-e2t:5150" + config_json: + report_period: + interval: 1000 # ms + + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m +# memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +logging: + loggers: + root: + level: info + output: + stdout: + sink: stdout + sinks: + stdout: + type: stdout + stdout: {}