[CORD-2909] Flatten and parameterize charts
Change-Id: I695c1df063b0f6f6ccf280254d54cc701292348f
diff --git a/xos-core/templates/NOTES.txt b/xos-core/templates/NOTES.txt
new file mode 100644
index 0000000..cb50ff5
--- /dev/null
+++ b/xos-core/templates/NOTES.txt
@@ -0,0 +1,4 @@
+Thank you for installing {{ .Chart.Name }}.
+
+Your release is named {{ .Release.Name }}.
+
diff --git a/xos-core/templates/_core.tpl b/xos-core/templates/_core.tpl
new file mode 100644
index 0000000..a766082
--- /dev/null
+++ b/xos-core/templates/_core.tpl
@@ -0,0 +1,68 @@
+{{- /*
+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-core.config" }}
+name: xos-core
+xos_dir: /opt/xos
+database:
+ name: {{ .Values.xosDBName | quote }}
+ username: {{ .Values.xosDBUser | quote }}
+ password: {{ .Values.xosDBPassword | quote }}
+logging:
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ file:
+ class: logging.handlers.RotatingFileHandler
+ filename: /var/log/xos.log
+ maxBytes: 10485760
+ backupCount: 5
+ loggers:
+ 'multistructlog':
+ handlers:
+ - console
+ - file
+ level: DEBUG
+{{- end }}
+
+{{- define "xos-core.initial_data" }}
+- model: core.Site
+ fields:
+ name: {{ .Values.cordSiteName | quote }}
+ abbreviated_name: {{ .Values.cordSiteName | quote }}
+ login_base: {{ .Values.cordSiteName | quote }}
+ site_url: "http://opencord.org/"
+ hosts_nodes: true
+
+- model: core.User
+ fields:
+ email: {{ .Values.xosAdminUser | quote }}
+ password: {{ .Values.xosAdminPassword | quote }}
+ firstname: {{ .Values.xosAdminFirstname | quote }}
+ lastname: {{ .Values.xosAdminLastname | quote }}
+ is_admin: true
+ relations:
+ site:
+ fields:
+ name: {{ .Values.cordSiteName | quote }}
+ model: core.Site
+{{- end }}
+
+{{- define "xos-core.ca_cert_chain" }}
+{{ .Values.ca_cert_chain | b64dec }}
+{{- end }}
+
diff --git a/xos-core/templates/_gui.tpl b/xos-core/templates/_gui.tpl
new file mode 100644
index 0000000..8939554
--- /dev/null
+++ b/xos-core/templates/_gui.tpl
@@ -0,0 +1,49 @@
+{{- /*
+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/_helpers.tpl b/xos-core/templates/_helpers.tpl
index 2d2afb7..f55e3be 100644
--- a/xos-core/templates/_helpers.tpl
+++ b/xos-core/templates/_helpers.tpl
@@ -1,25 +1,24 @@
+{{- /*
+Copyright 2017-present Open Networking Foundation
-{{- /*
- 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
- 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
- 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.
- */ -}}
+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-core.release_labels" }}
app: {{ printf "%s-%s" .Release.Name .Chart.Name | trunc 63 }}
-version: {{ .Chart.Version }}
+chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
+heritage: {{ .Release.Service }}
+version: {{ .Chart.Version }}
{{- end }}
-{{- define "xos-core.full_name" -}}
-{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 -}}
-{{- end -}}
+
diff --git a/xos-core/templates/_tosca.tpl b/xos-core/templates/_tosca.tpl
new file mode 100644
index 0000000..3292f4b
--- /dev/null
+++ b/xos-core/templates/_tosca.tpl
@@ -0,0 +1,37 @@
+{{- /*
+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-tosca.config" }}
+name: xos-tosca
+gprc_endpoint: "xos-core"
+local_cert: /usr/local/share/ca-certificates/local_certs.crt
+logging:
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ file:
+ class: logging.handlers.RotatingFileHandler
+ filename: /var/log/xos.log
+ maxBytes: 10485760
+ backupCount: 5
+ loggers:
+ 'multistructlog':
+ handlers:
+ - console
+ - file
+ level: DEBUG
+{{- end }}
diff --git a/xos-core/templates/_ws.tpl b/xos-core/templates/_ws.tpl
new file mode 100644
index 0000000..09b77e4
--- /dev/null
+++ b/xos-core/templates/_ws.tpl
@@ -0,0 +1,29 @@
+{{- /*
+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/certchain-secret.yaml b/xos-core/templates/certchain-secret.yaml
deleted file mode 100644
index 65e8a9c..0000000
--- a/xos-core/templates/certchain-secret.yaml
+++ /dev/null
@@ -1,22 +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: Secret
-metadata:
- name: cert-chain-secret
- namespace: default
-type: Opaque
-data:
- local_certs.crt: {{ .Values.secrets.im_cert_chain }}
\ No newline at end of file
diff --git a/xos-core/templates/chameleon-deployment.yaml b/xos-core/templates/chameleon-deployment.yaml
index 765c67f..df280b5 100644
--- a/xos-core/templates/chameleon-deployment.yaml
+++ b/xos-core/templates/chameleon-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
metadata:
name: xos-chameleon
labels:
- app: xos-chameleon
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
replicas: 1
template:
@@ -27,10 +28,10 @@
spec:
containers:
- name: xos-chameleon
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.xos_chameleon.repository }}:{{ .Values.images.xos_chameleon.tag }}
- imagePullPolicy: {{ .Values.images.xos_chameleon.pullPolicy }}
- command: [ "python", "chameleon/chameleon/main.py", "-R", "9101", "-G", "xos-core:50055", "--swagger-url", "/apidocs", "-r" ]
+ image: {{ .Values.xos_chameleonImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
+ command: ["python", "chameleon/chameleon/main.py", "-R", "9101", "-G", "xos-core:50055", "--swagger-url", "/apidocs", "-r"]
ports:
- containerPort: 9101
port: 9101
- protocol: TCP
\ No newline at end of file
+ protocol: TCP
diff --git a/xos-core/templates/chameleon-service.yaml b/xos-core/templates/chameleon-service.yaml
index 02ac016..97e78c4 100644
--- a/xos-core/templates/chameleon-service.yaml
+++ b/xos-core/templates/chameleon-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,12 +17,14 @@
kind: Service
metadata:
name: "xos-chameleon"
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
type: NodePort
ports:
- - port: 9101
- targetPort: 9101
- nodePort: {{ .Values.node_ports.chameleon_service_port }}
- protocol: TCP
+ - port: 9101
+ targetPort: 9101
+ nodePort: {{ .Values.xos_chameleonNodePort }}
+ protocol: TCP
selector:
app: "xos-chameleon"
diff --git a/xos-core/templates/core-configmap.yaml b/xos-core/templates/core-configmap.yaml
index 20fd143..b9d1e7d 100644
--- a/xos-core/templates/core-configmap.yaml
+++ b/xos-core/templates/core-configmap.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,4 +21,31 @@
{{- include "xos-core.release_labels" . | indent 4 }}
data:
config: |
-{{ toYaml .Values.configs.core_config | indent 4 }}
+{{ include "xos-core.config" . | indent 4 }}
+
+...
+---
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: xos-initial-data
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
+data:
+ config: |
+{{ include "xos-core.initial_data" . | indent 4 }}
+
+...
+---
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: ca-certificates
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
+data:
+ chain: |
+{{ include "xos-core.ca_cert_chain" . | indent 4 }}
+
diff --git a/xos-core/templates/core-deployment.yaml b/xos-core/templates/core-deployment.yaml
index 1389fd6..64bf9f6 100644
--- a/xos-core/templates/core-deployment.yaml
+++ b/xos-core/templates/core-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
metadata:
name: xos-core
labels:
- app: xos-core
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
replicas: 1
template:
@@ -27,8 +28,8 @@
spec:
containers:
- name: xos-core
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.xos_core.repository }}:{{ .Values.images.xos_core.tag }}
- imagePullPolicy: {{ .Values.images.xos_core.pullPolicy }}
+ image: {{ .Values.xos_coreImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
command: ["/bin/bash", "-c", "cd coreapi; ./start_coreapi.sh"]
ports:
- containerPort: 50051
@@ -38,11 +39,12 @@
port: 50055
protocol: TCP
volumeMounts:
- - name: certchain-volume
- mountPath: /usr/local/share/ca-certificates
- name: coreapi-volume
mountPath: /opt/cord_profile
readOnly: true
+ - name: certchain-volume
+ mountPath: /usr/local/share/ca-certificates/local_certs.crt
+ subPath: config/ca_cert_chain.pem
- name: xos-core-config
mountPath: /opt/xos/xos_config.yaml
subPath: config/xos_config.yaml
@@ -50,26 +52,30 @@
mountPath: /opt/xos/core/migrations/initial_data.yaml
subPath: migrations/initial_data.yaml
volumes:
- - name: certchain-volume
- secret:
- secretName: cert-chain-secret
- name: coreapi-volume
secret:
secretName: coreapi-cert-secret
items:
- - key: tls.crt
- path: core_api_cert.pem
- - key: tls.key
- path: core_api_key.pem
+ - key: tls.crt
+ path: core_api_cert.pem
+ - key: tls.key
+ path: core_api_key.pem
+ - name: certchain-volume
+ configMap:
+ name: ca-certificates
+ items:
+ - key: chain
+ path: config/ca_cert_chain.pem
- name: xos-core-config
configMap:
name: xos-core
items:
- - key: config
- path: config/xos_config.yaml
+ - key: config
+ path: config/xos_config.yaml
- name: initial-data-config
configMap:
name: xos-initial-data
items:
- - key: config
- path: migrations/initial_data.yaml
+ - key: config
+ path: migrations/initial_data.yaml
+
diff --git a/xos-core/templates/core-service.yaml b/xos-core/templates/core-service.yaml
index d365e93..4e3a3b9 100644
--- a/xos-core/templates/core-service.yaml
+++ b/xos-core/templates/core-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,17 +20,15 @@
labels:
{{- include "xos-core.release_labels" . | indent 4 }}
spec:
- type: NodePort
- ports:
- - port: 50051
- name: secure
- targetPort: 50051
- nodePort: {{ .Values.node_ports.core_secure_service_port }}
- protocol: TCP
- - port: 50055
- name: insecure
- targetPort: 50055
- nodePort: {{ .Values.node_ports.core_insecure_service_port }}
- protocol: TCP
+ type: ClusterIP
selector:
app: "xos-core"
+ ports:
+ - port: 50051
+ name: secure
+ targetPort: 50051
+ protocol: TCP
+ - port: 50055
+ name: insecure
+ targetPort: 50055
+ protocol: TCP
diff --git a/xos-core/templates/coreapi-cert-secret.yaml b/xos-core/templates/coreapi-cert-secret.yaml
index 4296da5..048f552 100644
--- a/xos-core/templates/coreapi-cert-secret.yaml
+++ b/xos-core/templates/coreapi-cert-secret.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/xos-core/templates/db-configmap.yaml b/xos-core/templates/db-configmap.yaml
deleted file mode 100644
index 5c7f616..0000000
--- a/xos-core/templates/db-configmap.yaml
+++ /dev/null
@@ -1,22 +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: xos-db
- labels:
- {{- include "xos-core.release_labels" . | indent 4 }}
-data:
- service_5432_name: {{ .Values.configs.db_config }}
diff --git a/xos-core/templates/db-deployment.yaml b/xos-core/templates/db-deployment.yaml
index c103e09..d508962 100644
--- a/xos-core/templates/db-deployment.yaml
+++ b/xos-core/templates/db-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,28 +25,21 @@
metadata:
labels:
app: xos-db
- annotations:
- checksum/config-map: {{ include (print $.Template.BasePath "/db-configmap.yaml") . | sha256sum }}
spec:
containers:
- name: xos-db
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.xos_db.repository }}:{{ .Values.images.xos_db.tag }}
- imagePullPolicy: {{ .Values.images.xos_db.pullPolicy }}
+ image: {{ .Values.postgresImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
ports:
- containerPort: 5432
protocol: TCP
env:
- - name: SERVICE_5432_NAME
- valueFrom:
- configMapKeyRef:
- name: xos-db
- key: service_5432_name
- name: POSTGRES_DB
- value: {{ .Values.configs.core_config.database.name | quote }}
+ value: {{ .Values.xosDBName | quote }}
- name: POSTGRES_USER
- value: {{ .Values.configs.core_config.database.username | quote }}
+ value: {{ .Values.xosDBUser | quote }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
- name: xos-db-secret
- key: postgres-password
+ name: xos-db-secrets
+ key: password
diff --git a/xos-core/templates/db-secrets.yaml b/xos-core/templates/db-secrets.yaml
index 5a5ca79..9f41343 100644
--- a/xos-core/templates/db-secrets.yaml
+++ b/xos-core/templates/db-secrets.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,8 +16,8 @@
apiVersion: v1
kind: Secret
metadata:
- name: xos-db-secret
+ name: xos-db-secrets
namespace: default
type: Opaque
data:
- postgres-password: {{ .Values.configs.core_config.database.password | b64enc | quote }}
+ password: {{ .Values.xosDBPassword | b64enc }}
diff --git a/xos-core/templates/db-service.yaml b/xos-core/templates/db-service.yaml
index 802665a..3a71aaa 100644
--- a/xos-core/templates/db-service.yaml
+++ b/xos-core/templates/db-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,11 +20,10 @@
labels:
{{- include "xos-core.release_labels" . | indent 4 }}
spec:
- type: NodePort
- ports:
- - port: 5432
- targetPort: 5432
- nodePort: {{ .Values.node_ports.db_service_port }}
- protocol: TCP
+ type: ClusterIP
selector:
app: "xos-db"
+ ports:
+ - port: 5432
+ targetPort: 5432
+ protocol: TCP
diff --git a/xos-core/templates/gui-app-configmap.yaml b/xos-core/templates/gui-app-configmap.yaml
deleted file mode 100644
index e5b1041..0000000
--- a/xos-core/templates/gui-app-configmap.yaml
+++ /dev/null
@@ -1,22 +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: xos-app-config
- labels:
- {{- include "xos-core.release_labels" . | indent 4 }}
-data:
- config: | {{ .Values.configs.gui_app | indent 4 }}
diff --git a/xos-core/templates/gateway-configmap.yaml b/xos-core/templates/gui-configmap.yaml
similarity index 71%
copy from xos-core/templates/gateway-configmap.yaml
copy to xos-core/templates/gui-configmap.yaml
index 7f0828a..273e001 100644
--- a/xos-core/templates/gateway-configmap.yaml
+++ b/xos-core/templates/gui-configmap.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,10 +16,23 @@
apiVersion: v1
kind: ConfigMap
metadata:
- name: xos-gateway
+ name: gui-app-config
labels:
{{- include "xos-core.release_labels" . | indent 4 }}
data:
config: |
-{{ toYaml .Values.configs.gateway_config | indent 4 }}
+{{ 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
index 58de697..4faecdf 100644
--- a/xos-core/templates/gui-deployment.yaml
+++ b/xos-core/templates/gui-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
metadata:
name: xos-gui
labels:
- app: xos-gui
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
replicas: 1
template:
@@ -27,8 +28,8 @@
spec:
containers:
- name: xos-gui
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.xos_gui.repository }}:{{ .Values.images.xos_gui.tag }}
- imagePullPolicy: {{ .Values.images.xos_gui.pullPolicy }}
+ image: {{ .Values.xos_guiImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
ports:
- containerPort: 4000
port: 4000
@@ -45,15 +46,15 @@
volumes:
- name: style-config
configMap:
- name: xos-style-config
+ name: gui-style-config
items:
- - key: config
- path: style/style.config.js
+ - key: config
+ path: style/style.config.js
- name: app-config
configMap:
- name: xos-app-config
+ name: gui-app-config
items:
- - key: config
- path: app/app.config.js
+ - 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
index 04e7799..56aabb3 100644
--- a/xos-core/templates/gui-service.yaml
+++ b/xos-core/templates/gui-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,12 +17,14 @@
kind: Service
metadata:
name: "xos-gui"
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
type: NodePort
ports:
- - port: 4000
- targetPort: 4000
- nodePort: {{ .Values.node_ports.gui_service_port }}
- protocol: TCP
+ - port: 4000
+ targetPort: 4000
+ nodePort: {{ .Values.xos_guiNodePort }}
+ protocol: TCP
selector:
app: "xos-gui"
diff --git a/xos-core/templates/gui-style-configmap.yaml b/xos-core/templates/gui-style-configmap.yaml
deleted file mode 100644
index 8b1564a..0000000
--- a/xos-core/templates/gui-style-configmap.yaml
+++ /dev/null
@@ -1,22 +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: xos-style-config
- labels:
- {{- include "xos-core.release_labels" . | indent 4 }}
-data:
- config: | {{ .Values.configs.gui_style | indent 4 }}
diff --git a/xos-core/templates/initial-data-configmap.yaml b/xos-core/templates/initial-data-configmap.yaml
deleted file mode 100644
index 602ee11..0000000
--- a/xos-core/templates/initial-data-configmap.yaml
+++ /dev/null
@@ -1,23 +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: xos-initial-data
- labels:
- {{- include "xos-core.release_labels" . | indent 4 }}
-data:
- config: |
-{{ toYaml .Values.configs.initial_data_config | indent 4 }}
diff --git a/xos-core/templates/redis-deployment.yaml b/xos-core/templates/redis-deployment.yaml
index 3a91ab0..0141025 100644
--- a/xos-core/templates/redis-deployment.yaml
+++ b/xos-core/templates/redis-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
metadata:
name: xos-redis
labels:
- app: xos-redis
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
replicas: 1
template:
@@ -27,9 +28,9 @@
spec:
containers:
- name: xos-redis
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.redis.repository }}:{{ .Values.images.redis.tag }}
- imagePullPolicy: {{ .Values.images.redis.pullPolicy }}
+ image: {{ .Values.redisImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
ports:
- containerPort: 6379
port: 6379
- protocol: TCP
\ No newline at end of file
+ protocol: TCP
diff --git a/xos-core/templates/redis-service.yaml b/xos-core/templates/redis-service.yaml
index 567896d..23e811c 100644
--- a/xos-core/templates/redis-service.yaml
+++ b/xos-core/templates/redis-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,12 +17,13 @@
kind: Service
metadata:
name: "redis"
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
- type: NodePort
- ports:
- - port: 6379
- targetPort: 6379
- nodePort: {{ .Values.node_ports.redis_service_port }}
- protocol: TCP
+ type: ClusterIP
selector:
app: "xos-redis"
+ ports:
+ - port: 6379
+ targetPort: 6379
+ protocol: TCP
diff --git a/xos-core/templates/tests/test-xos-core-api.yaml b/xos-core/templates/tests/test-xos-core-api.yaml
index 78622a5..86ed0a0 100644
--- a/xos-core/templates/tests/test-xos-core-api.yaml
+++ b/xos-core/templates/tests/test-xos-core-api.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,21 +17,25 @@
kind: Pod
metadata:
name: "{{ .Release.Name }}-api-test"
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- - name: {{ .Release.Name }}-api-test
- image: {{ .Values.images.api_tester.repository }}:{{ .Values.images.api_tester.tag }}
- imagePullPolicy: {{ .Values.images.api_tester.pullPolicy }}
- env:
- - name: SERVER_IP
- value: 'xos-chameleon'
- - name: SERVER_PORT
- value: '9101'
- - name: XOS_USER
- value: '{{ .Values.xosAdminUser }}'
- - name: XOS_PASSWD
- value: '{{ .Values.xosAdminPassword }}'
- command: [ "pybot", "-L", "TRACE", "-d", "Log", "-T", "Ch_DeploymentTest.txt", "Ch_SiteTest.txt", "Ch_UsersTest.txt", "Ch_SliceTest.txt", "Ch_ServiceTest.txt" ]
+ - name: {{ .Release.Name }}-api-test
+ image: {{ .Values.xos_api_testerImage }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
+ env:
+ - name: SERVER_IP
+ value: 'xos-chameleon'
+ - name: SERVER_PORT
+ value: '9101'
+ - name: XOS_USER
+ value: {{ .Values.xosAdminUser | quote }}
+ - name: XOS_PASSWD
+ value: {{ .Values.xosAdminPassword | quote}}
+ - name: SITE_NAME
+ value: {{ .Values.cordSiteName | quote }}
+ command: ["pybot", "-L", "TRACE", "-d", "Log", "-T", "Ch_DeploymentTest.txt", "Ch_SiteTest.txt", "Ch_UsersTest.txt", "Ch_SliceTest.txt", "Ch_ServiceTest.txt"]
restartPolicy: Never
diff --git a/xos-core/templates/tosca-configmap.yaml b/xos-core/templates/tosca-configmap.yaml
index 54f2146..6269be3 100644
--- a/xos-core/templates/tosca-configmap.yaml
+++ b/xos-core/templates/tosca-configmap.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,4 +21,4 @@
{{- include "xos-core.release_labels" . | indent 4 }}
data:
config: |
-{{ toYaml .Values.configs.tosca_config | indent 4 }}
+{{ include "xos-tosca.config" . | indent 4 }}
diff --git a/xos-core/templates/tosca-deployment.yaml b/xos-core/templates/tosca-deployment.yaml
index 5dd61f2..48eecf2 100644
--- a/xos-core/templates/tosca-deployment.yaml
+++ b/xos-core/templates/tosca-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
metadata:
name: xos-tosca
labels:
- app: xos-tosca
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
replicas: 1
template:
@@ -27,25 +28,29 @@
spec:
containers:
- name: xos-tosca
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.xos_tosca.repository }}:{{ .Values.images.xos_tosca.tag }}
- imagePullPolicy: {{ .Values.images.xos_tosca.pullPolicy }}
+ image: {{ .Values.xos_toscaImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
ports:
- containerPort: 9102
port: 9102
protocol: TCP
volumeMounts:
- - name: secret-volume
- mountPath: /usr/local/share/ca-certificates
- - name: xos-core-config
+ - name: certchain-volume
+ mountPath: /usr/local/share/ca-certificates/local_certs.crt
+ subPath: config/ca_cert_chain.pem
+ - name: xos-tosca-config
mountPath: /opt/xos-tosca/src/xos-tosca.config.yaml
subPath: config/xos-tosca.config.yaml
volumes:
- - name: secret-volume
- secret:
- secretName: cert-chain-secret
- - name: xos-core-config
+ - name: certchain-volume
+ configMap:
+ name: ca-certificates
+ items:
+ - key: chain
+ path: config/ca_cert_chain.pem
+ - name: xos-tosca-config
configMap:
name: xos-tosca
items:
- - key: config
- path: config/xos-tosca.config.yaml
+ - key: config
+ path: config/xos-tosca.config.yaml
diff --git a/xos-core/templates/tosca-service.yaml b/xos-core/templates/tosca-service.yaml
index f57299a..4c70119 100644
--- a/xos-core/templates/tosca-service.yaml
+++ b/xos-core/templates/tosca-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,12 +17,14 @@
kind: Service
metadata:
name: "xos-tosca"
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
type: NodePort
ports:
- - port: 9102
- targetPort: 9102
- nodePort: {{ .Values.node_ports.tosca_service_port }}
- protocol: TCP
+ - port: 9102
+ targetPort: 9102
+ nodePort: {{ .Values.xos_toscaNodePort }}
+ protocol: TCP
selector:
app: "xos-tosca"
diff --git a/xos-core/templates/gateway-configmap.yaml b/xos-core/templates/ws-configmap.yaml
similarity index 90%
rename from xos-core/templates/gateway-configmap.yaml
rename to xos-core/templates/ws-configmap.yaml
index 7f0828a..7dcc72b 100644
--- a/xos-core/templates/gateway-configmap.yaml
+++ b/xos-core/templates/ws-configmap.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,10 +16,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
- name: xos-gateway
+ name: xos-ws
labels:
{{- include "xos-core.release_labels" . | indent 4 }}
data:
config: |
-{{ toYaml .Values.configs.gateway_config | indent 4 }}
+{{ include "xos-ws.gateway_config" . | indent 4 }}
diff --git a/xos-core/templates/ws-deployment.yaml b/xos-core/templates/ws-deployment.yaml
index 0710c11..5f4cad4 100644
--- a/xos-core/templates/ws-deployment.yaml
+++ b/xos-core/templates/ws-deployment.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +18,7 @@
metadata:
name: xos-ws
labels:
- app: xos-ws
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
replicas: 1
template:
@@ -27,9 +28,9 @@
spec:
containers:
- name: xos-ws
- image: {{ .Values.pull_docker_registry }}{{ .Values.images.xos_ws.repository }}:{{ .Values.images.xos_ws.tag }}
- imagePullPolicy: {{ .Values.images.xos_ws.pullPolicy }}
- command: ["npm", "start", "--", "--config", "gateway-config.yml"]
+ image: {{ .Values.xos_wsImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
+ command: ["npm", "start", "--", "--config", "gateway-config.yml"]
ports:
- containerPort: 3000
port: 3000
@@ -41,7 +42,7 @@
volumes:
- name: gateway-config
configMap:
- name: xos-gateway
+ name: xos-ws
items:
- - key: config
- path: config/gateway-config.yml
\ No newline at end of file
+ - key: config
+ path: config/gateway-config.yml
diff --git a/xos-core/templates/ws-service.yaml b/xos-core/templates/ws-service.yaml
index 8e54a5b..86912d1 100644
--- a/xos-core/templates/ws-service.yaml
+++ b/xos-core/templates/ws-service.yaml
@@ -1,3 +1,4 @@
+---
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,12 +17,14 @@
kind: Service
metadata:
name: "xos-ws"
+ labels:
+ {{- include "xos-core.release_labels" . | indent 4 }}
spec:
type: NodePort
ports:
- - port: 3000
- targetPort: 3000
- nodePort: {{ .Values.node_ports.ws_service_port }}
- protocol: TCP
+ - port: 3000
+ targetPort: 3000
+ nodePort: {{ .Values.xos_wsNodePort }}
+ protocol: TCP
selector:
app: "xos-ws"