Added voltha-infra chart
Added voltha-stack chart
Moved "defaults" values to "global" so that they can be managed by the
macro charts
Added examples for different workflows

Change-Id: I5fb2bfa54a1be725892445e93bd8a35d608e5d14
diff --git a/voltha-infra/templates/NOTES.txt b/voltha-infra/templates/NOTES.txt
new file mode 100644
index 0000000..d5db669
--- /dev/null
+++ b/voltha-infra/templates/NOTES.txt
@@ -0,0 +1,13 @@
+Congratulations!
+
+You successfully installed the infrastructure required to run VOLTHA.
+
+Here are some commands to expose services:
+
+ONOS SSH: kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Release.Name }}-onos-classic-hs 8101
+ONOS GUI: kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Release.Name }}-onos-classic-hs 8181
+ETCD: kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Release.Name }}-etcd {{ .Values.etcd.service.port }}
+KAFKA: kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Release.Name }}-kafka {{ .Values.kafka.service.port }}
+
+Jaeger: kubectl port-forward -n {{ .Release.Namespace }} --address 0.0.0.0 svc/{{ .Release.Name }}-voltha-tracing-jaeger-gui 16686
+Kibana: kubectl port-forward -n {{ .Release.Namespace }} --address 0.0.0.0 svc/{{ .Release.Name }}-kibana 5601
diff --git a/voltha-infra/templates/_helpers.tpl b/voltha-infra/templates/_helpers.tpl
new file mode 100644
index 0000000..bf89b45
--- /dev/null
+++ b/voltha-infra/templates/_helpers.tpl
@@ -0,0 +1,23 @@
+# Copyright 2020-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+{{/* Expand the name of the chart. */}}
+{{- define "name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+{{/* Create a default fully qualified app name. We truncate at 63 chars because . . . */}}
+{{- define "fullname" -}}
+{{- $name := default .Chart.Name .Values.nameOverride -}}
+{{- $fullname := default (printf "%s-%s" .Release.Name $name) .Values.fullNameOverride -}}
+{{- $fullname | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
diff --git a/voltha-infra/templates/onos-config-loader-configmap.yaml b/voltha-infra/templates/onos-config-loader-configmap.yaml
new file mode 100644
index 0000000..612d3a1
--- /dev/null
+++ b/voltha-infra/templates/onos-config-loader-configmap.yaml
@@ -0,0 +1,24 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ .Release.Name }}-onos-configs-data
+data:
+  netcfg.json: {{ tpl .Values.onos.netcfg . | quote }}
+  {{- range $key, $val := .Values.onos.componentConfig }}
+  {{ $key }}: {{ $val | quote }}
+  {{- end }}
diff --git a/voltha-infra/templates/onos-config-loader-script.yaml b/voltha-infra/templates/onos-config-loader-script.yaml
new file mode 100644
index 0000000..9132c85
--- /dev/null
+++ b/voltha-infra/templates/onos-config-loader-script.yaml
@@ -0,0 +1,33 @@
+---
+
+# Copyright 2020-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ .Release.Name }}-onos-configs-loader
+data:
+  loader.sh: >
+    set -euo pipefail
+
+    echo -e "Loading netcfg into ONOS\n";
+    curl --fail -sSL --user {{ .Values.onos.username }}:{{ .Values.onos.password }} -X POST "http://{{ .Release.Name }}-onos-classic-hs:8181/onos/v1/network/configuration/" -H Content-type:application/json -d @/opt/configs/netcfg.json;
+
+    echo -e "Loading component configs into ONOS\n";
+    CFGS=$(ls /opt/configs | grep -v netcfg.json);
+    for CFG in ${CFGS};
+    do
+      echo -e "Loading $CFG config"
+      curl --fail -sSL --user {{ .Values.onos.username }}:{{ .Values.onos.password }} -X POST "http://{{ .Release.Name }}-onos-classic-hs:8181/onos/v1/configuration/$CFG" -H Content-type:application/json -d @/opt/configs/$CFG;
+    done
diff --git a/voltha-infra/templates/onos-config-loader.yaml b/voltha-infra/templates/onos-config-loader.yaml
new file mode 100644
index 0000000..79fc6a1
--- /dev/null
+++ b/voltha-infra/templates/onos-config-loader.yaml
@@ -0,0 +1,55 @@
+---
+
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: {{ template "fullname" . }}-onos-config-loader
+  labels:
+    app: onos-config-loader
+    chart: {{ .Chart.Name }}
+    release: {{ .Release.Name }}
+spec:
+  backoffLimit: 12
+  template:
+    metadata:
+      labels:
+        app: onos-config-loader
+        release: {{ .Release.Name }}
+      annotations:
+        checksum/config: {{ include (print $.Template.BasePath "/onos-config-loader-configmap.yaml") . | sha256sum }}
+    spec:
+      restartPolicy: OnFailure
+      containers:
+        - name: onos-config-loader
+          image: ellerbrock/alpine-bash-curl-ssl:latest
+          imagePullPolicy: IfNotPresent
+          command:
+            - "bash"
+            - "/opt/loader/loader.sh"
+          volumeMounts:
+            - name: onos-configs
+              mountPath: /opt/configs
+            - name: onos-loader
+              mountPath: /opt/loader
+      volumes:
+        - name: onos-configs
+          configMap:
+            name: {{ .Release.Name }}-onos-configs-data
+        - name: onos-loader
+          configMap:
+            name: {{ .Release.Name }}-onos-configs-loader
+            defaultMode: 0777