[CORD-2909] Flatten and parameterize charts

Change-Id: I695c1df063b0f6f6ccf280254d54cc701292348f
diff --git a/xos-services/vtn-service/templates/_helpers.tpl b/xos-services/vtn-service/templates/_helpers.tpl
index 97456ba..8860c56 100644
--- a/xos-services/vtn-service/templates/_helpers.tpl
+++ b/xos-services/vtn-service/templates/_helpers.tpl
@@ -45,3 +45,41 @@
 {{- define "vtn.chart" -}}
 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
+
+{{- define "vtn.serviceConfig" -}}
+name: vtn
+accessor:
+  username: {{ .Values.xosAdminUser | quote }}
+  password: {{ .Values.xosAdminPassword | quote }}
+  endpoint: xos-core:50051
+required_models:
+  - AddressPool
+  - Controller
+  - Network
+  - Node
+  - Port
+  - Service
+  - ServiceInstance
+  - Tag
+  - VTNService
+dependency_graph: "/opt/xos/synchronizers/vtn/model-deps"
+models_dir: "/opt/xos/synchronizers/vtn/models"
+sys_dir: "/opt/xos/synchronizers/vtn/sys"
+steps_dir: "/opt/xos/synchronizers/vtn/steps"
+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/vtn-service/templates/configmap.yaml b/xos-services/vtn-service/templates/configmap.yaml
index b073e78..4349407 100644
--- a/xos-services/vtn-service/templates/configmap.yaml
+++ b/xos-services/vtn-service/templates/configmap.yaml
@@ -20,4 +20,4 @@
   name: vtn
 data:
   serviceConfig: |
-{{ toYaml .Values.serviceConfig | indent 4 }}
+{{ include "vtn.serviceConfig" . | indent 4 }}
diff --git a/xos-services/vtn-service/templates/deployment.yaml b/xos-services/vtn-service/templates/deployment.yaml
index d75808b..2b8c37f 100644
--- a/xos-services/vtn-service/templates/deployment.yaml
+++ b/xos-services/vtn-service/templates/deployment.yaml
@@ -39,16 +39,17 @@
     spec:
       containers:
         - name: {{ .Chart.Name }}
-          image: "{{ .Values.pull_docker_registry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}"
-          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          image: {{ .Values.vtn_synchronizerImage | quote }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           resources:
 {{ toYaml .Values.resources | indent 12 }}
           volumeMounts:
             - name: vtn-config
               mountPath: /opt/xos/synchronizers/vtn/vtn_config.yaml
               subPath: vtn_config.yaml
-            - name: cert-chain-secret
-              mountPath: /usr/local/share/ca-certificates
+            - name: certchain-volume
+              mountPath: /usr/local/share/ca-certificates/local_certs.crt
+              subPath: config/ca_cert_chain.pem
       volumes:
         - name: vtn-config
           configMap:
@@ -56,9 +57,12 @@
             items:
               - key: serviceConfig
                 path: vtn_config.yaml
-        - name: cert-chain-secret
-          secret:
-            secretName: cert-chain-secret
+        - name: certchain-volume
+          configMap:
+            name: ca-certificates
+            items:
+              - key: chain
+                path: config/ca_cert_chain.pem
     {{- with .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml . | indent 8 }}