[CORD-3003] Make XOS GUI optional (enabled by default)

Change-Id: I2b70ac628d7b5bf105de68895bb6cb0a22f93492
diff --git a/xos-core/templates/ws-configmap.yaml b/xos-core/requirements.yaml
similarity index 75%
rename from xos-core/templates/ws-configmap.yaml
rename to xos-core/requirements.yaml
index 7dcc72b..f77c942 100644
--- a/xos-core/templates/ws-configmap.yaml
+++ b/xos-core/requirements.yaml
@@ -13,13 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: xos-ws
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-data:
-  config: |
-{{ include "xos-ws.gateway_config" . | indent 4 }}
+dependencies:
+- name: xos-gui
+  version: 0.1.0
+  repository: file://../xos-gui
+  condition: xos-gui.enabled
 
diff --git a/xos-core/templates/_gui.tpl b/xos-core/templates/_gui.tpl
deleted file mode 100644
index 8939554..0000000
--- a/xos-core/templates/_gui.tpl
+++ /dev/null
@@ -1,49 +0,0 @@
-{{- /*
-Copyright 2017-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.
-*/ -}}
-
-{{- define "xos-gui.app_config" }}
-angular.module('app')
-.constant('AppConfig', {
-  apiEndpoint: '/xosapi/v1',
-  websocketClient: '/'
-});
-{{- end }}
-
-{{- define "xos-gui.style_config" }}
-angular.module('app')
-.constant('StyleConfig', {
-  projectName: 'R-CORD',
-  favicon: 'cord-favicon.png',
-  background: 'cord-bg.jpg',
-  payoff: 'Your VNF orchestrator',
-  logo: 'cord-logo.png',
-  routes: [
-      {
-          label: 'Slices',
-          state: 'xos.core.slice',
-      },
-      {
-          label: 'Nodes',
-          state: 'xos.core.node',
-      },
-      {
-          label: 'Instances',
-          state: 'xos.core.instance',
-      },
-  ]
-});
-{{- end }}
-
diff --git a/xos-core/templates/_ws.tpl b/xos-core/templates/_ws.tpl
deleted file mode 100644
index 09b77e4..0000000
--- a/xos-core/templates/_ws.tpl
+++ /dev/null
@@ -1,29 +0,0 @@
-{{- /*
-Copyright 2017-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.
-*/ -}}
-
-{{- define "xos-ws.gateway_config" }}
-gateway_config:
-  default:
-  xos:
-    host: xost
-    port: 9000
-  redis:
-    host: redis
-    port: 6379
-  gateway:
-    port: 3000
-{{- end }}
-
diff --git a/xos-core/templates/gui-configmap.yaml b/xos-core/templates/gui-configmap.yaml
deleted file mode 100644
index 273e001..0000000
--- a/xos-core/templates/gui-configmap.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-# Copyright 2017-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: gui-app-config
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-data:
-  config: |
-{{ include "xos-gui.app_config" . | indent 4 }}
-
-...
----
-
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: gui-style-config
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-data:
-  config: |
-{{ include "xos-gui.style_config" . | indent 4 }}
-
diff --git a/xos-core/templates/gui-deployment.yaml b/xos-core/templates/gui-deployment.yaml
deleted file mode 100644
index 4faecdf..0000000
--- a/xos-core/templates/gui-deployment.yaml
+++ /dev/null
@@ -1,60 +0,0 @@
----
-# Copyright 2017-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: extensions/v1beta1
-kind: Deployment
-metadata:
-  name: xos-gui
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-spec:
-  replicas: 1
-  template:
-    metadata:
-      labels:
-        app: xos-gui
-    spec:
-      containers:
-        - name: xos-gui
-          image: {{ .Values.xos_guiImage | quote }}
-          imagePullPolicy: {{ .Values.imagePullPolicy }}
-          ports:
-            - containerPort: 4000
-              port: 4000
-              protocol: TCP
-          volumeMounts:
-            - name: style-config
-              mountPath: /var/www/dist/style.config.js
-              subPath: style/style.config.js
-            - name: app-config
-              mountPath: /var/www/dist/app.config.js
-              subPath: app/app.config.js
-            - name: extensions-volume
-              mountPath: /var/www/dist/extensions
-      volumes:
-        - name: style-config
-          configMap:
-            name: gui-style-config
-            items:
-              - key: config
-                path: style/style.config.js
-        - name: app-config
-          configMap:
-            name: gui-app-config
-            items:
-              - key: config
-                path: app/app.config.js
-        - name: extensions-volume
-          emptyDir: {}
diff --git a/xos-core/templates/gui-service.yaml b/xos-core/templates/gui-service.yaml
deleted file mode 100644
index 56aabb3..0000000
--- a/xos-core/templates/gui-service.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-# Copyright 2017-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: Service
-metadata:
-  name: "xos-gui"
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-spec:
-  type: NodePort
-  ports:
-    - port: 4000
-      targetPort: 4000
-      nodePort: {{ .Values.xos_guiNodePort }}
-      protocol: TCP
-  selector:
-    app: "xos-gui"
diff --git a/xos-core/templates/ws-deployment.yaml b/xos-core/templates/ws-deployment.yaml
deleted file mode 100644
index 5f4cad4..0000000
--- a/xos-core/templates/ws-deployment.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
----
-# Copyright 2017-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: extensions/v1beta1
-kind: Deployment
-metadata:
-  name: xos-ws
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-spec:
-  replicas: 1
-  template:
-    metadata:
-      labels:
-        app: xos-ws
-    spec:
-      containers:
-        - name: xos-ws
-          image: {{ .Values.xos_wsImage | quote }}
-          imagePullPolicy: {{ .Values.imagePullPolicy }}
-          command: ["npm", "start", "--", "--config", "gateway-config.yml"]
-          ports:
-            - containerPort: 3000
-              port: 3000
-              protocol: TCP
-          volumeMounts:
-            - name: gateway-config
-              mountPath: /var/www/src/config/gateway-config.yml
-              subPath: config/gateway-config.yml
-      volumes:
-        - name: gateway-config
-          configMap:
-            name: xos-ws
-            items:
-              - key: config
-                path: config/gateway-config.yml
diff --git a/xos-core/templates/ws-service.yaml b/xos-core/templates/ws-service.yaml
deleted file mode 100644
index 86912d1..0000000
--- a/xos-core/templates/ws-service.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-# Copyright 2017-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: Service
-metadata:
-  name: "xos-ws"
-  labels:
-    {{- include "xos-core.release_labels" . | indent 4 }}
-spec:
-  type: NodePort
-  ports:
-    - port: 3000
-      targetPort: 3000
-      nodePort: {{ .Values.xos_wsNodePort }}
-      protocol: TCP
-  selector:
-    app: "xos-ws"
diff --git a/xos-core/values.yaml b/xos-core/values.yaml
index a0a692b..54d5f26 100644
--- a/xos-core/values.yaml
+++ b/xos-core/values.yaml
@@ -13,15 +13,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+xos_gui:
+  enabled: true
+
 imagePullPolicy: 'IfNotPresent'
 
 # Docker images
 # YAML variable names can't contain `-`, so substituted with `_`
 xos_coreImage: 'xosproject/xos-core:master'
 xos_chameleonImage: 'xosproject/chameleon:master'
-xos_guiImage: 'xosproject/xos-gui:master'
 xos_toscaImage: 'xosproject/xos-tosca:master'
-xos_wsImage: 'xosproject/xos-ws:master'
 xos_api_testerImage: 'xosproject/xos-api-tester:master'
 
 postgresImage: 'postgres:10.3-alpine'
@@ -29,10 +30,8 @@
 redisImage: 'redis:3.2'
 
 # NodePorts
-xos_guiNodePort: 30001
 xos_chameleonNodePort: 30006
 xos_toscaNodePort: 30007
-xos_wsNodePort: 30008
 
 # XOS Admin username/password
 xosAdminUser: 'admin@opencord.org'