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

sdcore-adapter chart initial checkin #97

Merged
merged 2 commits into from
Sep 22, 2020
Merged
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
21 changes: 21 additions & 0 deletions sdcore-adapter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
18 changes: 18 additions & 0 deletions sdcore-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0

apiVersion: v2
SeanCondon marked this conversation as resolved.
Show resolved Hide resolved
name: sdcore-adapter
kubeVersion: ">=1.17.0"
type: application
version: 0.0.1
appVersion: v0.1.0
description: ONOS SD-Core Adapter
keywords:
- onos
- sdn
home: https://onosproject.org
maintainers:
- name: ONOS Support
email: support@opennetworking.org
3 changes: 3 additions & 0 deletions sdcore-adapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## ONOS SD-Core Adapter

Provides a [Helm] chart for deploying µONOS SD-Core adapter on [Kubernetes].
26 changes: 26 additions & 0 deletions sdcore-adapter/files/certs/README.md
Original file line number Diff line number Diff line change
@@ -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 sdcore-adapter
```

In this folder they **must** be (re)named
* tls.cacrt
* tls.crt
* tls.key

Use
```bash
openssl x509 -in deployments/helm/onos-config/files/certs/tls.crt -text -noout
```
to verify the contents (especially the subject).

There is another Cert for onos-config in test/certs but these were created with:
```
generate-certs.sh onos-config
```
and are left named onf.cacrt, onos-config.key and onos-config.crt
21 changes: 21 additions & 0 deletions sdcore-adapter/files/certs/tls.cacert
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 sdcore-adapter/files/certs/tls.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDZDCCAkwCFErBGzsXHo1l8bmZRmDkF+h2bsdWMA0GCSqGSIb3DQEBCwUAMHIx
CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJTWVubG9QYXJrMQww
CgYDVQQKDANPTkYxFDASBgNVBAsMC0VuZ2luZWVyaW5nMR4wHAYDVQQDDBVjYS5v
cGVubmV0d29ya2luZy5vcmcwHhcNMjAwOTIxMjAyNzM3WhcNMzAwOTE5MjAyNzM3
WjBrMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCU1lbmxvUGFy
azEMMAoGA1UECgwDT05GMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEXMBUGA1UEAwwO
c2Rjb3JlLWFkYXB0ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3
w6n5TzQ3Mx6T7q9WCxEsqpWja9EOV+4GrHLJU/DiIbNTBb7zchOZ56uXoZwpVSeu
mGz+teCE59S55Iwmx6RJ3Hwqxv+ZVN93sYf7E+91I2ccRj4GvJHz4cVifgug0aG4
CpqWeBP96Xa0fIJnw6s3sslG27N+KO3Qv5o+V1cz0P3mnYePt+PzTUyKVM5mEsH9
RjzGSJRuIpB388K+2XW+tMAdB+0IpszKXrUH5bIWCbi/hYMDXI7Gs7TtNQw7ZkIn
sUQ8FYgJQI1F1hVAsFjsKsN0/resy+YG80ClMV2lXKCr/jUOv0PWwOKwt8TYKDNX
g4qxn6V/zUGqSttW1KhZAgMBAAEwDQYJKoZIhvcNAQELBQADggEBABXfT9THxoEF
nHfN+7wAJSh/BGvGcDj/aqMSFItWU8L5meixgZMwdLhjBbjpkSaY5xWw/MMSsXEA
pemjCvuOO/gD9/HNr1e1xh112O9a2QDRtv5WgAx/ugYeV/wGOxQZROzMFVpAzSUU
yQO5iGPGGaVOZJ6E1iOSP5SJn2XWjOBQEcmUAV8DtdRzsOWRda/YDdqX6KDULwl9
hym9r96skzS/jMejV/MYaxgaVB5Xqr6k3JT23msBpkzUIzlO0rMOiJ98h36zqynQ
HnPtpaZ45VgBxNlU39T81C1UjKhw1HTWEuPX5bJyGnNAdKBfHfQVJrdnJYTCZfYZ
9CeRFCy3P84=
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions sdcore-adapter/files/certs/tls.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC3w6n5TzQ3Mx6T
7q9WCxEsqpWja9EOV+4GrHLJU/DiIbNTBb7zchOZ56uXoZwpVSeumGz+teCE59S5
5Iwmx6RJ3Hwqxv+ZVN93sYf7E+91I2ccRj4GvJHz4cVifgug0aG4CpqWeBP96Xa0
fIJnw6s3sslG27N+KO3Qv5o+V1cz0P3mnYePt+PzTUyKVM5mEsH9RjzGSJRuIpB3
88K+2XW+tMAdB+0IpszKXrUH5bIWCbi/h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1klGrn8yftICM9xEzMZhSfOAcbcdWl59CdEfu/K6sQx5unwf2kCNLvoXrr3
27vkqxuBICTNCUAE8/8leYSbn76DblzJszwTqvWdAoGBAKscYUC9wyrcersVHFmD
L8sba/8alQ/orX9/Ex3Fyhe8Hn4877znq2Cixnd6zA13o0mJIMRtKOX3CC6XG1WI
eC0WgAUnbdWlgIyrAnyYQytSWEItJH7nBIOcB7BvkqVHd1/y0/OMgeDiBI7/mHb9
EZHA1SMvz1yEKUm53DyCh8Nj
-----END PRIVATE KEY-----
4 changes: 4 additions & 0 deletions sdcore-adapter/files/configs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This folder contains test configurations that are loaded into the application
via a `ConfigMap` when deploying via this Helm chart. The root test configurations
are copied here because Helm does not allow files outside the chart to be accessed
via templates. Changes to the root test configurations should be reflected here.
2 changes: 2 additions & 0 deletions sdcore-adapter/files/configs/empty_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could leave out the whole configs folder, and have them only in the aether-umbrella chart

}
72 changes: 72 additions & 0 deletions sdcore-adapter/files/configs/typical_aether_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"access-profile": {
"access-profile": [
{
"id": "typical-access-profile",
"type": "internet-only",
"filter": "allow app name",
"description": "a typical access profile"
}
]
},
"apn-profile": {
"apn-profile": [
{
"id": "typical-apn-profile",
"apn-name": "internet",
"dns-primary": "8.8.8.4",
"dns-secondary": "8.8.8.8",
"mtu": 1460,
"gx-enabled": true,
"description": "a typical apn profile"
}
]
},
"qos-profile": {
"qos-profile": [
{
"id": "typical-qos-profile",
"apn-ambr": {
"uplink": 4096,
"downlink": 4096
},
"description": "a typical qos profile"
}
]
},
"up-profile": {
"up-profile": [
{
"id": "typical-up-profile",
"user-plane": "spgwu1.headless",
"access-control": "all",
"description": "a typical up profile"
}
]
},
"subscriber": {
"ue": [
{
"ueid": "e150109999111",
"serving-plmn": {
"mcc": 208,
"mnc": 11,
"tac": 1
},
"enabled": true,
"requested-apn": "mme-selected-apn",
"profiles": {
"apn-profile": "typical-apn-profile",
"qos-profile": "typical-qos-profile",
"up-profile": "typical-up-profile",
"access-profile": [
{
"access-profile": "typical-access-profile",
"allowed": true
}
]
}
}
]
}
}
53 changes: 53 additions & 0 deletions sdcore-adapter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "sdcore-adapter.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 "sdcore-adapter.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 "sdcore-adapter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}


{{/*
Common labels
*/}}
{{- define "sdcore-adapter.labels" -}}
helm.sh/chart: {{ include "sdcore-adapter.chart" . }}
{{ include "sdcore-adapter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "sdcore-adapter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "sdcore-adapter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
33 changes: 33 additions & 0 deletions sdcore-adapter/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0

apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally it's only through the umbrella chart that I load the configs as a post install job.
The theory is that if you're just loading this chart individually you're probably a developer and do not want a sample config loaded automatically every time

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deferring for now, will discuss.

kind: ConfigMap
metadata:
name: {{ template "sdcore-adapter.fullname" . }}-targetconfig
labels:
app: {{ template "sdcore-adapter.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
{{ $root := . }}
{{ range $path, $bytes := .Files.Glob "files/configs/*.json" }}
{{ base $path }}: '{{ $root.Files.Get $path }}'
{{ end }}

---

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "sdcore-adapter.fullname" . }}-logconfig
labels:
app: {{ template "sdcore-adapter.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
logging.yaml: |-
{{ toYaml .Values.logging | indent 4 }}
Loading