fabric-umbrella: initial version

Change-Id: I3347bd7c49c6f2a53f074fab05cfb1f2164c2fab
diff --git a/fabric-umbrella/templates/NOTES.txt b/fabric-umbrella/templates/NOTES.txt
new file mode 100644
index 0000000..99e18ea
--- /dev/null
+++ b/fabric-umbrella/templates/NOTES.txt
@@ -0,0 +1,20 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.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:
+* Fabric CLI pod with
+$ kubectl -n {{.Release.Namespace}} exec -it deployment/onos-cli -- /bin/bash
+* Fabric Portal at http://<server_IP>:31194
+
+The fabric-roc-api is then available at http://<server_IP>:31194/aether-roc-api
diff --git a/fabric-umbrella/templates/_helpers.tpl b/fabric-umbrella/templates/_helpers.tpl
new file mode 100644
index 0000000..aeef6e9
--- /dev/null
+++ b/fabric-umbrella/templates/_helpers.tpl
@@ -0,0 +1,81 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+SPDX-FileCopyrightText: 2022-present Intel Corporation
+SPDX-License-Identifier: Apache-2.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/fabric-umbrella/templates/opa-rbac-configmap.yaml b/fabric-umbrella/templates/opa-rbac-configmap.yaml
new file mode 100644
index 0000000..fe7057c
--- /dev/null
+++ b/fabric-umbrella/templates/opa-rbac-configmap.yaml
@@ -0,0 +1,16 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.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/fabric-umbrella/templates/sdcore-test-dummy-config.yaml b/fabric-umbrella/templates/sdcore-test-dummy-config.yaml
new file mode 100644
index 0000000..553f215
--- /dev/null
+++ b/fabric-umbrella/templates/sdcore-test-dummy-config.yaml
@@ -0,0 +1,48 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.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 /api/subscriber {
+        rewrite ^/api/subscriber/.* /api/subscriber 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/fabric-umbrella/templates/store.yaml b/fabric-umbrella/templates/store.yaml
new file mode 100644
index 0000000..8bd1180
--- /dev/null
+++ b/fabric-umbrella/templates/store.yaml
@@ -0,0 +1,42 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.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/fabric-umbrella/templates/topo.yaml b/fabric-umbrella/templates/topo.yaml
new file mode 100644
index 0000000..6b2f6a8
--- /dev/null
+++ b/fabric-umbrella/templates/topo.yaml
@@ -0,0 +1,37 @@
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# A topology kind representing an Aether Enterprise node
+apiVersion: topo.onosproject.org/v1beta1
+kind: Kind
+metadata:
+  name: fabric
+spec:
+  aspects: {}
+
+# Fabrics as targets
+{{- range .Values.fabrics }}
+---
+apiVersion: topo.onosproject.org/v1beta1
+kind: Entity
+metadata:
+  name: {{ .id }}
+spec:
+  uri: {{ .id }}
+  kind:
+    name: fabric
+  aspects:
+    onos.topo.Configurable:
+      address: fabric-adapter-v0-1:5150
+      version: 0.1.x
+      type: sdn-fabric
+    onos.topo.Location:
+      lat: {{ .lat }}
+      lng: {{ .long }}
+    onos.topo.TLSOptions:
+      insecure: true
+    onos.topo.Asset:
+      name: {{ .name }}
+    onos.topo.MastershipState: {}
+{{- end }}