From 608f1ade0476876bfde493df94f5596b30348e07 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Mon, 14 Jun 2021 23:26:02 -0700 Subject: [PATCH 1/6] cloned the v2 chart --- aether-roc-umbrella/Chart.yaml | 10 +- .../files/configs/spgw-1-topo-entities.json | 2 +- aether-roc-umbrella/values.yaml | 5 + sdcore-adapter-v3/Chart.yaml | 18 ++++ sdcore-adapter-v3/README.md | 3 + sdcore-adapter-v3/files/certs/README.md | 26 +++++ sdcore-adapter-v3/files/certs/tls.cacert | 21 ++++ sdcore-adapter-v3/files/certs/tls.crt | 21 ++++ sdcore-adapter-v3/files/certs/tls.key | 28 ++++++ sdcore-adapter-v3/files/configs/README.md | 4 + .../files/configs/empty_config.json | 2 + .../files/configs/typical_aether_config.json | 72 ++++++++++++++ sdcore-adapter-v3/templates/_helpers.tpl | 53 ++++++++++ sdcore-adapter-v3/templates/configmap.yaml | 33 +++++++ sdcore-adapter-v3/templates/deployment.yaml | 98 +++++++++++++++++++ sdcore-adapter-v3/templates/secret.yaml | 18 ++++ sdcore-adapter-v3/templates/service.yaml | 27 +++++ .../templates/servicemonitor.yaml | 21 ++++ sdcore-adapter-v3/values.yaml | 57 +++++++++++ sdcore-adapter/Chart.yaml | 2 +- sdcore-adapter/templates/deployment.yaml | 1 + sdcore-adapter/values.yaml | 3 + 22 files changed, 521 insertions(+), 4 deletions(-) create mode 100644 sdcore-adapter-v3/Chart.yaml create mode 100644 sdcore-adapter-v3/README.md create mode 100644 sdcore-adapter-v3/files/certs/README.md create mode 100644 sdcore-adapter-v3/files/certs/tls.cacert create mode 100644 sdcore-adapter-v3/files/certs/tls.crt create mode 100644 sdcore-adapter-v3/files/certs/tls.key create mode 100644 sdcore-adapter-v3/files/configs/README.md create mode 100644 sdcore-adapter-v3/files/configs/empty_config.json create mode 100644 sdcore-adapter-v3/files/configs/typical_aether_config.json create mode 100644 sdcore-adapter-v3/templates/_helpers.tpl create mode 100644 sdcore-adapter-v3/templates/configmap.yaml create mode 100644 sdcore-adapter-v3/templates/deployment.yaml create mode 100644 sdcore-adapter-v3/templates/secret.yaml create mode 100644 sdcore-adapter-v3/templates/service.yaml create mode 100644 sdcore-adapter-v3/templates/servicemonitor.yaml create mode 100644 sdcore-adapter-v3/values.yaml diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml index c9f2777a..07fb5f8b 100644 --- a/aether-roc-umbrella/Chart.yaml +++ b/aether-roc-umbrella/Chart.yaml @@ -58,8 +58,14 @@ dependencies: version: 1.0.4 - name: sdcore-adapter condition: import.sdcore-adapter.enabled - repository: "@sdran" - version: 0.0.18 + #repository: "@sdran" + repository: "file://./../sdcore-adapter/" + version: 0.0.19 + - name: sdcore-adapter-v3 + condition: import.sdcore-adapter.enabled + #repository: "@sdran" + repository: "file://./../sdcore-adapter-v3/" + version: 0.0.19 - name: nginx alias: sdcore-test-dummy condition: import.sdcore-test-dummy.enabled diff --git a/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json b/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json index 35558d70..ac1f0d2c 100644 --- a/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json +++ b/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json @@ -31,7 +31,7 @@ "lng": 13.3885 }, "onos.topo.Configurable": { - "address": "sdcore-adapter-new:5150", + "address": "sdcore-adapter-v3:5150", "version": "3.0.0", "type": "Aether" }, diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml index 204fd301..329e8b29 100644 --- a/aether-roc-umbrella/values.yaml +++ b/aether-roc-umbrella/values.yaml @@ -91,6 +91,11 @@ sdcore-adapter: fullnameOverride: sdcore-adapter prometheusEnabled: false +sdcore-adapter-v3: + nameOverride: sdcore-adapter-v3 + fullnameOverride: sdcore-adapter-v3 + prometheusEnabled: false + # SD-Core Test Dummy # proxy_pass has to be added or nginx will not log the $request_body sdcore-test-dummy: diff --git a/sdcore-adapter-v3/Chart.yaml b/sdcore-adapter-v3/Chart.yaml new file mode 100644 index 00000000..b02f7196 --- /dev/null +++ b/sdcore-adapter-v3/Chart.yaml @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v2 +name: sdcore-adapter-v3 +kubeVersion: ">=1.17.0" +type: application +version: 0.0.19 +appVersion: v0.1.17 +description: ONOS SD-Core Adapter +keywords: + - onos + - sdn +home: https://onosproject.org +maintainers: + - name: ONOS Support + email: support@opennetworking.org diff --git a/sdcore-adapter-v3/README.md b/sdcore-adapter-v3/README.md new file mode 100644 index 00000000..0476356a --- /dev/null +++ b/sdcore-adapter-v3/README.md @@ -0,0 +1,3 @@ +## ONOS SD-Core Adapter + +Provides a [Helm] chart for deploying µONOS SD-Core adapter on [Kubernetes]. diff --git a/sdcore-adapter-v3/files/certs/README.md b/sdcore-adapter-v3/files/certs/README.md new file mode 100644 index 00000000..31eb881e --- /dev/null +++ b/sdcore-adapter-v3/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 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 \ No newline at end of file diff --git a/sdcore-adapter-v3/files/certs/tls.cacert b/sdcore-adapter-v3/files/certs/tls.cacert new file mode 100644 index 00000000..879bc06d --- /dev/null +++ b/sdcore-adapter-v3/files/certs/tls.cacert @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDYDCCAkgCCQDe99fSN9qxSTANBg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tp3kRTBZD0M1XI +Ctit8bXV7Mz+1iGqoyUhfCYcCSjuWTgAxzir+hrdn7uO67Hv4ndCoSj4SQaGka3W +eEfVeA== +-----END CERTIFICATE----- diff --git a/sdcore-adapter-v3/files/certs/tls.crt b/sdcore-adapter-v3/files/certs/tls.crt new file mode 100644 index 00000000..c724912e --- /dev/null +++ b/sdcore-adapter-v3/files/certs/tls.crt @@ -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----- diff --git a/sdcore-adapter-v3/files/certs/tls.key b/sdcore-adapter-v3/files/certs/tls.key new file mode 100644 index 00000000..58b76b7a --- /dev/null +++ b/sdcore-adapter-v3/files/certs/tls.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC3w6n5TzQ3Mx6T +7q9WCxEsqpWja9EOV+4GrHLJU/DiIbNTBb7zchOZ56uXoZwpVSeumGz+teCE59S5 +5Iwmx6RJ3Hwqxv+ZVN93sYf7E+91I2ccRj4GvJHz4cVifgug0aG4CpqWeBP96Xa0 +fIJnw6s3sslG27N+KO3Qv5o+V1cz0P3mnYePt+PzTUyKVM5mEsH9RjzGSJRuIpB3 +88K+2XW+tMAdB+0IpszKXrUH5bIWCbi/hYMDXI7Gs7TtNQw7ZkInsUQ8FYgJQI1F +1hVAsFjsKsN0/resy+YG80ClMV2lXKCr/jUOv0PWwOKwt8TYKDNXg4qxn6V/zUGq +SttW1KhZAgMBAAECggEAcxbbHGYriKq+at3g+B2ESxonD6uVycruK0XTuh2VTrrW +iZeeqO94MTqz8ApqOES5zpJuKPQVwodDZo0p7Zu5W/z30v7A0/Ig5uDMDkbFAPME +P+QKMsPlEP4EVhQ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I7/mHb9 +EZHA1SMvz1yEKUm53DyCh8Nj +-----END PRIVATE KEY----- diff --git a/sdcore-adapter-v3/files/configs/README.md b/sdcore-adapter-v3/files/configs/README.md new file mode 100644 index 00000000..b0afe3dd --- /dev/null +++ b/sdcore-adapter-v3/files/configs/README.md @@ -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. diff --git a/sdcore-adapter-v3/files/configs/empty_config.json b/sdcore-adapter-v3/files/configs/empty_config.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/sdcore-adapter-v3/files/configs/empty_config.json @@ -0,0 +1,2 @@ +{ +} diff --git a/sdcore-adapter-v3/files/configs/typical_aether_config.json b/sdcore-adapter-v3/files/configs/typical_aether_config.json new file mode 100644 index 00000000..33532068 --- /dev/null +++ b/sdcore-adapter-v3/files/configs/typical_aether_config.json @@ -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 + } + ] + } + } + ] + } +} diff --git a/sdcore-adapter-v3/templates/_helpers.tpl b/sdcore-adapter-v3/templates/_helpers.tpl new file mode 100644 index 00000000..2cd2c43c --- /dev/null +++ b/sdcore-adapter-v3/templates/_helpers.tpl @@ -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 -}} \ No newline at end of file diff --git a/sdcore-adapter-v3/templates/configmap.yaml b/sdcore-adapter-v3/templates/configmap.yaml new file mode 100644 index 00000000..0f881271 --- /dev/null +++ b/sdcore-adapter-v3/templates/configmap.yaml @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v1 +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 }} diff --git a/sdcore-adapter-v3/templates/deployment.yaml b/sdcore-adapter-v3/templates/deployment.yaml new file mode 100644 index 00000000..0a1dad87 --- /dev/null +++ b/sdcore-adapter-v3/templates/deployment.yaml @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "sdcore-adapter.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + name: {{ template "sdcore-adapter.fullname" . }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + name: {{ template "sdcore-adapter.fullname" . }} + {{- include "sdcore-adapter.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + args: + - "/usr/local/bin/sdcore-adapter" + - "-bind_address=:{{ .Values.ports.gnmi.secure }}" + - "-key=/etc/sdcore-adapter/certs/tls.key" + - "-cert=/etc/sdcore-adapter/certs/tls.crt" + - "-ca=/etc/sdcore-adapter/certs/tls.cacert" + - "-alsologtostderr" + - "-hostCheckDisabled" + - "-model_version={{ .Values.model.version }}" + {{ if .Values.initialConfig }} + - "-config={{ .Values.initialConfig }}" + {{ end }} + {{ if .Values.output }} + - "-output={{ .Values.output }}" + {{ end }} + {{ if .Values.spgwEndpoint }} + - "-spgw_endpoint={{ .Values.spgwEndpoint }}" + {{ end }} + ports: + {{- range $key, $port := .Values.ports.gnmi }} + - name: gnmi{{ $key }} + containerPort: {{ $port }} + {{- end}} + readinessProbe: + tcpSocket: + port: {{ .Values.ports.gnmi.secure }} + initialDelaySeconds: 5 + periodSeconds: 10 + livenessProbe: + tcpSocket: + port: {{ .Values.ports.gnmi.secure }} + initialDelaySeconds: 15 + periodSeconds: 20 + volumeMounts: + - name: targetconfig + mountPath: /etc/sdcore-adapter/configs + readOnly: true + - name: secret + mountPath: /etc/sdcore-adapter/certs + readOnly: true + - name: logconfig + mountPath: /etc/onos/config + readOnly: true + volumes: + - name: logconfig + configMap: + name: {{ template "sdcore-adapter.fullname" . }}-logconfig + - name: targetconfig + configMap: + name: {{ template "sdcore-adapter.fullname" . }}-targetconfig + - name: secret + secret: + secretName: {{ template "sdcore-adapter.fullname" . }}-secret diff --git a/sdcore-adapter-v3/templates/secret.yaml b/sdcore-adapter-v3/templates/secret.yaml new file mode 100644 index 00000000..049f794a --- /dev/null +++ b/sdcore-adapter-v3/templates/secret.yaml @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "sdcore-adapter.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/sdcore-adapter-v3/templates/service.yaml b/sdcore-adapter-v3/templates/service.yaml new file mode 100644 index 00000000..e512d726 --- /dev/null +++ b/sdcore-adapter-v3/templates/service.yaml @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +apiVersion: v1 +kind: Service +metadata: + name: {{ template "sdcore-adapter.fullname" . }} + labels: + app: {{ template "sdcore-adapter.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- include "sdcore-adapter.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + selector: + name: {{ template "sdcore-adapter.fullname" . }} + ports: + {{- range $key, $port := .Values.ports.gnmi }} + - name: gnmi{{ $key }} + port: {{ $port }} + {{- end}} + - name: prometheus + port: {{ .Values.ports.prometheus }} + - name: diag-api + port: {{ .Values.ports.diagApi }} diff --git a/sdcore-adapter-v3/templates/servicemonitor.yaml b/sdcore-adapter-v3/templates/servicemonitor.yaml new file mode 100644 index 00000000..3019c79d --- /dev/null +++ b/sdcore-adapter-v3/templates/servicemonitor.yaml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +{{- if eq .Values.prometheusEnabled true }} + +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: sdcore-adapter-v3 + labels: + {{- include "sdcore-adapter.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }} + endpoints: + - port: prometheus + path: /metrics + scheme: HTTP +{{ end }} diff --git a/sdcore-adapter-v3/values.yaml b/sdcore-adapter-v3/values.yaml new file mode 100644 index 00000000..e7832b02 --- /dev/null +++ b/sdcore-adapter-v3/values.yaml @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: 2020-present Open Networking Foundation +# +# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 + +nameOverride: "" +fullnameOverride: "" + +replicaCount: 1 +annotations: {} + +image: + repository: onosproject/sdcore-adapter + tag: v0.1.17 + pullPolicy: IfNotPresent + pullSecrets: [] + +resources: + requests: + cpu: 0.5 + memory: 512Mi + +service: + type: ClusterIP + +model: + version: v3 + +secure: true +initialConfig: "" +output: "" +spgwEndpoint: "" + +ports: + gnmi: + secure: 5150 + prometheus: 9851 + diagApi: 8080 + +prometheusEnabled: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +logging: + loggers: + root: + level: info + output: + stdout: + sink: stdout + sinks: + stdout: + type: stdout + stdout: {} diff --git a/sdcore-adapter/Chart.yaml b/sdcore-adapter/Chart.yaml index ff660755..d231e050 100644 --- a/sdcore-adapter/Chart.yaml +++ b/sdcore-adapter/Chart.yaml @@ -6,7 +6,7 @@ apiVersion: v2 name: sdcore-adapter kubeVersion: ">=1.17.0" type: application -version: 0.0.18 +version: 0.0.19 appVersion: v0.1.17 description: ONOS SD-Core Adapter keywords: diff --git a/sdcore-adapter/templates/deployment.yaml b/sdcore-adapter/templates/deployment.yaml index 10daf1a2..0a1dad87 100644 --- a/sdcore-adapter/templates/deployment.yaml +++ b/sdcore-adapter/templates/deployment.yaml @@ -51,6 +51,7 @@ spec: - "-ca=/etc/sdcore-adapter/certs/tls.cacert" - "-alsologtostderr" - "-hostCheckDisabled" + - "-model_version={{ .Values.model.version }}" {{ if .Values.initialConfig }} - "-config={{ .Values.initialConfig }}" {{ end }} diff --git a/sdcore-adapter/values.yaml b/sdcore-adapter/values.yaml index 8a1c06c8..3b74134a 100644 --- a/sdcore-adapter/values.yaml +++ b/sdcore-adapter/values.yaml @@ -22,6 +22,9 @@ resources: service: type: ClusterIP +model: + version: v2 + secure: true initialConfig: "" output: "" From df68b5a7ddc7ea927564fe3361084fa9a9d1b031 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Tue, 15 Jun 2021 14:40:55 -0700 Subject: [PATCH 2/6] fix indent on imagePullSecrets --- sdcore-adapter-v3/templates/deployment.yaml | 2 +- sdcore-adapter/templates/deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdcore-adapter-v3/templates/deployment.yaml b/sdcore-adapter-v3/templates/deployment.yaml index 0a1dad87..c300170d 100644 --- a/sdcore-adapter-v3/templates/deployment.yaml +++ b/sdcore-adapter-v3/templates/deployment.yaml @@ -22,7 +22,7 @@ spec: spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 6 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/sdcore-adapter/templates/deployment.yaml b/sdcore-adapter/templates/deployment.yaml index 0a1dad87..c300170d 100644 --- a/sdcore-adapter/templates/deployment.yaml +++ b/sdcore-adapter/templates/deployment.yaml @@ -22,7 +22,7 @@ spec: spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 6 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} From f3f67c96ae7eb73e5036aa7979518272b823a81c Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Tue, 15 Jun 2021 15:10:08 -0700 Subject: [PATCH 3/6] update sdcore-adapter image versions --- sdcore-adapter-v3/Chart.yaml | 2 +- sdcore-adapter-v3/values.yaml | 2 +- sdcore-adapter/Chart.yaml | 2 +- sdcore-adapter/values.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdcore-adapter-v3/Chart.yaml b/sdcore-adapter-v3/Chart.yaml index b02f7196..80f6f35c 100644 --- a/sdcore-adapter-v3/Chart.yaml +++ b/sdcore-adapter-v3/Chart.yaml @@ -7,7 +7,7 @@ name: sdcore-adapter-v3 kubeVersion: ">=1.17.0" type: application version: 0.0.19 -appVersion: v0.1.17 +appVersion: v0.1.18 description: ONOS SD-Core Adapter keywords: - onos diff --git a/sdcore-adapter-v3/values.yaml b/sdcore-adapter-v3/values.yaml index e7832b02..db46022c 100644 --- a/sdcore-adapter-v3/values.yaml +++ b/sdcore-adapter-v3/values.yaml @@ -10,7 +10,7 @@ annotations: {} image: repository: onosproject/sdcore-adapter - tag: v0.1.17 + tag: v0.1.18 pullPolicy: IfNotPresent pullSecrets: [] diff --git a/sdcore-adapter/Chart.yaml b/sdcore-adapter/Chart.yaml index d231e050..d4a907e2 100644 --- a/sdcore-adapter/Chart.yaml +++ b/sdcore-adapter/Chart.yaml @@ -7,7 +7,7 @@ name: sdcore-adapter kubeVersion: ">=1.17.0" type: application version: 0.0.19 -appVersion: v0.1.17 +appVersion: v0.1.18 description: ONOS SD-Core Adapter keywords: - onos diff --git a/sdcore-adapter/values.yaml b/sdcore-adapter/values.yaml index 3b74134a..063925b7 100644 --- a/sdcore-adapter/values.yaml +++ b/sdcore-adapter/values.yaml @@ -10,7 +10,7 @@ annotations: {} image: repository: onosproject/sdcore-adapter - tag: v0.1.17 + tag: v0.1.18 pullPolicy: IfNotPresent pullSecrets: [] From 40b2b1ffe583b4e6de9bb6b1b6e54494fe51c252 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 16 Jun 2021 08:32:36 -0700 Subject: [PATCH 4/6] remove local chart changes --- aether-roc-umbrella/Chart.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml index 07fb5f8b..c9f2777a 100644 --- a/aether-roc-umbrella/Chart.yaml +++ b/aether-roc-umbrella/Chart.yaml @@ -58,14 +58,8 @@ dependencies: version: 1.0.4 - name: sdcore-adapter condition: import.sdcore-adapter.enabled - #repository: "@sdran" - repository: "file://./../sdcore-adapter/" - version: 0.0.19 - - name: sdcore-adapter-v3 - condition: import.sdcore-adapter.enabled - #repository: "@sdran" - repository: "file://./../sdcore-adapter-v3/" - version: 0.0.19 + repository: "@sdran" + version: 0.0.18 - name: nginx alias: sdcore-test-dummy condition: import.sdcore-test-dummy.enabled From 39b0cb75d2d5308fffa9f5bd5c2c076d463fea25 Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 16 Jun 2021 08:57:01 -0700 Subject: [PATCH 5/6] bump the major on the sdcore-adapter chart and go down to one chart --- sdcore-adapter-v3/Chart.yaml | 18 ---- sdcore-adapter-v3/README.md | 3 - sdcore-adapter-v3/files/certs/README.md | 26 ----- sdcore-adapter-v3/files/certs/tls.cacert | 21 ---- sdcore-adapter-v3/files/certs/tls.crt | 21 ---- sdcore-adapter-v3/files/certs/tls.key | 28 ------ sdcore-adapter-v3/files/configs/README.md | 4 - .../files/configs/empty_config.json | 2 - .../files/configs/typical_aether_config.json | 72 -------------- sdcore-adapter-v3/templates/_helpers.tpl | 53 ---------- sdcore-adapter-v3/templates/configmap.yaml | 33 ------- sdcore-adapter-v3/templates/deployment.yaml | 98 ------------------- sdcore-adapter-v3/templates/secret.yaml | 18 ---- sdcore-adapter-v3/templates/service.yaml | 27 ----- .../templates/servicemonitor.yaml | 21 ---- sdcore-adapter-v3/values.yaml | 57 ----------- sdcore-adapter/Chart.yaml | 2 +- sdcore-adapter/values.yaml | 2 +- 18 files changed, 2 insertions(+), 504 deletions(-) delete mode 100644 sdcore-adapter-v3/Chart.yaml delete mode 100644 sdcore-adapter-v3/README.md delete mode 100644 sdcore-adapter-v3/files/certs/README.md delete mode 100644 sdcore-adapter-v3/files/certs/tls.cacert delete mode 100644 sdcore-adapter-v3/files/certs/tls.crt delete mode 100644 sdcore-adapter-v3/files/certs/tls.key delete mode 100644 sdcore-adapter-v3/files/configs/README.md delete mode 100644 sdcore-adapter-v3/files/configs/empty_config.json delete mode 100644 sdcore-adapter-v3/files/configs/typical_aether_config.json delete mode 100644 sdcore-adapter-v3/templates/_helpers.tpl delete mode 100644 sdcore-adapter-v3/templates/configmap.yaml delete mode 100644 sdcore-adapter-v3/templates/deployment.yaml delete mode 100644 sdcore-adapter-v3/templates/secret.yaml delete mode 100644 sdcore-adapter-v3/templates/service.yaml delete mode 100644 sdcore-adapter-v3/templates/servicemonitor.yaml delete mode 100644 sdcore-adapter-v3/values.yaml diff --git a/sdcore-adapter-v3/Chart.yaml b/sdcore-adapter-v3/Chart.yaml deleted file mode 100644 index 80f6f35c..00000000 --- a/sdcore-adapter-v3/Chart.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -apiVersion: v2 -name: sdcore-adapter-v3 -kubeVersion: ">=1.17.0" -type: application -version: 0.0.19 -appVersion: v0.1.18 -description: ONOS SD-Core Adapter -keywords: - - onos - - sdn -home: https://onosproject.org -maintainers: - - name: ONOS Support - email: support@opennetworking.org diff --git a/sdcore-adapter-v3/README.md b/sdcore-adapter-v3/README.md deleted file mode 100644 index 0476356a..00000000 --- a/sdcore-adapter-v3/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## ONOS SD-Core Adapter - -Provides a [Helm] chart for deploying µONOS SD-Core adapter on [Kubernetes]. diff --git a/sdcore-adapter-v3/files/certs/README.md b/sdcore-adapter-v3/files/certs/README.md deleted file mode 100644 index 31eb881e..00000000 --- a/sdcore-adapter-v3/files/certs/README.md +++ /dev/null @@ -1,26 +0,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 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 \ No newline at end of file diff --git a/sdcore-adapter-v3/files/certs/tls.cacert b/sdcore-adapter-v3/files/certs/tls.cacert deleted file mode 100644 index 879bc06d..00000000 --- a/sdcore-adapter-v3/files/certs/tls.cacert +++ /dev/null @@ -1,21 +0,0 @@ ------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----- diff --git a/sdcore-adapter-v3/files/certs/tls.crt b/sdcore-adapter-v3/files/certs/tls.crt deleted file mode 100644 index c724912e..00000000 --- a/sdcore-adapter-v3/files/certs/tls.crt +++ /dev/null @@ -1,21 +0,0 @@ ------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----- diff --git a/sdcore-adapter-v3/files/certs/tls.key b/sdcore-adapter-v3/files/certs/tls.key deleted file mode 100644 index 58b76b7a..00000000 --- a/sdcore-adapter-v3/files/certs/tls.key +++ /dev/null @@ -1,28 +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 -soCpw8UjhKiB18jUPewaYNbr5olVdYC/Nt70JJwxvQZNCnCwCfJpgkG83UtXSFsA -WKILTFkO0wKBgQDEowy24gPxxFak5rH67vPs3k3YG1c6JqPltSagjAfHVst28TJv -wix8nSrlqRoPAXgm6pSAxw2k+8s3WNzneYpyBdB36R9fGuPvLbJCydB/fOoYhuWT -4eL+xXuS/b1E/RUT7bL6hM7F3I3ByRpcOPUGMVMjvT3mtFD2y/ni0YDrsQKBgCBf -sJS+ZIBEGyamBcYM3XTx+BmKZcxIPCalMwnFn1OxEpAXXX1Fqma//tbPK7p/Vq/t -ciogf1klGrn8yftICM9xEzMZhSfOAcbcdWl59CdEfu/K6sQx5unwf2kCNLvoXrr3 -27vkqxuBICTNCUAE8/8leYSbn76DblzJszwTqvWdAoGBAKscYUC9wyrcersVHFmD -L8sba/8alQ/orX9/Ex3Fyhe8Hn4877znq2Cixnd6zA13o0mJIMRtKOX3CC6XG1WI -eC0WgAUnbdWlgIyrAnyYQytSWEItJH7nBIOcB7BvkqVHd1/y0/OMgeDiBI7/mHb9 -EZHA1SMvz1yEKUm53DyCh8Nj ------END PRIVATE KEY----- diff --git a/sdcore-adapter-v3/files/configs/README.md b/sdcore-adapter-v3/files/configs/README.md deleted file mode 100644 index b0afe3dd..00000000 --- a/sdcore-adapter-v3/files/configs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -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. diff --git a/sdcore-adapter-v3/files/configs/empty_config.json b/sdcore-adapter-v3/files/configs/empty_config.json deleted file mode 100644 index 2c63c085..00000000 --- a/sdcore-adapter-v3/files/configs/empty_config.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/sdcore-adapter-v3/files/configs/typical_aether_config.json b/sdcore-adapter-v3/files/configs/typical_aether_config.json deleted file mode 100644 index 33532068..00000000 --- a/sdcore-adapter-v3/files/configs/typical_aether_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "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 - } - ] - } - } - ] - } -} diff --git a/sdcore-adapter-v3/templates/_helpers.tpl b/sdcore-adapter-v3/templates/_helpers.tpl deleted file mode 100644 index 2cd2c43c..00000000 --- a/sdcore-adapter-v3/templates/_helpers.tpl +++ /dev/null @@ -1,53 +0,0 @@ -{{/* 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 -}} \ No newline at end of file diff --git a/sdcore-adapter-v3/templates/configmap.yaml b/sdcore-adapter-v3/templates/configmap.yaml deleted file mode 100644 index 0f881271..00000000 --- a/sdcore-adapter-v3/templates/configmap.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -apiVersion: v1 -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 }} diff --git a/sdcore-adapter-v3/templates/deployment.yaml b/sdcore-adapter-v3/templates/deployment.yaml deleted file mode 100644 index c300170d..00000000 --- a/sdcore-adapter-v3/templates/deployment.yaml +++ /dev/null @@ -1,98 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ template "sdcore-adapter.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - name: {{ template "sdcore-adapter.fullname" . }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - name: {{ template "sdcore-adapter.fullname" . }} - {{- include "sdcore-adapter.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 6 }} - {{- end }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: POD_NAME - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - args: - - "/usr/local/bin/sdcore-adapter" - - "-bind_address=:{{ .Values.ports.gnmi.secure }}" - - "-key=/etc/sdcore-adapter/certs/tls.key" - - "-cert=/etc/sdcore-adapter/certs/tls.crt" - - "-ca=/etc/sdcore-adapter/certs/tls.cacert" - - "-alsologtostderr" - - "-hostCheckDisabled" - - "-model_version={{ .Values.model.version }}" - {{ if .Values.initialConfig }} - - "-config={{ .Values.initialConfig }}" - {{ end }} - {{ if .Values.output }} - - "-output={{ .Values.output }}" - {{ end }} - {{ if .Values.spgwEndpoint }} - - "-spgw_endpoint={{ .Values.spgwEndpoint }}" - {{ end }} - ports: - {{- range $key, $port := .Values.ports.gnmi }} - - name: gnmi{{ $key }} - containerPort: {{ $port }} - {{- end}} - readinessProbe: - tcpSocket: - port: {{ .Values.ports.gnmi.secure }} - initialDelaySeconds: 5 - periodSeconds: 10 - livenessProbe: - tcpSocket: - port: {{ .Values.ports.gnmi.secure }} - initialDelaySeconds: 15 - periodSeconds: 20 - volumeMounts: - - name: targetconfig - mountPath: /etc/sdcore-adapter/configs - readOnly: true - - name: secret - mountPath: /etc/sdcore-adapter/certs - readOnly: true - - name: logconfig - mountPath: /etc/onos/config - readOnly: true - volumes: - - name: logconfig - configMap: - name: {{ template "sdcore-adapter.fullname" . }}-logconfig - - name: targetconfig - configMap: - name: {{ template "sdcore-adapter.fullname" . }}-targetconfig - - name: secret - secret: - secretName: {{ template "sdcore-adapter.fullname" . }}-secret diff --git a/sdcore-adapter-v3/templates/secret.yaml b/sdcore-adapter-v3/templates/secret.yaml deleted file mode 100644 index 049f794a..00000000 --- a/sdcore-adapter-v3/templates/secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "sdcore-adapter.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/sdcore-adapter-v3/templates/service.yaml b/sdcore-adapter-v3/templates/service.yaml deleted file mode 100644 index e512d726..00000000 --- a/sdcore-adapter-v3/templates/service.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -apiVersion: v1 -kind: Service -metadata: - name: {{ template "sdcore-adapter.fullname" . }} - labels: - app: {{ template "sdcore-adapter.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" - {{- include "sdcore-adapter.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - selector: - name: {{ template "sdcore-adapter.fullname" . }} - ports: - {{- range $key, $port := .Values.ports.gnmi }} - - name: gnmi{{ $key }} - port: {{ $port }} - {{- end}} - - name: prometheus - port: {{ .Values.ports.prometheus }} - - name: diag-api - port: {{ .Values.ports.diagApi }} diff --git a/sdcore-adapter-v3/templates/servicemonitor.yaml b/sdcore-adapter-v3/templates/servicemonitor.yaml deleted file mode 100644 index 3019c79d..00000000 --- a/sdcore-adapter-v3/templates/servicemonitor.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -{{- if eq .Values.prometheusEnabled true }} - -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: sdcore-adapter-v3 - labels: - {{- include "sdcore-adapter.labels" . | nindent 4 }} -spec: - selector: - matchLabels: - {{- include "sdcore-adapter.selectorLabels" . | nindent 6 }} - endpoints: - - port: prometheus - path: /metrics - scheme: HTTP -{{ end }} diff --git a/sdcore-adapter-v3/values.yaml b/sdcore-adapter-v3/values.yaml deleted file mode 100644 index db46022c..00000000 --- a/sdcore-adapter-v3/values.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# SPDX-FileCopyrightText: 2020-present Open Networking Foundation -# -# SPDX-License-Identifier: LicenseRef-ONF-Member-1.0 - -nameOverride: "" -fullnameOverride: "" - -replicaCount: 1 -annotations: {} - -image: - repository: onosproject/sdcore-adapter - tag: v0.1.18 - pullPolicy: IfNotPresent - pullSecrets: [] - -resources: - requests: - cpu: 0.5 - memory: 512Mi - -service: - type: ClusterIP - -model: - version: v3 - -secure: true -initialConfig: "" -output: "" -spgwEndpoint: "" - -ports: - gnmi: - secure: 5150 - prometheus: 9851 - diagApi: 8080 - -prometheusEnabled: true - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -logging: - loggers: - root: - level: info - output: - stdout: - sink: stdout - sinks: - stdout: - type: stdout - stdout: {} diff --git a/sdcore-adapter/Chart.yaml b/sdcore-adapter/Chart.yaml index d4a907e2..5af6d5c6 100644 --- a/sdcore-adapter/Chart.yaml +++ b/sdcore-adapter/Chart.yaml @@ -6,7 +6,7 @@ apiVersion: v2 name: sdcore-adapter kubeVersion: ">=1.17.0" type: application -version: 0.0.19 +version: 3.0.0 appVersion: v0.1.18 description: ONOS SD-Core Adapter keywords: diff --git a/sdcore-adapter/values.yaml b/sdcore-adapter/values.yaml index 063925b7..db46022c 100644 --- a/sdcore-adapter/values.yaml +++ b/sdcore-adapter/values.yaml @@ -23,7 +23,7 @@ service: type: ClusterIP model: - version: v2 + version: v3 secure: true initialConfig: "" From a27f3dc2889ea5da4080fec82c1f030bdaef85df Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 16 Jun 2021 09:05:55 -0700 Subject: [PATCH 6/6] defer values.yaml changes to the next patch --- aether-roc-umbrella/files/configs/spgw-1-topo-entities.json | 2 +- aether-roc-umbrella/values.yaml | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json b/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json index ac1f0d2c..35558d70 100644 --- a/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json +++ b/aether-roc-umbrella/files/configs/spgw-1-topo-entities.json @@ -31,7 +31,7 @@ "lng": 13.3885 }, "onos.topo.Configurable": { - "address": "sdcore-adapter-v3:5150", + "address": "sdcore-adapter-new:5150", "version": "3.0.0", "type": "Aether" }, diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml index 329e8b29..204fd301 100644 --- a/aether-roc-umbrella/values.yaml +++ b/aether-roc-umbrella/values.yaml @@ -91,11 +91,6 @@ sdcore-adapter: fullnameOverride: sdcore-adapter prometheusEnabled: false -sdcore-adapter-v3: - nameOverride: sdcore-adapter-v3 - fullnameOverride: sdcore-adapter-v3 - prometheusEnabled: false - # SD-Core Test Dummy # proxy_pass has to be added or nginx will not log the $request_body sdcore-test-dummy: