CORD-3024 M-CORD profile chart and service charts
Change-Id: Ic947da2a6e5c77e6c943200fd11f0b35b9c8655b
diff --git a/xos-services/hssdb/.helmignore b/xos-services/hssdb/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/xos-services/hssdb/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/xos-services/hssdb/Chart.yaml b/xos-services/hssdb/Chart.yaml
new file mode 100644
index 0000000..62e5ae8
--- /dev/null
+++ b/xos-services/hssdb/Chart.yaml
@@ -0,0 +1,21 @@
+---
+
+# 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
+appVersion: "1.0"
+description: A Helm chart for XOS's "hssdb" service
+name: hssdb
+version: 0.1.0
diff --git a/xos-services/hssdb/files/id_rsa b/xos-services/hssdb/files/id_rsa
new file mode 100644
index 0000000..c840002
--- /dev/null
+++ b/xos-services/hssdb/files/id_rsa
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpgIBAAKCAQEAy+S+bw7ENW5knorMTH/xmRKr/OaBx7ukRRNe1WKEwLgQbB0J
+xEznHG0E/OakgcuTQDACArTndeYl2H5rpdHhXkh6EK9R9yAF09In+gDcVzpvP2dq
+5UTbYThILIw0FPX6DcU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4906P0Dd9t+PmQz6XXu4987FjOqAc
+zYvVr5vhCFhvSvWcKJN7uGbDAoGBAKvJequlLZDXCEB9UHzkwymn3IMg9ihYQAQH
+GV6Lw7H34gEoULQXRLw0xxlCPsduOPXkUbKxnYJ/drVDebmprh2KT4wAv3SG7eyZ
+SGh/Wv7yFSDAJvSYWwfjDzufMtm5Mc3oupzgY1toD7GLNFH1xasbHswVGRK+5NFl
+QlC1ipcNAoGBAIxqGyCai6btwDlbpkdI+ck2j7k9ndZ8sosc0G2se9d58sfsHdWe
+1wpqe62t7mQZr+IgEyq7RuuEtRR6Xqb8RQqAuEdSms1zcWc30SJJhPiwxIeLL0dx
+ly/HBBqnozD4BN3ENiqnIhOgeZE7XHaS43luYkYpBOuBaWYs5IIZWcct
+-----END RSA PRIVATE KEY-----
diff --git a/xos-services/hssdb/templates/_helpers.tpl b/xos-services/hssdb/templates/_helpers.tpl
new file mode 100644
index 0000000..fec2d8d
--- /dev/null
+++ b/xos-services/hssdb/templates/_helpers.tpl
@@ -0,0 +1,80 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+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.
+*/}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "hssdb.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 "hssdb.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 "hssdb.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{- define "hssdb.serviceConfig" -}}
+name: hssdb
+accessor:
+ username: {{ .Values.xosAdminUser | quote }}
+ password: {{ .Values.xosAdminPassword | quote }}
+ endpoint: xos-core:50051
+required_models:
+ - HSSDBService
+ - HSSDBVendor
+ - HSSDBServiceInstance
+dependency_graph: "/opt/xos/synchronizers/hssdb/model-deps"
+steps_dir: "/opt/xos/synchronizers/hssdb/steps"
+sys_dir: "/opt/xos/synchronizers/hssdb/sys"
+model_policies_dir: "/opt/xos/synchronizers/hssdb/model_policies"
+models_dir: "/opt/xos/synchronizers/hssdb/models"
+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-services/hssdb/templates/_tosca.tpl b/xos-services/hssdb/templates/_tosca.tpl
new file mode 100644
index 0000000..ecae8da
--- /dev/null
+++ b/xos-services/hssdb/templates/_tosca.tpl
@@ -0,0 +1,62 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+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.
+*/}}
+{{- define "hssdb.serviceTosca" -}}
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+ - custom_types/hssdbservice.yaml
+ - custom_types/hssdbvendor.yaml
+ - custom_types/flavor.yaml
+ - custom_types/image.yaml
+
+description: Configures the HSSDB service
+
+topology_template:
+ node_templates:
+
+ service#hssdb:
+ type: tosca.nodes.HSSDBService
+ properties:
+ name: hssdb
+ public_key: {{ .publicKey | quote }}
+ private_key_fn: /opt/xos/services/hssdb/keys/id_rsa
+
+ sprint_hssdb:
+ type: tosca.nodes.HSSDBVendor
+ properties:
+ name: sprint_hssdb_{{ .vnfImageVersion }}
+ requirements:
+ - image:
+ node: image_hssdb
+ relationship: tosca.relationships.BelongsToOne
+ - flavor:
+ node: {{ .vnfImageFlavor }}
+ relationship: tosca.relationships.BelongsToOne
+
+ image_hssdb:
+ type: tosca.nodes.Image
+ properties:
+ name: image_hssdb_{{ .vnfImageVersion }}
+ disk_format: QCOW2
+ container_format: BARE
+ path: {{ .vnfImageURL }}
+
+ {{ .vnfImageFlavor }}:
+ type: tosca.nodes.Flavor
+ properties:
+ name: {{ .vnfImageFlavor }}
+{{- end -}}
diff --git a/xos-services/hssdb/templates/configmap.yaml b/xos-services/hssdb/templates/configmap.yaml
new file mode 100644
index 0000000..81b880d
--- /dev/null
+++ b/xos-services/hssdb/templates/configmap.yaml
@@ -0,0 +1,23 @@
+---
+
+# 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: hssdb
+data:
+ serviceConfig: |
+{{ include "hssdb.serviceConfig" . | indent 4 }}
diff --git a/xos-services/hssdb/templates/deployment.yaml b/xos-services/hssdb/templates/deployment.yaml
new file mode 100644
index 0000000..a4b610b
--- /dev/null
+++ b/xos-services/hssdb/templates/deployment.yaml
@@ -0,0 +1,82 @@
+---
+# 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: apps/v1beta2
+kind: Deployment
+metadata:
+ name: {{ template "hssdb.fullname" . }}
+ labels:
+ app: {{ template "hssdb.name" . }}
+ chart: {{ template "hssdb.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+spec:
+ replicas: {{ .Values.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ template "hssdb.name" . }}
+ release: {{ .Release.Name }}
+ template:
+ metadata:
+ labels:
+ app: {{ template "hssdb.name" . }}
+ release: {{ .Release.Name }}
+ annotations:
+ checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
+ spec:
+ containers:
+ - name: {{ .Chart.Name }}
+ image: {{ .Values.synchronizerImage | quote }}
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
+ resources:
+{{ toYaml .Values.resources | indent 12 }}
+ volumeMounts:
+ - name: hssdb-config
+ mountPath: /opt/xos/synchronizers/hssdb/hssdb_config.yaml
+ subPath: hssdb_config.yaml
+ - name: certchain-volume
+ mountPath: /usr/local/share/ca-certificates/local_certs.crt
+ subPath: config/ca_cert_chain.pem
+ - name: hssdb-keys
+ mountPath: /opt/xos/services/hssdb/keys
+ readOnly: true
+ volumes:
+ - name: hssdb-config
+ configMap:
+ name: hssdb
+ items:
+ - key: serviceConfig
+ path: hssdb_config.yaml
+ - name: certchain-volume
+ configMap:
+ name: ca-certificates
+ items:
+ - key: chain
+ path: config/ca_cert_chain.pem
+ - name: hssdb-keys
+ secret:
+ secretName: hssdb-keys
+ {{- with .Values.nodeSelector }}
+ nodeSelector:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- with .Values.affinity }}
+ affinity:
+{{ toYaml . | indent 8 }}
+ {{- end }}
+ {{- with .Values.tolerations }}
+ tolerations:
+{{ toYaml . | indent 8 }}
+ {{- end }}
diff --git a/xos-services/hssdb/templates/secret.yaml b/xos-services/hssdb/templates/secret.yaml
new file mode 100644
index 0000000..3cc52d9
--- /dev/null
+++ b/xos-services/hssdb/templates/secret.yaml
@@ -0,0 +1,23 @@
+---
+# 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: hssdb-keys
+ namespace: default
+type: Opaque
+data:
+ id_rsa: {{ .Files.Get .Values.privateKeyFile | b64enc }}
\ No newline at end of file
diff --git a/xos-services/hssdb/values.yaml b/xos-services/hssdb/values.yaml
new file mode 100644
index 0000000..d663dd5
--- /dev/null
+++ b/xos-services/hssdb/values.yaml
@@ -0,0 +1,45 @@
+---
+# 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.
+
+# Default values for hssdb.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+replicaCount: 1
+
+nameOverride: ""
+fullnameOverride: ""
+
+imagePullPolicy: 'IfNotPresent'
+
+synchronizerImage: "xosproject/hssdb-synchronizer:master"
+
+xosAdminUser: "admin@opencord.org"
+xosAdminPassword: "letmein"
+
+vnfImageURL: "http://www.vicci.org/cord/image-hss-db.qcow2.20180511"
+vnfImageVersion: "v0.1"
+vnfImageFlavor: "m1.large"
+
+publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL5L5vDsQ1bmSeisxMf/GZEqv85oHHu6RFE17VYoTAuBBsHQnETOccbQT85qSBy5NAMAICtOd15iXYfmul0eFeSHoQr1H3IAXT0if6ANxXOm8/Z2rlRNthOEgsjDQU9foNxQ4wksygy5epKmbEhMqbFZjuj4zYfStPzE/gkFSE9QjhKMWaJmyLFfq9f8DnC+TTE41K5iGbtramr7qHSWsKKy75XV6MZZLLFExrQqlYDlLA2V0aYezCql3fB96KJmf6GJRT3j3Y7oWaj7gEzMCycA2QgP8ZNFL/2Q1qgvQRc6I46/HUiOh3IT8LVDdo2ZUn9qrNameQ1zR7a+wBvYIV Insecure M-CORD keypair"
+privateKeyFile: "files/id_rsa"
+
+resources: {}
+
+nodeSelector: {}
+
+tolerations: []
+
+affinity: {}