AETHER-2401 move the aether-roc-api-websocket out to its own Helm chart

Change-Id: Ibd6083a124e95e7869486f398b17a37e9c5c3394
diff --git a/aether-roc-websocket/templates/NOTES.txt b/aether-roc-websocket/templates/NOTES.txt
new file mode 100644
index 0000000..c92f7ca
--- /dev/null
+++ b/aether-roc-websocket/templates/NOTES.txt
@@ -0,0 +1,17 @@
+# 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 }}
+
+{{ .Release.Name }} forwards Prometheus alerts to listening Web Sockets (in browser sessions).
+
+If you are using KinD as a Kubernetes server you will have to add a "port-forward" to access the {{ .Release.Name }} e.g.
+$ kubectl -n {{.Release.Namespace}} port-forward service/{{ .Release.Name }} 8181
diff --git a/aether-roc-websocket/templates/_helpers.tpl b/aether-roc-websocket/templates/_helpers.tpl
new file mode 100644
index 0000000..c90766c
--- /dev/null
+++ b/aether-roc-websocket/templates/_helpers.tpl
@@ -0,0 +1,55 @@
+{{/* 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 "aether-roc-websocket.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 "aether-roc-websocket.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 "aether-roc-websocket.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Common labels
+*/}}
+{{- define "aether-roc-websocket.labels" -}}
+helm.sh/chart: {{ include "aether-roc-websocket.chart" . }}
+{{ include "aether-roc-websocket.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end -}}
+
+{{/*
+Selector labels
+*/}}
+{{- define "aether-roc-websocket.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "aether-roc-websocket.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end -}}
diff --git a/aether-roc-websocket/templates/configmap.yaml b/aether-roc-websocket/templates/configmap.yaml
new file mode 100644
index 0000000..546bc84
--- /dev/null
+++ b/aether-roc-websocket/templates/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
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "aether-roc-websocket.fullname" . }}-config
+  labels:
+    app: {{ template "aether-roc-websocket.fullname" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+data:
+  logging.yaml: |-
+{{ toYaml .Values.logging | indent 4 }}
diff --git a/aether-roc-websocket/templates/deployment.yaml b/aether-roc-websocket/templates/deployment.yaml
new file mode 100644
index 0000000..cf0630c
--- /dev/null
+++ b/aether-roc-websocket/templates/deployment.yaml
@@ -0,0 +1,86 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "aether-roc-websocket.fullname" . }}
+  namespace: {{ .Release.Namespace }}
+  labels:
+    {{- include "aether-roc-websocket.labels" . | nindent 4 }}
+spec:
+  replicas: {{ .Values.replicaCount }}
+  selector:
+    matchLabels:
+      name: {{ template "aether-roc-websocket.fullname" . }}
+      app: aether
+      type: ws
+      resource: {{ template "aether-roc-websocket.fullname" . }}
+      {{- include "aether-roc-websocket.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      labels:
+        name: {{ template "aether-roc-websocket.fullname" . }}
+        app: aether
+        type: ws
+        resource: {{ template "aether-roc-websocket.fullname" . }}
+        {{- include "aether-roc-websocket.selectorLabels" . | nindent 8 }}
+    spec:
+      serviceAccountName: aether-roc-websocket
+      securityContext:
+        {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      {{- with .Values.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      containers:
+        - name: {{ .Chart.Name }}
+          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
+          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          env:
+            - name: NAMESPACE
+              valueFrom:
+                fieldRef:
+                  fieldPath: metadata.namespace
+          args: []
+          ports:
+            - name: http
+              containerPort: {{ .Values.port }}
+          startupProbe:
+            tcpSocket:
+              port: {{ .Values.port }}
+            periodSeconds: 5
+            failureThreshold: 60
+          readinessProbe:
+            tcpSocket:
+              port: {{ .Values.port }}
+            initialDelaySeconds: 10
+            periodSeconds: 10
+          livenessProbe:
+            tcpSocket:
+              port: {{ .Values.port }}
+            initialDelaySeconds: 10
+            periodSeconds: 10
+          resources:
+            {{- toYaml .Values.resources | nindent 12 }}
+          securityContext: {}
+      volumes:
+        - name: secret
+          secret:
+            secretName: {{ template "aether-roc-websocket.fullname" . }}-secret
+        - name: config
+          configMap:
+            name: {{ template "aether-roc-websocket.fullname" . }}-config
+      {{- with .Values.nodeSelector }}
+    nodeSelector:
+      {{- toYaml . | nindent 8 }}
+    {{- end }}
+    {{- with .Values.affinity }}
+    affinity:
+      {{- toYaml . | nindent 8 }}
+    {{- end }}
+    {{- with .Values.tolerations }}
+    tolerations:
+      {{- toYaml . | nindent 8 }}
+    {{- end }}
diff --git a/aether-roc-websocket/templates/secret.yaml b/aether-roc-websocket/templates/secret.yaml
new file mode 100644
index 0000000..693761b
--- /dev/null
+++ b/aether-roc-websocket/templates/secret.yaml
@@ -0,0 +1,18 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: Secret
+metadata:
+  name: {{ template "aether-roc-websocket.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/aether-roc-websocket/templates/service.yaml b/aether-roc-websocket/templates/service.yaml
new file mode 100644
index 0000000..5d0bc96
--- /dev/null
+++ b/aether-roc-websocket/templates/service.yaml
@@ -0,0 +1,26 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "aether-roc-websocket.fullname" . }}
+  labels:
+    app: {{ template "aether-roc-websocket.fullname" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+    {{- include "aether-roc-websocket.labels" . | nindent 4 }}
+spec:
+  type: {{ .Values.service.type }}
+  selector:
+    name: {{ template "aether-roc-websocket.fullname" . }}
+    app: aether
+    type: ws
+    resource: {{ template "aether-roc-websocket.fullname" . }}
+    {{- include "aether-roc-websocket.selectorLabels" . | nindent 4 }}
+  ports:
+    - name: webhook
+      port: 80
+      targetPort: {{ .Values.port }}
diff --git a/aether-roc-websocket/templates/serviceaccount.yaml b/aether-roc-websocket/templates/serviceaccount.yaml
new file mode 100644
index 0000000..ef5dd83
--- /dev/null
+++ b/aether-roc-websocket/templates/serviceaccount.yaml
@@ -0,0 +1,10 @@
+# SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: aether-roc-websocket
+  namespace: {{ .Release.Namespace }}