AETHER-2234 move and update aether-roc-umbrella
Change-Id: I7ca845b92dff1fce5fd87d42053a43d80cc55f34
diff --git a/aether-roc-umbrella/templates/NOTES.txt b/aether-roc-umbrella/templates/NOTES.txt
new file mode 100644
index 0000000..e7d3256
--- /dev/null
+++ b/aether-roc-umbrella/templates/NOTES.txt
@@ -0,0 +1,25 @@
+# SPDX-FileCopyrightText: 2021 Open Networking Foundation
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+Thank you for installing {{ .Chart.Name }} Helm chart.
+
+Your release is named {{ .Release.Name }} in namespace {{.Release.Namespace}}.
+See https://docs.onosproject.org/developers/deploy_with_helm/
+
+To learn more about the release, try:
+ $ helm -n {{.Release.Namespace}} status {{ .Release.Name }}
+ $ helm -n {{.Release.Namespace}} get all {{ .Release.Name }}
+ $ watch kubectl -n {{.Release.Namespace}} get pods
+
+You can attach to:
+* Aether CLI pod with
+$ kubectl -n {{.Release.Namespace}} exec -it $(kubectl -n {{.Release.Namespace}} get pods -l type=cli -o name) -- /bin/sh
+* Aether Portal at http://<server_IP>:31190
+
+If you are using KinD as a Kubernetes server, you will have to use a "port-forward" to access the Aether ROC GUI e.g.
+$ kubectl -n {{.Release.Namespace}} port-forward $(kubectl -n {{.Release.Namespace}} get pods -l type=arg -o name) 8183:80
+and then access the GUI at
+* http://localhost:8183
+
+The aether-roc-api is then available at http://localhost:8183/aether-roc-api
diff --git a/aether-roc-umbrella/templates/_helpers.tpl b/aether-roc-umbrella/templates/_helpers.tpl
new file mode 100644
index 0000000..96089e8
--- /dev/null
+++ b/aether-roc-umbrella/templates/_helpers.tpl
@@ -0,0 +1,81 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+Expand the name of the chart.
+*/}}
+{{- define "global.name" -}}
+{{- default .Chart.Name .Values.global.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 "global.fullname" -}}
+{{- if .Values.global.fullnameOverride -}}
+{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" -}}
+{{- else -}}
+{{- $name := default .Chart.Name .Values.global.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 "global.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Common labels
+*/}}
+{{- define "global.labels" -}}
+helm.sh/chart: {{ include "global.chart" . }}
+{{ include "global.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Selector labels
+*/}}
+{{- define "global.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "global.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end -}}
+
+{{/*
+global consensus image name
+*/}}
+{{- define "global.store.consensus.imagename" -}}
+{{- if .Values.global.store.consensus.image.tag -}}
+{{- if .Values.global.store.consensus.image.registry -}}
+{{- printf "%s/" .Values.global.store.consensus.image.registry -}}
+{{- end -}}
+{{- printf "%s:" .Values.global.store.consensus.image.repository -}}
+{{- .Values.global.store.consensus.image.tag -}}
+{{- else -}}
+""
+{{- end -}}
+{{- end -}}
+
+{{/*
+global consensus store name
+*/}}
+{{- define "global.store.consensus.name" -}}
+{{- if .Values.global.store.consensus.name -}}
+{{- printf "%s" .Values.global.store.consensus.name -}}
+{{- else -}}
+{{- printf "%s-consensus-store" ( include "global.fullname" . ) -}}
+{{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/aether-roc-umbrella/templates/alertmanager-configmap.yaml b/aether-roc-umbrella/templates/alertmanager-configmap.yaml
new file mode 100644
index 0000000..cbbcfe3
--- /dev/null
+++ b/aether-roc-umbrella/templates/alertmanager-configmap.yaml
@@ -0,0 +1,24 @@
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Release.Name }}-alertmanager
+ namespace: {{ .Release.Namespace }}
+data:
+ alertmanager.yml: |-
+ global: {}
+ # slack_api_url: ''
+
+ receivers:
+ - name: default-receiver
+ webhook_configs:
+ - url: {{ .Values.prometheus.alertmanager.webhook_url }}
+
+ route:
+ group_wait: 10s
+ group_interval: 1m
+ receiver: default-receiver
+ repeat_interval: 3h
diff --git a/aether-roc-umbrella/templates/dashboards-templated.yaml b/aether-roc-umbrella/templates/dashboards-templated.yaml
new file mode 100644
index 0000000..01cadbb
--- /dev/null
+++ b/aether-roc-umbrella/templates/dashboards-templated.yaml
@@ -0,0 +1,11 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Release.Name }}-dashboards-templated
+ namespace: {{ .Release.Namespace }}
+data:
+{{ (.Files.Glob "files/dashboards/**/*.json").AsConfig | indent 2 }}
diff --git a/aether-roc-umbrella/templates/grafana-post-install-sh.yaml b/aether-roc-umbrella/templates/grafana-post-install-sh.yaml
new file mode 100644
index 0000000..3a7b3a9
--- /dev/null
+++ b/aether-roc-umbrella/templates/grafana-post-install-sh.yaml
@@ -0,0 +1,15 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Release.Name }}-grafana-post-install
+ labels:
+ app: {{ template "aether-roc-api.fullname" . }}
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ release: "{{ .Release.Name }}"
+ heritage: "{{ .Release.Service }}"
+data:
+{{ (.Files.Glob "files/scripts/*.sh").AsConfig | indent 2 }}
diff --git a/aether-roc-umbrella/templates/opa-rbac-configmap.yaml b/aether-roc-umbrella/templates/opa-rbac-configmap.yaml
new file mode 100644
index 0000000..e123fa5
--- /dev/null
+++ b/aether-roc-umbrella/templates/opa-rbac-configmap.yaml
@@ -0,0 +1,16 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+{{ if ".Values.onos-config.openpolicyagent.enabled" }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Release.Name }}-opa-rbac
+ labels:
+ chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ release: "{{ .Release.Name }}"
+ heritage: "{{ .Release.Service }}"
+data:
+{{ (.Files.Glob "files/opa-rbac/*.rego").AsConfig | indent 2 }}
+{{end}}
\ No newline at end of file
diff --git a/aether-roc-umbrella/templates/post-install-job-grafana.yaml b/aether-roc-umbrella/templates/post-install-job-grafana.yaml
new file mode 100644
index 0000000..d31e3c6
--- /dev/null
+++ b/aether-roc-umbrella/templates/post-install-job-grafana.yaml
@@ -0,0 +1,72 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+{{ if .Values.import.grafana.enabled }}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: "{{ .Release.Name }}"
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ app.kubernetes.io/version: {{ .Chart.AppVersion }}
+ helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ annotations:
+ # This is what defines this resource as a hook. Without this line, the
+ # job is considered part of the release.
+ "helm.sh/hook": post-install
+ "helm.sh/hook-weight": "-5"
+ {{- if .Values.grafana.tidyUpPostInstall }}
+ "helm.sh/hook-delete-policy": hook-succeeded
+ {{- end}}
+spec:
+ template:
+ metadata:
+ name: "{{ .Release.Name }}"
+ labels:
+ app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
+ app.kubernetes.io/instance: {{ .Release.Name | quote }}
+ helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+ spec:
+ restartPolicy: Never
+ containers:
+ - name: post-install-job
+ image: "onosproject/onos-cli:v0.7.32"
+ env:
+ - name: GF_SECURITY_ADMIN_USER
+ valueFrom:
+ secretKeyRef:
+ name: {{ .Release.Name }}-grafana
+ key: admin-user
+ - name: GF_SECURITY_ADMIN_PASSWORD
+ valueFrom:
+ secretKeyRef:
+ name: {{ .Release.Name }}-grafana
+ key: admin-password
+ command: ["/usr/local/bin/grafana-create-orgs.sh"]
+ args:
+ - "$(GF_SECURITY_ADMIN_USER)"
+ - "$(GF_SECURITY_ADMIN_PASSWORD)"
+ - "{{ .Release.Name }}"
+ - "{{ .Release.Name }}-grafana"
+ - "/usr/local/dashboards/templated"
+ {{- range $org, $vcs := .Values.grafana.orgs }}
+ - {{ printf "%s%s" $org $vcs | quote }}
+ {{- end}}
+ volumeMounts:
+ - name: post-install
+ mountPath: /usr/local/bin
+ readOnly: true
+ - name: dashboards-templated
+ mountPath: /usr/local/dashboards/templated
+ readOnly: true
+ volumes:
+ - name: post-install
+ configMap:
+ name: {{ .Release.Name }}-grafana-post-install
+ defaultMode: 0555
+ - name: dashboards-templated
+ configMap:
+ name: {{ .Release.Name }}-dashboards-templated
+
+ {{end}}
diff --git a/aether-roc-umbrella/templates/sdcore-test-dummy-config.yaml b/aether-roc-umbrella/templates/sdcore-test-dummy-config.yaml
new file mode 100644
index 0000000..5adedae
--- /dev/null
+++ b/aether-roc-umbrella/templates/sdcore-test-dummy-config.yaml
@@ -0,0 +1,44 @@
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ .Release.Name }}-sdcore-test-dummy
+ namespace: {{ .Release.Namespace }}
+data:
+ sdcore-test-dummy.conf: |-
+ log_format client '$remote_addr - $remote_user $request_time $upstream_response_time '
+ '[$time_local] "$request" $status $body_bytes_sent $request_body "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ server {
+ listen 0.0.0.0:8080;
+ default_type application/json;
+ access_log /opt/bitnami/nginx/logs/access.log client;
+
+ # You can provide a special subPath or the root
+ location = /v1/config {
+ root /;
+ proxy_pass http://127.0.0.1:8080/post_dummy;
+ }
+ location = /v1/config/policies {
+ root /;
+ proxy_pass http://127.0.0.1:8080/post_dummy;
+ }
+ location = /v1/config/imsis {
+ root /;
+ proxy_pass http://127.0.0.1:8080/post_dummy;
+ }
+ location /v1/config/5g {
+ rewrite ^/v1/config/5g/.* /v1/config/5g break;
+ proxy_pass http://127.0.0.1:8080/post_dummy;
+ }
+ location = /post_dummy {
+ # turn off logging here to avoid double logging
+ access_log off;
+ return 200;
+ }
+ error_page 405 =200 $uri;
+ }
diff --git a/aether-roc-umbrella/templates/store.yaml b/aether-roc-umbrella/templates/store.yaml
new file mode 100644
index 0000000..9de9669
--- /dev/null
+++ b/aether-roc-umbrella/templates/store.yaml
@@ -0,0 +1,42 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+{{- if .Values.global.store.consensus.enabled }}
+apiVersion: atomix.io/v2beta1
+kind: Store
+metadata:
+ name: {{ template "global.store.consensus.name" . }}
+ namespace: {{ .Release.Namespace }}
+spec:
+ protocol:
+ apiVersion: storage.atomix.io/v2beta2
+ kind: MultiRaftProtocol
+ spec:
+ replicas: {{ .Values.global.store.consensus.replicas }}
+ groups: {{ .Values.global.store.consensus.partitions }}
+ {{- with .Values.global.store.consensus.raft }}
+ raft:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ image: {{ template "global.store.consensus.imagename" . }}
+ imagePullPolicy: {{ .Values.global.store.consensus.image.pullPolicy }}
+ {{- with .Values.global.store.consensus.image.pullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.global.store.consensus.securityContext }}
+ securityContext:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- if .Values.global.store.consensus.persistence.storageClass }}
+ volumeClaimTemplate:
+ spec:
+ accessModes:
+ - ReadWriteOnce
+ storageClassName: {{ .Values.global.store.consensus.persistence.storageClass | quote }}
+ resources:
+ requests:
+ storage: {{ .Values.global.store.consensus.persistence.storageSize }}
+ {{- end }}
+{{- end }}
\ No newline at end of file
diff --git a/aether-roc-umbrella/templates/topo.yaml b/aether-roc-umbrella/templates/topo.yaml
new file mode 100644
index 0000000..a32d520
--- /dev/null
+++ b/aether-roc-umbrella/templates/topo.yaml
@@ -0,0 +1,55 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+# A topology kind representing an E2 node
+apiVersion: topo.onosproject.org/v1beta1
+kind: Kind
+metadata:
+ name: aether
+spec:
+ aspects: {}
+
+---
+# The 4G v2.1.0 sdcore-adapter
+apiVersion: topo.onosproject.org/v1beta1
+kind: Entity
+metadata:
+ name: connectivity-service-v2
+spec:
+ uri: connectivity-service-v2
+ kind:
+ name: aether
+ aspects:
+ onos.topo.Configurable:
+ address: sdcore-adapter-v21:5150
+ version: 2.1.0
+ type: Aether
+ onos.topo.TLSOptions:
+ insecure: true
+ onos.topo.Asset:
+ name: SPGW-1
+ onos.topo.MastershipState: {}
+---
+# The 4G/5G v3.0.0 sdcore-adapter
+apiVersion: topo.onosproject.org/v1beta1
+kind: Entity
+metadata:
+ name: connectivity-service-v3
+spec:
+ uri: connectivity-service-v3
+ kind:
+ name: aether
+ aspects:
+ onos.topo.Configurable:
+ address: sdcore-adapter-v3:5150
+ version: 3.0.0
+ type: Aether
+ onos.topo.Location:
+ lat: 52.5150
+ lng: 13.3885
+ onos.topo.TLSOptions:
+ insecure: true
+ onos.topo.Asset:
+ name: 5G Core
+ onos.topo.MastershipState: {}