Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm charts for RSM-5G #1149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions onos-rsm-5g/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
20 changes: 20 additions & 0 deletions onos-rsm-5g/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
10 changes: 10 additions & 0 deletions onos-rsm-5g/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--
SPDX-FileCopyrightText: 2023-present Intel Corporation

SPDX-License-Identifier: Apache-2.0
-->

## 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.
26 changes: 26 additions & 0 deletions onos-rsm-5g/files/certs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
SPDX-FileCopyrightText: 2019-present Open Networking Foundation <[email protected]>

SPDX-License-Identifier: Apache-2.0
-->

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).
21 changes: 21 additions & 0 deletions onos-rsm-5g/files/certs/tls.cacrt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDYDCCAkgCCQDe99fSN9qxSTANBgkqhkiG9w0BAQsFADByMQswCQYDVQQGEwJV
UzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCU1lbmxvUGFyazEMMAoGA1UECgwDT05G
MRQwEgYDVQQLDAtFbmdpbmVlcmluZzEeMBwGA1UEAwwVY2Eub3Blbm5ldHdvcmtp
bmcub3JnMB4XDTE5MDQxMTA5MDYxM1oXDTI5MDQwODA5MDYxM1owcjELMAkGA1UE
BhMCVVMxCzAJBgNVBAgMAkNBMRIwEAYDVQQHDAlNZW5sb1BhcmsxDDAKBgNVBAoM
A09ORjEUMBIGA1UECwwLRW5naW5lZXJpbmcxHjAcBgNVBAMMFWNhLm9wZW5uZXR3
b3JraW5nLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMEg7CZR
X8Y+syKHaQCh6mNIL1D065trwX8RnuKM2kBwSu034zefQAPloWugSoJgJnf5fe0j
nUD8gN3Sm8XRhCkvf67pzfabgw4n8eJmHScyL/ugyExB6Kahwzn37bt3oT3gSqhr
6PUznWJ8fvfVuCHZZkv/HPRp4eyAcGzbJ4TuB0go4s6VE0WU5OCxCSlAiK3lvpVr
3DOLdYLVoCa5q8Ctl3wXDrfTLw5/Bpfrg9fF9ED2/YKIdV8KZ2ki/gwEOQqWcKp8
0LkTlfOWsdGjp4opPuPT7njMBGXMJzJ8/J1e1aJvIsoB7n8XrfvkNiWL5U3fM4N7
UZN9jfcl7ULmm7cCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAIh6FjkQuTfXddmZY
FYpoTen/VD5iu2Xxc1TexwmKeH+YtaKp1Zk8PTgbCtMEwEiyslfeHTMtODfnpUIk
DwvtB4W0PAnreRsqh9MBzdU6YZmzGyZ92vSUB3yukkHaYzyjeKM0AwgVl9yRNEZw
Y/OM070hJXXzJh3eJpLl9dlUbMKzaoAh2bZx6y3ZJIZFs/zrpGfg4lvBAvfO/59i
mxJ9bQBSN3U2Hwp6ioOQzP0LpllfXtx9N5LanWpB0cu/HN9vAgtp3kRTBZD0M1XI
Ctit8bXV7Mz+1iGqoyUhfCYcCSjuWTgAxzir+hrdn7uO67Hv4ndCoSj4SQaGka3W
eEfVeA==
-----END CERTIFICATE-----
21 changes: 21 additions & 0 deletions onos-rsm-5g/files/certs/tls.crt
Original file line number Diff line number Diff line change
@@ -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-----
28 changes: 28 additions & 0 deletions onos-rsm-5g/files/certs/tls.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC42bpv4K93I1QN
SGpTxU26V0BUm2+1ciebv5YIKOlcm1gHD7YCaxrVLbRjmHoeccjFcSyYHzB6FD2O
XTcJTxndiBcjswk2MUQAdLsAo18rPtJL3bGgDjrC6RXeeOY3j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kyA94CVY3RoYB0GiRBx3OZpc9WB36jJ6TfKuTeLjBoRUkOQKBgHl9
Pzy9pxq6lojx+hGqz2BSbRtQm2+m8o4KuWc/RWcDFLTanT3iZuB4pkt3vlcdS56C
0ur0JcFbVhOb8GijRuEH5XJmexy5NIkLgwhvWBWGEuUTzCSWPG9T1MHTMKgL3C/S
gVWPQinE+u/g6DpLVozrbqi64sNDSpeTOCSzWDIBAoGAWBxIN1k+xQQYneI1+uvi
d8NpUcLRilayIKQkaZFA+efXpyPOq8r0WtAh8tpTA3NFXunMiejJUF1wkzL4+NLt
3ct4RY4eHoPQHtxOqZn7aMx+8/V4yz6IDKEsAsxK1p7AP6yt6GEWzj8OvrP7cm4Z
NVQirzdY6fbkOULBISdVSWk=
-----END PRIVATE KEY-----
73 changes: 73 additions & 0 deletions onos-rsm-5g/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
20 changes: 20 additions & 0 deletions onos-rsm-5g/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
122 changes: 122 additions & 0 deletions onos-rsm-5g/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
18 changes: 18 additions & 0 deletions onos-rsm-5g/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading